If marketposition<>-1 and LongTrades=True then begin;
EntNext = High[H16] >= Low[L2] and var17=1 and
Close[C18] >= Open[O8] and
Low[L2] <= Low[L2] and
High[H8] <= Open[O11] and
Open[O10] >= Close[C16];
If EntNext then
Buy next bar at market;
If BarsSinceEntry = entry17 then
Sell next bar at market;
end;
If marketposition<>1 and ShortTrades=True then begin;
EntNext = High[SH16] <= Low[SL2] and var10=1 and
Close[SC18]<= Open[SO8] and
Close[SC4] >=Low[SL8] and
Low[SL2] >= Low[SL2] and
High[SH8]>=Open[SO11] and
Open[SO10] <= Close[SC16];
If EntNext then
Sell short next bar at market;
If BarsSinceEntry = entry17S then
Buy to cover next bar at market;
end;
上面的什麼H16、L2…等可以設定成參數去進行最佳化,但是記得參數不要設定太廣的RANGE,否則很容易過度最佳化。
0 留言:
張貼留言
如果有私人問題想請教,請透過網站右方『與站長聯絡』之表單,謝謝!