Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with an ATM Strategy with a trailing stop

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

    Issue with an ATM Strategy with a trailing stop

    ​Hi,

    I am having an issue with this section of my strategy. I am trying to create a trail stop with the ATM strategy.

    Basically, when the PNL is negative, the stop loss will move by 1 tick or 2. I work perfectly with the bullish statement, but I cannot replicate that in the bearish case.

    Click image for larger version

Name:	image.png
Views:	199
Size:	29.5 KB
ID:	1280350

    In the Berish case, the script keeps trying to stop loss below the Market price. Any feedback?

    #2
    Hello patdmoney,

    Thanks for your post.

    " the script keeps trying to stop loss below the Market price."

    To clarify are you getting an error message when the stop loss is moved in this case?

    If so what exactly does the error message state? Please send a screenshot of the error message so we may accurately assist.

    Further, have you added debugging prints that print out the current market price, the price you are submitting the order to, and the time one line above AtmStrategyChangeStopTarget()?

    If not, please add debugging prints to your script to understand how the logic is evaluating.

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

    I look forward to assisting further.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thank you. I was able to fix it.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      359 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      281 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X