Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATM Reverse At Stop

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

    ATM Reverse At Stop

    Hello,

    I set up my ATM Strategy with Reverse at Target checked. I understand that if the stop is hit, a position will be taken in the opposite direction with the same stop and target parameters as the original ATM strategy dictated.

    What methods do we use to adjust these new stops and targets? And how do we reference these new stops and targets, or how maybe for example how do we reference the reverse at target condition being true?

    #2
    Hello MisterGee,

    The orders would be placed to the account.

    It would be necessary to loop through the <Account>.Orders / <Account>.Strategies.
    https://ninjatrader.com/support/help...rs_account.htm
    https://ninjatrader.com/support/help...es_account.htm
    https://ninjatrader.com/support/foru...21#post1085921

    While there is not anything in the help guide about the AtmStrategy class, this does have bool .ReverseAtStop, long .ReverseAtStopStrategyId, bool .ReverseAtTarget, and long .ReverseAtTargetStrategyId properties.
    Last edited by NinjaTrader_ChelseaB; 06-06-2021, 05:09 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea.

      Could you provide a more detailed example or sample script for how to utilize these bool properties?

      Comment


        #4
        Hello MisterGee,

        These are not documented, meaning these would be use at your own risk.

        Unfortunately, I am not aware of any scripts that use these properties.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I am fine taking on the risk. I just need to know how to use them so I can test it out.. for example
          Code:
          if (atmStrategyId.ReverseAtStopStrategyId == true)
          { Do stuff;}
          Do I use it like this?


          Comment


            #6
            Hello MisterGee,

            The ReverseAtStopStrategyId is a property of an AtmStrategy object that is a long (a long is a number). ReverseAtStop is a property that is a bool.

            I cannot provide any official usage as this is not documented, but perhaps try

            if (atmStrategy.ReverseAtStop)
            {
            // strategy is reverse at stop
            }

            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I get a CS1061 error when utilizing your suggestion. 'string does not contain a definition for Reverse stop......'

              Comment


                #8
                Hello MisterGee,

                Is the atmStrategy variable an AtmStrategy object?
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Mongo, Today, 11:05 AM
                0 responses
                1 view
                0 likes
                Last Post Mongo
                by Mongo
                 
                Started by Tim-c, Today, 10:58 AM
                0 responses
                1 view
                0 likes
                Last Post Tim-c
                by Tim-c
                 
                Started by traderqz, Yesterday, 09:06 AM
                3 responses
                21 views
                0 likes
                Last Post NinjaTrader_ThomasC  
                Started by f.saeidi, Today, 10:19 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by kujista, Today, 06:23 AM
                5 responses
                18 views
                0 likes
                Last Post kujista
                by kujista
                 
                Working...
                X