AtmStrategy

View as Markdown

AtmStrategy contains properties and methods used to manage ATM Strategies. When working with an AtmStrategySelector, selected objects can be case to AtmStrategy to obtain or change their properties.

  1. For a complete, working example of this class in use, download framework example located on our Developing AddOns Overview
  2. For more information on working with the ATM strategies programmatically in general, please see the Using ATM Strategies section.

Example

1// Using AtmStrategy to handle user selections in an ATM Strategy Selector
2myAtmStrategySelector.SelectionChanged += (o, args) =>
3{
4 if (myAtmStrategySelector.SelectedItem == null)
5 return;
6 if (args.AddedItems.Count > 0)
7 {
8 // Change the selected TIF in a TIF selector based on what is selected in the ATM Strategy Selector
9 NinjaTrader.NinjaScript.AtmStrategy selectedAtmStrategy = args.AddedItems[0] as NinjaTrader.NinjaScript.AtmStrategy;
10 if (selectedAtmStrategy != null)
11 {
12 myTifSelector.SelectedTif = selectedAtmStrategy.TimeInForce;
13 }
14 }
15};