Skip to content

Commit

Permalink
Added alert to check ATM strategy loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
WaleeTheRobot committed Jan 5, 2025
1 parent d614a39 commit 3726d5b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions NinjaTrader/Custom/AddOns/OrderFlowBot/OrderFlowBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ protected override void OnStateChange()
{
InitializeUIManager();
}

if (!BacktestEnabled)
{
CheckATMStrategyLoaded();
}
}
else if (State == State.Realtime && Category != Category.Backtest)
{
Expand Down Expand Up @@ -509,6 +514,21 @@ private bool ValidateTimeProperties()
}

#endregion

private void CheckATMStrategyLoaded()
{
string template = ChartControl?.OwnerChart?.ChartTrader?.AtmStrategy?.Template;

if (template == null)
{
System.Windows.MessageBox.Show(
"ATM Strategy template is not loaded.",
"Alert",
System.Windows.MessageBoxButton.OK,
System.Windows.MessageBoxImage.Warning
);
}
}
}

public class CumulativeDeltaSelectedPeriodConverter : TypeConverter
Expand Down

0 comments on commit 3726d5b

Please sign in to comment.