//对手价函数DYNAINFO( 28)只有最新值,没有历史值。这个需要注意下。
t:EXTGBDATA( 'time');
if cross(ma(close,5),ma(close,10)) then begin buy(holding=0,1,market);EXTGBDATASET('time' ,CURRENTTIME );end
if (ENTERPRICE-close)/close>0.05 and t<>0 and t-CURRENTTIME<3600 then
begin
sell(holding>0,holding,limit,DYNAINFO( 28)+10*MINDIFF);
end
if (ENTERPRICE-close)/close>0.3 then
begin
sell(holding>0,holding,limit,DYNAINFO( 28)+30*MINDIFF);
end
仅供参考,需要在工具-数据管理-全局变量下定义一个全局变量:time.
受到动态函数的使用限制,没有别的办法可以处理。 或者你换成别的价格,收盘价之类的。