Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to test when ATM is "None" ?

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

    how to test when ATM is "None" ?

    when the ATM is set to None....how can I tell this in Ninjascript?

    #2
    in NT7 I could test for the string "<None>"

    but there is no string available in NT8 and there is no object to test ...

    Comment


      #3
      Hello llanqui,

      If you are referring to the Chart Trader Atm selector, you can check that the ChartControl.OwnerChart.ChartTrader.AtmStrategy.Te mplate is null.

      I am having an issue extracting the atm strategy name from the chart trader. I know I can make my own listbox in the parameter listing, but I want to extract it from the chart trader instead of opening it everytime. How od Iget the contract quantity and the strategy name in order to create my order? int nContractQuantity =
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        ok, will try that thanks

        Comment


          #5
          I'm getting an error

          Object Reference not set to an instance

          if (ChartControl.OwnerChart.ChartTrader.AtmStrategy.T emplate == null)

          Comment


            #6
            Hello llanqui,

            May I confirm this strategy is added to a chart and this line of code is in OnBarUpdate()?

            Is the ChartControl null?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              no, it is in button click event in an indicator

              these have no problem

              this_Account = ChartControl.OwnerChart.ChartTrader.Account;
              this_AccountName = ChartControl.OwnerChart.ChartTrader.Account.Name;
              this_Quantity = ChartControl.OwnerChart.ChartTrader.Quantity;


              Comment


                #8
                looked at your code agaon..

                well, I'm not using ChartControl.Dispatcher.InvokeAsync

                it works ok, except for when I want to access the ATMStrategy....

                will do more testing

                Comment


                  #9
                  Ok, I imported the indicator SubmitChartTraderATM from here

                  I am having an issue extracting the atm strategy name from the chart trader. I know I can make my own listbox in the parameter listing, but I want to extract it from the chart trader instead of opening it everytime. How od Iget the contract quantity and the strategy name in order to create my order? int nContractQuantity =


                  questions:

                  1) If the ATM is NONE the code does not submit an Order...but I don't see how this is filtered out?

                  2) If I change the ATM while it is running, it gets an error

                  Error on triggering custom event for NinjaScript 'XXTestATM' on bar 3601: There is an error in XML document (0, 0).

                  I noticed that while I was testing my own .... can you tell me what the problem is?

                  Many thanks

                  Comment


                    #10
                    Ok, to answer Forum above....the ATM definition apparently was corrupt....so, not a problem

                    But still I need to solve question 1 in the prior msg...that was my original question...

                    Comment


                      #11
                      Hello llanqui,

                      I see the issue, the AtmStrategy object is null (and not just the template).

                      Code:
                      ChartControl.Dispatcher.InvokeAsync(() =>
                      {​
                          if (ChartControl.OwnerChart.ChartTrader.AtmStrategy == null)
                          {
                              Print("atmStrategySelector is set to <none>");
                          }
                          else
                          {
                              Print(ChartControl.OwnerChart.ChartTrader.AtmStrategy.Template);
                          }
                      });
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Ok, that should work...will test it...thank you...

                        By the way, it would be extremely helpful if there was a dictionary of all the internal objects and the hierarchy of how they are related...

                        like a Tree List Dictionary

                        Does anything like that exist?



                        Comment


                          #13
                          Hello llanqui,

                          There is not an intention to make the chart trader controls available to NinjaScript. These are not documented and are being supplied by the support team as we discover these objects and properties can be manipulated.

                          This also includes getting things by AutomationID. You can use MSInspect as we do to find the object type and automation id of things.
                          http://ninjatrader.com/support/forum...644#post472644
                          Hi all ! I am trying to implement the example of Event fired by a change in the ATM strategy Selector as shown in the Help for the AtmStrategySelector item https://ninjatrader.com/es/support/helpGuides/nt8/?accountselector.htm Defining the variable as private AtmStrategy.AtmStrategySelector doesn't work because there is no
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            ok, that is a little beyond my skill set at the moment, but I can always study Automation ID and Inspect

                            in NT7 there was a lot of activity on Futures IO that documented things like this

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            647 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            369 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            108 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            572 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            573 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X