请帮忙,谢谢!
N分钟周期下,买入后,要求从次一个交易日起开始卖出(不能从下一根K线起),这个“次交易日起”条件如何实现?
if 次一个交易日 and c>enterprice then sell();
date_1:=valuewhen(开仓条件,date);
if date>=date_1+1 and c>enterprice then sell;//注意,这个判断条件,正好月末的时候,不顶用
用全局变量控制.以下为简单示例
variable:flag=0;// 全局变量,买开仓时赋值为1
if cond1 and holding=0 then
begin
buy(1,1,market);
flag:=1;
end
if cond2 and holding>0 and flag=0 then sell(1,1,thisclose);
if time=150000 then flag:=0;// 商品期货,收盘的同时,flag赋值为0