如果限制日內交易次數 [金字塔]
- 咨詢內容:
請教,如果限制日內交易次數啊?
- 金字塔客服:
限制平倉次數用TOTALDAYTRADE、
限制開倉次數用全局變量
- 用戶回復:
【金字塔使用技巧】----用全局變量限定一天交易次數
variable:num=0;// 全局變量,來控制當天交易次數
cs:=5;//限定一天最多交易5次
ma5:=ma(5,close);
ma20:=ma(20,close);
con1:=cross(ma5,ma20);
con2:=cross(ma20,ma5);
if cond2 and holding>0 then sell(1,1,market);
if cond1 and holding=0 and lossnum<5 then
begin
buy(1,1,market);
num:=num+1;
end
if time=closetime(0) then num:=0;// 商品期貨,收盤的同時,num賦值為0
//收盤lossnum不賦值為0,后面就不再開倉了
[此貼子已經被作者于2013/7/31 11:18:21編輯過]
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 (不貴!點擊查看價格!)
相關文章
-
沒有相關內容