8200 自動交易錯誤,從2024開始問,回報問提,送了N次log,都沒答案
請問如何寫才正確?請大神幫忙

If Position = 0 Then Begin
If _long_ok Then Begin
SetPosition(1, Market, label:="多單進場");
_entry_price = Close;
_stop_price = _entry_price - (_stop_points * _min_move / _price_scale); // 分開計算,避免錯誤
Return;
End
Else If _short_ok Then Begin
SetPosition(-1, Market, label:="空單進場");
_entry_price = Close;
_stop_price = _entry_price + (_stop_points * _min_move / _price_scale); // 分開計算,避免錯誤
Return;
End;
End;
// 多單出場
If Position > 0 Then Begin
If Close <= _stop_price or _exit_long Then Begin
SetPosition(0, Market, label:="多單出場(含停損)");
_entry_price = 0; _stop_price = 0;
Return;
End;
End;
// 空單出場
If Position < 0 Then Begin
If Close >= _stop_price or _exit_short Then Begin
SetPosition(0, Market, label:="空單出場(含停損)");
_entry_price = 0; _stop_price = 0;
Return;
End;
End;
2 評論