Add range breakout guard for reverse limit orders
This commit is contained in:
@@ -453,6 +453,13 @@ int TrySendSplitEntryOrders(const int orderType, EAState &state, TickContext &ct
|
||||
{
|
||||
string entry_type = EntryTypeName(orderType);
|
||||
double cur_price = CurrentPriceForOrderType(orderType, ctx);
|
||||
string guard_reason = "";
|
||||
if(IsLimitOrderBlockedByRangeBreakoutGuard(orderType, guard_reason))
|
||||
{
|
||||
Print("[Split Skip] ", entry_type, " blocked by range breakout guard. ", guard_reason);
|
||||
return 0;
|
||||
}
|
||||
|
||||
double zone_low = state.zone_low[orderType];
|
||||
double zone_high = state.zone_high[orderType];
|
||||
double tp = state.zone_tp[orderType];
|
||||
@@ -551,6 +558,12 @@ bool TrySendEntryOrder(const int orderType, EAState &state, TickContext &ctx)
|
||||
{
|
||||
string entry_type = EntryTypeName(orderType);
|
||||
double cur_price = CurrentPriceForOrderType(orderType, ctx);
|
||||
string guard_reason = "";
|
||||
if(IsLimitOrderBlockedByRangeBreakoutGuard(orderType, guard_reason))
|
||||
{
|
||||
Print("[Skip] ", entry_type, " blocked by range breakout guard. ", guard_reason);
|
||||
return false;
|
||||
}
|
||||
|
||||
double en = state.en_price[orderType];
|
||||
double tp = state.tp_price[orderType];
|
||||
|
||||
Reference in New Issue
Block a user