Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible to use SetStopLoss() on BarsInProgress == 1 ?

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

    Possible to use SetStopLoss() on BarsInProgress == 1 ?

    Hello NT,

    I have a strategy whose BarsInProgress == 0 uses Last data and BarsInProgress == 1 uses Bid data.

    Is it possible for me to use SetStopLoss() on BarsInProgress == 1 instead of BarsInProgress == 0 ?

    The reason I ask is because I'd like the Stop Loss exits of my long trades to fill at the Bid price rather then the Last price.
    This goes for backtesting/optimizing in the Strategy Analyzer and Market Replay (and of course live trading).

    Thanks!

    #2
    This should be something you could test out with ease....

    Run 1 test run .....

    then Run another test run...assign a local variable with the BID on your OnMarketUpdate ... and your next BarsInProgress will see the latest...

    Comment


      #3
      Hi Sledge,

      I had done some initial tests before I started this thread and the results suggested it did not seem possible. However, I'm not sure if i just made a mistake somewhere in my code.

      I was previously told by Ninjatrader support that this is not possible to do with SetTrailStop() so I'm guessing it might not possible with SetStopLoss() either.

      Any thoughts on this NT support?

      Thanks.

      Comment


        #4
        Originally posted by Matheyas5 View Post
        Hi Sledge,

        I had done some initial tests before I started this thread and the results suggested it did not seem possible. However, I'm not sure if i just made a mistake somewhere in my code.

        I was previously told by Ninjatrader support that this is not possible to do with SetTrailStop() so I'm guessing it might not possible with SetStopLoss() either.

        Any thoughts on this NT support?

        Thanks.
        No can do. If you want to do that, you might want to consider using Exit...() orders instead.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        109 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        59 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        37 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        40 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        77 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X