進場多單一口後,停損設當天台指期開盤價-150點,策略語法如下:
input: stoploss(150);.
Value3=OpenD(0)- stoploss;
Condition4 = Low <=value3; if Date<>Date[1] and marketposition*currentcontracts=1 and condition4 then sell("stoploss") 1 contract next bar at market;
messagelog的value3如下:
1211006.001058.0016320.00 1211006.001059.0016320.00 1211006.001100.0016320.00 1211006.001101.0016320.00 1211006.001102.0016320.00 1211006.001103.0016320.00 1211006.001104.0016320.00 1211006.001105.0016320.00 1211006.001106.0016320.00 1211006.001107.0016320.00=>11:07出現當天最低點16265 1211006.001108.0016320.00 1211006.001109.0016320.00 1211006.001110.0016320.00 1211006.001111.0016320.00 1211006.001112.0016320.00 1211006.001113.0016320.00
但是2021/10/06當天開盤是16470-150=16320>16265,但回測卻沒有出場,data1 頻率是1分K,data2頻率是日K。
再請客服人員幫忙回答,謝謝您~
您好:
您出場條件是 if Date<>Date[1] and marketposition*currentcontracts=1 and condition4 then sell("stoploss") 1 contract next bar at market;
要滿足 Date<>Date[1] 此條件只有在換日那根 K 棒。
所以你要看換日的 K 棒有沒有滿足另外兩個條件。
已解決,謝謝您~