• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
        https://ninjatrader.com/support/help...gyselector.htm

        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 Captain_Qwark, Today, 10:55 AM
              3 responses
              18 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by kmpc1, Today, 11:03 AM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_PatrickG  
              Started by jransom, Today, 09:08 AM
              1 response
              19 views
              0 likes
              Last Post NinjaTrader_Kate  
              Started by mtamaku, Today, 09:19 AM
              0 responses
              23 views
              0 likes
              Last Post mtamaku
              by mtamaku
               
              Started by traderMNQ, Today, 09:00 AM
              4 responses
              20 views
              0 likes
              Last Post traderMNQ  
              Working...
              X