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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X