第二根k线收盘价高于前面一根k线收盘价就开仓做多, 如果第二根k线收盘价低于前面一根k线收盘价了就做空。 不是做空就是做多,直到收盘平仓! 请帮忙的朋友,在开仓手数那里 编程写“单量”, 这样开仓手数的参数我自己可以调节!谢谢 |
再贴一下需求
cond1:=c>ref(c,1);
cond2:=c<ref(c,1);
n:=1;
if cond1 then begin
sellshort(holding<0,0,thisclose);
buy(holding=0,n,thisclose);
end
if cond2 then BEGIN
sell(holding>0,0,thisclose);
buyshort(holding=0,n,thisclose);
end