1、程序里写入满足条件浮盈加仓,但是如何设置加仓的次数
2、请问 每次收盘前30分钟 不开仓 怎么写
1比如你要加仓3次
variable:n=0;
//定义全局变量,用来计算加仓次数
if n<3 and 加仓条件 and 持仓判断 then begin
加仓语句;
n:=n+1;
end
//加仓语句
if time=closetime(0) then n:=0;
//最后收盘时重置变量为0
if
2
(1)首先是要在开仓条件加入一个时间条件
tt:=time0<timetot0(closetime(0))-60*30;限定开仓在收盘前30分钟
(2)然后写收盘平仓代码
if time0>=timetot0(closetime(0))-60*30 then begin
sell(1,0,market);
sellshort(1,0,market);
end