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

Need to Reset Strategy Trail Stop Values

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

    Need to Reset Strategy Trail Stop Values

    I have a strategy that has a trailing stop which after X amount of ticks uses the Atr Trailing stop for the stop.

    I set Position.AveragePrice + Xamount of ticks which then activates the trailing stop. I reset this value when the position is flat.

    This works fine 90% of the time.

    about 1 or 2xs a day the value will not reset even when I disable and re-enable the strategy.
    I have to disconnect and reconnect from Continuum to get this value to reset.

    I get no errors in the log.

    Has anybody seen this before?


    #2
    Hello sdauteuil,

    Thank you for your post.

    Is this occurring when using the Sim101 account or a live account? Who is your data provider?

    What does the strategy report for its position when this occurs? You should be able to see the strategy position on the Strategies tab of the Control Center. Do the strategy and account positions match?

    When you print the value after attempting to reset it do you not see the value being reset? How are you determining the value is not reset?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      This happens in live and sim101.

      When the position closes the strategy shows flat in the control center and the account is synced.

      I have the value print on the screen so I can see it is not reset.

      What happens then is when a new position is opened the trailing stop immediately triggers at the previous value.

      I am using continuum.

      I also set the strategy to reset the value when the position is exited.

      So it resets at the beginning of OnBarUpdate when the position is flat and when the position is exited.
      Originally I just had it to reset when the position was flat and later added the reset when the position is exited ExitLong()

      Also it happens whether or not I use an entry name with ExitLong()

      Comment


        #4
        Hello sdauteuil,

        Thank you for your reply.

        We'd want to test on our end with a reduced version of your code to determine what's occurring. Any code unnecessary to reproduce should be omitted. Please export the reduced strategy from Tools > Export > NinjaScript Add-on. Do not check the box to export as a compiled assembly, or we will be unable to review the code. Please attach the resulting .Zip file to your reply. If you'd rather not post this publicly, you can also email it to us directly at platformsupport [at] ninjatrader [dot] com. If you go this route, please put 2867774 ATTN Kate W. in the subject line so it gets to me.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thank you

          I will put something simple together and send it over.

          I was wondering if this could be the issue...

          I am running the same strategy on 3 different charts - same instrument - each chart linked to a separate account - I have 3 charts because each is a different time frame.

          Is it possible having the same strategy running a several charts could cause problems?

          Comment


            #6
            Hello sdauteuil,

            Thank you for your reply.

            Instances of Strategies are independent of each other, and if you're running them on different accounts, no. They wouldn't affect each other.

            I will keep an eye out for your reduced strategy for testing.

            Thanks in advance; I look forward to assisting you further.
            Kate W.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cls71, Today, 04:45 AM
            0 responses
            1 view
            0 likes
            Last Post cls71
            by cls71
             
            Started by mjairg, 07-20-2023, 11:57 PM
            3 responses
            213 views
            1 like
            Last Post PaulMohn  
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            4 responses
            544 views
            0 likes
            Last Post PaulMohn  
            Started by GLFX005, Today, 03:23 AM
            0 responses
            3 views
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            12 views
            0 likes
            Last Post XXtrader  
            Working...
            X