Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Issue with my Trailing Stop

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

    Strategy Issue with my Trailing Stop

    I don't know if this is an issue just with historical data issues today or because of the contract changes while I still was attempting to run ES 3-23. When my orders were entered, my trailing stop should not activate until 160 ticks but it was placed at entry just 28ish ticks below and then didn't move at all. It stopped me out on a few trades that I have never had any issues before now. Is this something that can happen when nearing contract changes and you just need to make sure to switch right away?

    Also, once I reset everything and my chart the data didn't even load properly so it made me take a long trade early. I then reloaded the historical data and the strategy, and it happened again. I then turned off Ninja trader and changed contracts to 6-23 but I do not know if it will happen again until another trade us executed.
    Last edited by durdcash; 03-15-2023, 01:23 PM.

    #2
    Hi durdcash, thanks for posting. The trailing stop issue is either due to your code and is reproducible on the newest contracts or the contract had no volume, so OnBarUpdate did not get called for your strategy which would prevent the trailing stop from moving. Please let me know if you get the same issue using your strategy on the newest contracts.

    Kind regards,
    -ChrisL​

    Comment


      #3
      So, it was essentially placing my trail below by entry by roughly 7pts. It is not supposed to activate and move near there until I am much deeper into my trade. I have a hard stop set on entry 84 ticks below the market and the trailing stop is set at 104 ticks until we get to 160 and then it trails 45 ticks. My custom code has never had this issue before. Can it have to do with historical data not being right when contracts change? When I made it take a trade with a different chart and data series on the 6-23 contract it did not reproduce itself. My guess is I just need to roll contracts right as ninja trader recommends it. There was volume on the contract still but it definitely makes sense to be that kind of issue.

      Comment


        #4
        Hi, when you roll over into the newest contract, the platform uses the set Merge Policy to combine the contracts together, so there should not be anything wrong with historical data and I do not believe that to be the issue since we are speaking of real-time trading when you noticed this problem. No external factors should effect the workings of a custom strategy unless its from lack of volume or the code itself, in that case you would need to monitor the code using Print() to make sure OnBarUpdate is running. The platform will give you a popup notification window that will let you automatically roll the instrument when the time comes.

        Comment


          #5
          Is there something I can read about the merge policy? It seems like that probably could have been part of the issue with how my code is written, if I had to guess. Since it did not seem to be an issue on the new contract. I will play around with it in sim to see if that's one of the factors.

          Comment


            #6
            Found a post about the merge policy and the offset is what caused the issue without a doubt. All should be good now!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            86 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            48 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            30 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            33 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            67 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X