fxj9999
2008-12-27, 10:32
easylanguige里只能今日收盘买卖,明天收盘买卖是个难题。例如,如果想表达如下想法该如何编写程序:
按照今天收盘价买入,明天报出今天的最高价出货,如果没有成交,那么以明天收盘价卖出,连续交易。
试着编写了个公式,插入图中一看,不能很好表达这种想法。
贴出来大家提提宝贵意见:
vars:m1(0);
m1=h;
if m1[1]<m1 {and marketposition=1} then sell this bar close;
//if m1[1]<h and currententries=1 then sell this bar close;
//if marketposition(1)=1 then sell this bar close;
//if currententries=1 then sell this bar close;
buy this bar close;
sell next bar m1 limit;
按照今天收盘价买入,明天报出今天的最高价出货,如果没有成交,那么以明天收盘价卖出,连续交易。
试着编写了个公式,插入图中一看,不能很好表达这种想法。
贴出来大家提提宝贵意见:
vars:m1(0);
m1=h;
if m1[1]<m1 {and marketposition=1} then sell this bar close;
//if m1[1]<h and currententries=1 then sell this bar close;
//if marketposition(1)=1 then sell this bar close;
//if currententries=1 then sell this bar close;
buy this bar close;
sell next bar m1 limit;