Harden HIT entry and manager state handling
This commit is contained in:
@@ -94,8 +94,6 @@ void LoadSLTPInputSettings(SLTPManagerPanelSettings &settings)
|
||||
bool ApplySLTPSettings(const SLTPManagerPanelSettings &settings,
|
||||
const bool print_summary)
|
||||
{
|
||||
g_sltp_settings_valid = false;
|
||||
|
||||
g_sltp_manager.SetMagicNumber((ulong)input_managed_magic_number);
|
||||
g_sltp_manager.SetSymbol(_Symbol);
|
||||
g_sltp_manager.SetDeviationInPoints(input_slippage_points);
|
||||
@@ -111,13 +109,13 @@ bool ApplySLTPSettings(const SLTPManagerPanelSettings &settings,
|
||||
settings.active_step_trigger_pips,
|
||||
settings.active_step_move_pips);
|
||||
g_sltp_manager.SetTpProgressStopSettings(settings.use_tp_progress_stop,
|
||||
settings.tp_progress_trigger_percent,
|
||||
settings.tp_progress_sl_lock_percent);
|
||||
settings.tp_progress_trigger_percent,
|
||||
settings.tp_progress_sl_lock_percent);
|
||||
g_sltp_manager.SetHighVolatilityLimitSettings(settings.use_high_volatility_limit);
|
||||
|
||||
if(!g_sltp_manager.ValidateSettings())
|
||||
if(settings.manager_enabled && !g_sltp_manager.ValidateSettings())
|
||||
{
|
||||
Print("HIT position manager SLTP settings rejected. Manager is disabled until valid settings are applied.");
|
||||
Print("HIT position manager SLTP settings rejected. Previous valid settings remain active.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user