只开仓一次,为啥这段代码时间到了怎么不开仓? [开拓者 TB]
- 咨询内容:
- //------------------------------------------------------------------------
- // 简称: auto
- // 名称: auto
- // 类别: 公式应用
- // 类型: 用户应用
- //------------------------------------------------------------------------
- Vars
- StringSeries code;
- StringSeries num;
- StringSeries type;
- Numeric send_order_finished;
- Numeric order_num;
- Begin
- If(CurrentBar==0 ) {Return;}
- code = GetTBProfileString2File("D:\\TB.txt","ORDER1","Code");
- Commentary("code:"+code);
- num = GetTBProfileString2File("D:\\TB.txt","ORDER1","Num");
- Commentary("num:"+num);
- type = GetTBProfileString2File("D:\\TB.txt","ORDER1","Type");
- Commentary("type:"+type);
- send_order_finished = GetGlobalVar(0);
- Commentary("send_order_finished:"+Text(send_order_finished));
- order_num=Value(num);
- If (CurrentTime>0.114000 && send_order_finished==InvalidNumeric)
- {
- If (Type=="Buy")
- {
- Data0.A_SendOrder(Enum_Buy,Enum_Entry,order_num,Close);
- }
- If (Type=="Sell")
- {
- Data0.A_SendOrder(Enum_Sell,Enum_Entry,order_num,Close);
- }
- send_order_finished=1;
- SetGlobalVar(0,send_order_finished);
- }
-
- //SetTBProfileString2File("D:\\TB.txt","ORDER1","Code","IF1603");
- //SetTBProfileString2File("D:\\TB.txt","ORDER2","Code","IF1604");
- //SetTBProfileString2File("D:\\TB.txt","ORDER3","Code","IF1605");
- //SetTBProfileString2File("D:\\TB.txt","ORDER1","Num","100");
- //SetTBProfileString2File("D:\\TB.txt","ORDER2","Num","200");
- //SetTBProfileString2File("D:\\TB.txt","ORDER3","Num","300");
- //SetTBProfileString2File("D:\\TB.txt","ORDER1","Type","Sell");
- //SetTBProfileString2File("D:\\TB.txt","ORDER2","Type","Buy");
- //SetTBProfileString2File("D:\\TB.txt","ORDER3","Type","Sell");
- End
-
- //------------------------------------------------------------------------
- // 编译版本 GS2015.12.25
- // 用户版本 2016/03/10 10:37:39
- // 版权所有 akward
- // 更改声明 TradeBlazer Software保留对TradeBlazer平台
- // 每一版本的TradeBlazer公式修改和重写的权利
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
- TB技术人员:
- TB客服:
使用a_xxxx的发单 没有限制在最后K线上这一条件吗??
这样是可能导致在历史K线上就满足其它条件,导致条件内的数据被修改,而事实上因为不在最后K线所以委托单还没有发出去呀。。
建议上层条件加上 if(barstatus==2)的限制。
其次,公式里需要加上调试语句,例如fileappend等来记录各条件的状态值这样才好定位问题,并进行修正。 - 网友回复:
great!
搞定,多谢小米!
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容