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