Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget not working as expected

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

    #16
    I've provided you the code. As you can see, should wait 10 bars before ever allowing a profit target. And, as you can see, this is not always the case, as illustrated below by all the targets on the same bar.

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	49.5 KB
ID:	851905

    Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	80.8 KB
ID:	851907


    Mike

    Comment


      #17
      Mike, thanks for posting the code. If you look at the very first entry you notice it will wait for 10 bars before the Set() method is submitted, so it works as expected. To make this work for the other entries, you would need to use unique signal names.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      52 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      142 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X