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

Best Way to Reverse From Trailstop? Calculate On Each Tick

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

    Best Way to Reverse From Trailstop? Calculate On Each Tick

    I set a trailstop on an NT8 strategy using calculate on each tick. How can the strategy know when the trailstop has executed? I want to enter in reverse.

    #2
    Hello ronaldgreene828,

    Thanks for your post.

    You previously wrote in to us on the same subject/questions and I have already replied to your e-mail. Please check your junk/spam e-mail if you do not see a reply.

    Here is a copy:
    =====================
    "I set a trailstop on an NT8 strategy using calculate on each tick. " -That would be the correct setting to have the trailstop move correctly.

    "How can the strategy know when the trailstop has executed? I want to enter in reverse. " — If you mean when the trailstop has closed the position, you could check the MarketPosition which will be flat when the trailstop has filled. Reference: https://ninjatrader.com/support/help...etposition.htm
    =====================

    Going forward please either write in or post on the forums (either is fine) but we respectfully request that you do not do both on the same subject.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Ok, thanks. First time it ever went to spam, I apologize for that.

      Your suggestion works, but for some reason the trailstop will not execute. I made a manual trailstop also, and it will not update the High[0] value until the next bar. I have calculate on each tick but I am using point and figure bars on market playback. Is this the reason for the problem and will it be the same on a live chart?

      Maybe I should post a new topic

      Comment


        #4
        Hello ronaldgreene828,

        Thanks for your reply.

        Can you clarify what you mean by " made a manual trailstop also, and it will not update the High[0] value until the next bar.". I'm not sure what a manual trailstop means relative to a change in price.

        I would suggest testing on a standard candle stick chart to see if you see the same or expected performance.

        What are the data series settings for your point and figure chart?


        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I set the box size to 25, period type volume with a value of 500 and reversal at 3. I've tried other settings too with the same result. The trailstop doesn't work until another bar opens. I also tried using High[0] thinking that this updates on each tick, subtracting the stoploss amount for a long exit when price falls below. By manual trailstop, I mean that I used a highest high variable for a long trade, checking the price and updating on each tick and then see if the price has moved below that after subtracting a stoploss amount. It will normally wait also until the next bar opens to work. I set a stoploss also and this will often execute at double the number of points, like a 15 pt. stoploss going out at 25 or 30 pts. I read once somewhere that point and figure bars don't work the same on playback because of the way data is handled, but I don't remember the details and I couldn't find anything online. When my account is funded again, I can get live data and test it on a sim account.

          Comment


            #6
            Hello ronaldgreene828,

            Thanks for your reply.

            Please confirm that you have set the strategy itself to Calculate.OnEachTick. Please note that this is not the same thing as setting the trailstop to CalculateMode.ticks.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Yes, in the editor it says Calculate.OnEachTick.

              Comment


                #8
                Hello ronaldgreene828,

                Thanks for your reply.

                I've performed some tests with Pnf charts and a strategy that uses SetTrailStop() and the strategy was set to Calculate.OnEachTick. I tested with playback using market replay data as well as Live data. I can advise that I observed that the trailing stop does not move until the new x or o is printed. I've written this up to investigate further.

                Going forward, at the moment, I either would not use the trailing stop on a point and figure bar, or use it at the risk of moving once per bar which could cause a potential incorrect order movement (if you get a fast price retracement). You may want to explore using the trailing stop on other bar types where you should expect a 1: 1 movement when used with Calculate.OnEachTick.

                Once I get feedback from the investigation on what should be expected I will update you.

                Thanks in advance for your patience.

                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks, that's good to know because I can adjust the box size, make it smaller if necessary for use in a live chart and test it there.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DanielTynera, Today, 01:14 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post DanielTynera  
                  Started by yertle, 04-18-2024, 08:38 AM
                  9 responses
                  40 views
                  0 likes
                  Last Post yertle
                  by yertle
                   
                  Started by techgetgame, Yesterday, 11:42 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post techgetgame  
                  Started by sephichapdson, Yesterday, 11:36 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post sephichapdson  
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,615 views
                  0 likes
                  Last Post aligator  
                  Working...
                  X