Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StopLoss does not work

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

    StopLoss does not work

    Hello!

    I am trying to set a Stop loss Order at a defined price. Stop Loss Price calculation works. See output Window - also no other Errors.
    After opening a position I try to set the Stopp Loss using SetStopLoss() - see code - but stop loss will not be executed. Target Setting works.

    I prepared a simple example for demonstration purpose - Please see the attached image with Code, Chart and Output Window result.
    Why does the Stop loss not wok?

    Thank You.

    #2
    Hello Tradix,
    Thanks for your post.

    Does the Logs tab of your Control Center report any errors?

    What does TraceOrders report?


    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh for Your hints,

      the analysis results with TraceOrders and Control Center log show, that the stopp price is smaller 0. I do not understand why. My assumption ist, that "Position.AveragePrice" is 0 at the point of time it gets calculated internally. I do not know how to solve it.

      BUT: I changed my stopp mode to "currency". It works as expected. Also Mode = "ticks" works as expected. I will not use "Position.AveragePrice" for Stopp Loss calculation any more, as it is also simpler to use the tick mode.

      See images:

      Best Regards!
      Attached Files

      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
      20 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
      47 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X