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 GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,229 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        441 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        12 views
        0 likes
        Last Post FAQtrader  
        Working...
        X