|
本帖最後由 blj0511 於 16-11-14 14:13 編輯
所以當初我說你有些地方沒交待清楚,因為感覺怪怪的,果然您使用會有問題~
如果你要的效果是 "多單進場後,第一個往上穿越的ma做為之後往下掉的出場依據"的話
if marketposition<=0 then value1=0;
if maketposition>0 and barssinceentry>0 and value1=0 then begin
if close cross over averagefc(close,5) then value1=averagefc(close,5);
end;
if value1>0 then sell next bar at value1 stop;
沒try過,不知道這樣對不對,大概這樣就只會把進場後第一個穿越記下來,因為之後value1不等於0,所以即使後面再發生穿越也不會變更value1的出場值,直到出場或翻單後的再多單進場,可能有些小地方(從哪根K棒開始算穿越?....等等)要在修改一下才會有你要的效果
|
|