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:	193
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, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Working...
      X