那么该如何修改代码呢,我的主要思路是,突破上根bar的上轨,以此价格做多,突破上根bar 的下轨,以此价格做空? |
如果这样写有没有偷价呢? upband:=ma(c,20)+2*std(c,20);
dnband:=ma(c,20)-2*std(c,20); if holding=0 then
begin
if EntryLongCond then buy(1,1,limitr,upband);
if EntryShortCond then buyshort(1,1,limitr,dnband);
end;
和下面比较哪种可以表示我突破上下轨入场的思路呢?
upband:=ma(c,20)+2*std(c,20);
dnband:=ma(c,20)-2*std(c,20);
if holding=0 then
begin
if EntryLongCond then buy(1,1,limitr,Ref(upband,1));
if EntryShortCond then buyshort(1,1,limitr,REF(dnband,1));
end;
[此贴子已经被作者于2015/2/10 15:02:47编辑过]