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:	186
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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X