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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X