Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss()

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

    SetStopLoss()

    Hello,

    I am using currently using SetStopLoss() which I have declared in initialization to protect my trades.
    However, I would also want to change variables during the StopLoss execution.

    eg: change variable State = 1 from State = 0;

    Is this possible?

    #2
    Hello,

    Thanks for the note.

    This is possible to change the stop loss dynamically. To do this please use this sample.



    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Thanks for the help, the method you provided changes the SetStopLoss parameters, I am actually wanting to change variables that is outside the SetStopLoss function's scope while the stopLoss is executed. Is that workable?
      Last edited by Lhiva; 06-09-2011, 08:29 AM.

      Comment


        #4
        Hello,

        Sorry not sure I follow.

        Are you wanting to move the stop loss up or down by changing the stop loss variable after entry into the trade?

        I look forward to assisting you further.
        BrettNinjaTrader Product Management

        Comment


          #5
          I am using several variables that act as "switches" or "states" for my backtesting conditions to give my strategy more variations.

          Such variables change when my position changes(eg: covered, stopped, scratched)
          However when SetStopLoss is executed, I cannot change such variables as i cant find a way to access the stoploss function.

          hope this explains better

          Comment


            #6
            Hello,

            In this case you need to monitor the stop loss if you need it for this purpose. Use this sample.



            This will give you a way to track the stop loss order.

            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            61 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            32 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            44 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            58 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            47 views
            0 likes
            Last Post CarlTrading  
            Working...
            X