以螺纹钢为例: 模型要求:比如我手工输入一个价格3850,今天的收盘价是3800,明天开盘以后,价格如果突破3850,以价格3850元开多,并且以5分钟K线低点设置止损点(5分钟行情图表),如果行情再跌破这个低点,再平多反空,并再以跌破的K线高点设定止损线。 |
你这种半自动的需求,建议你直接用条件单或者划线下单实现。
另外你的意思是从你指定的那一刻开始向后计算,而不是吧之前前的信号也算进来?开仓条件位置加时间限制。
VARIABLE:ll=0,hh=3805;
ss:=1;
开仓条件:date=1170918 and time=013000 and c>3700 and holding=0;
if 开仓条件 then begin
buy(1,ss,marketr);
ll:=l;
end
if c<=ll then begin
sell(holding>0,holding,marketr);
buyshort(holding=0,ss,marketr);
hh:=h;
end
if c>hh and holding<0 then sellshort(1,holding,marketr);