收盘价大于20天均线且收盘价大于开盘价,买开
收盘价小于20天均线,卖平
收盘价小于20天均线且收盘价小于开盘价,卖开
收盘价大于20天均线,买平
亏损大于50点,止损
请教达人,这个怎么编写?
c1:c;
ma20:ma(c,20);
//收盘价大于20天均线且收盘价大于开盘价,买开
if cross(c,ma20) and c>o then begin
sellshort(holding<0,0,thisclose);
buy(holding=0,1,thisclose);
end
//收盘价小于20天均线,卖平
if cross(ma20,c) then sell(holding>0,0,thisclose);
//收盘价小于20天均线且收盘价小于开盘价,卖开
if cross(ma20,c) and c<o then begin
sell(holding>0,0,thisclose);
buyshort(holding=0,1,thisclose);
end
//收盘价大于20天均线,买平
if cross(c,ma20) then sellshort(holding<0,0,thisclose);
//亏损大于50点,止损
if c>enterprice+50*mindiff or c<enterprice-50*mindiff then begin
sell(holding>0,0,thisclose);
sellshort(holding<0,0,thisclose);
end
谢谢LS的兄弟