Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Listening to ATMStrategySelectionChange

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Listening to ATMStrategySelectionChange

    I would like to get a hold of the AtmStrategySelector in the ChartTrader so that I can listen to AtmStrategyChanged events.

    How do I get a hold of the AtmStrategySelector?

    I tried this and it did not work:
    atmStrategySelector = chartTrader.FindName("AtmStrategySelector") as AtmStrategySelector;

    Is there a specific AutomationID for it?

    Thanks,
    Gary

    #2
    Hello Gary,

    There will not be an AutomationId to find AtmStrategies.

    Below I am providing a link to the help guide on using AtmStrategySelector from the Addon base class.
    http://ninjatrader.com/support/helpG...gyselector.htm

    There is a premade AtmStrategy object (which inherits from AtmStrategySelector class) that you can add to a xaml page or to your code directly as a new AtmStrategy object.

    <AtmStrategy:AtmStrategySelector x:Name="atmStrategySelector" LinkedQuantity="{Binding Value, ElementName=qudSelector, Mode=OneWay}" Grid.Column="2"/>

    private AtmStrategy.AtmStrategySelector atmStrategySelector;
    atmStrategySelector = new AtmStrategy.AtmStrategySelector();
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks chelsea,

      I was aware of that example but did not want to instantiate my own selector if one was already visible on the ChartTrader (since my stuff works along with ChartTrader).

      But if that is the way to go, how do you submit an order using the selected AtmStrategy?
      I could not find a property that just gave me it's name, (so I am not sure how I could use it in a call to 'AtmStrategyCreate').
      Do I somehow submit an order using the AtmStrategy instance?
      What method do i call?
      Do I still call GetAtmStrategyUniqueId() and assign the value to AtmStrategy.Id ?
      Can I reuse that AtmStrategy instance over and over again to generate new orders?

      Some more complete code examples would be great.

      Thanks,
      Gary

      Comment


        #4
        Hi Gary,

        Thank you for clarifying. I did misunderstand the question.

        You are looking for the existing Atm Strategy selector and not trying to add one to your script.

        Yes the existing Atm Strategy Selector does have a unique AutomationId 'ChartTraderControlATMStrategySelector'.


        To submit the order, you would need the selected value. Once you have the control you want the .SelectedItem of that control. This is shown in the link I have provided previously on working with the AtmStrategySelector.


        Then supply that to AtmStrategyCreate().
        http://ninjatrader.com/support/helpG...tmstrategy.htm
        Last edited by NinjaTrader_ChelseaB; 03-28-2016, 11:03 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Doc enhancment?

          Thanks Chelsea, that is exactly what I was searching for.

          FWIW, I did not find the doc page for StartAtmStrategy because I never thought to look under the AddOn section. I am not doing an AddOn exactly.
          Perhaps it would be useful to add a link to the StartAtmStrategy also under:
          NinjaScript->language Reference->Strategy->ATM Strategy Methods.
          I would have found it there.

          Thanks,
          Gary

          Comment


            #6
            Hi Gary,

            You will find that Atm Strategies will be in the help guide in two different places.

            NinjaScript Strategies have their own section in the help guide for using Atm Strategies natively in a NinjaScript Strategy. This is the same as NinjaTrader 7.
            http://ninjatrader.com/support/helpG...gy_methods.htm

            The Addon section is new and has a different approach and different methods for Atm Strategies as this is accessed through something that is not a strategy (doesn't have to be an addon, could be a indicator or other type of script), and requires a bit more setup and uses different methods.
            http://ninjatrader.com/support/helpG...tmstrategy.htm
            http://ninjatrader.com/support/helpG...gyselector.htm

            For what you are wanting to do, this would require using the non-NinjaScript-Strategy methods (that were not available in NT7).
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks!

              Glad to finally have the ATM strategy list available to our code

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by alifarahani, Today, 09:40 AM
              6 responses
              31 views
              0 likes
              Last Post alifarahani  
              Started by Waxavi, Today, 02:10 AM
              1 response
              17 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              14 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Waxavi, Today, 02:00 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X