Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget() and SetStopLoss() submitted only once on the first trade

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

    SetProfitTarget() and SetStopLoss() submitted only once on the first trade

    Hello

    For some reason SetProfitTarget() and SetStopLoss() get submitted only once on the first trade when I'm testing my script with market replay. When I have them written down in the "State == State.Configur" they should be submitted after every entry order gets filled, right?

    I'm printing out in the OnOrderUpdate each time when entry order gets filled and SL with TP gets submitted. On the first trade all 3 get printed out. On the second trade only entry filled gets printed but no SL or TP submitted. I added pics as well from code and from output, the relevant part is marked with red lines.

    Thank You!

    #2
    Sry, already found my problem. I wasn't using the fromEntrySignal the right way.
    Last edited by KarlEST; 01-31-2022, 11:43 AM.

    Comment


      #3
      Hello KarlEST,

      Thank you for your posts.

      For future reference, posts regarding Strategy programming should be posted in our Strategy Development forum for the appropriate NinjaTrader version. I've moved this post appropriately. Glad to hear you were able to find the issue!

      Please let us know if we may be of further assistance to you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X