Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailStop Not Updating

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

    SetTrailStop Not Updating

    I am trying to get the trailing stop to update intrabar, however it is not updating at all, even on the close of a bar. Am I doing something wrong?

    Code:
            protected override void Initialize()
            {
                CalculateOnBarClose = false;
    	TraceOrders = true;
    			
    	SetTrailStop(stoppoints*Instrument.MasterInstrument.PointValue);
           }

    #2
    Please check your Control Center logs for errors. You likely cannot access PointValue from Initialize()
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Logs show no errors. Trace orders shows the stop amount going in at 250, which is correct and working. However once the order is placed it is never updated.

      Comment


        #4
        Please use a calculation mode instead of currency.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          The stop seems to be working now but is not submitting the order. It seems like it is working in a simulated mode even though the output window tells me simulated=false. Also, it is waiting for a bar to close to submit the order. Is this normal?
          Last edited by toptrader; 06-03-2009, 08:57 AM.

          Comment


            #6
            toptrader,

            How are you determining it is simulated? What CalculateOnBarClose setting are you using? Backtesting? Real-time? Either case, it should be sent in as the entry order gets filled provided you called the Set() before the entry order (which you have in Initialize).
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              toptrader,

              How are you determining it is simulated? What CalculateOnBarClose setting are you using? Backtesting? Real-time? Either case, it should be sent in as the entry order gets filled provided you called the Set() before the entry order (which you have in Initialize).
              Apparently it is not working at all now. I am running in real-time. CalculateOnBarClose=false.

              Comment


                #8
                Check your Control Center logs for errors. Also please provide the exact code you have.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  There are no errors in the logs and nothing strange in the traceorders log.

                  Code:
                  protected override void Initialize()
                          {
                              CalculateOnBarClose = false;
                  	TraceOrders = true;
                  				
                  	SetTrailStop(CalculationMode.Price,stoppoints);
                          }

                  Comment


                    #10
                    Please post the TraceOrders output from when you enter and when the stop is placed.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by toptrader View Post
                      There are no errors in the logs and nothing strange in the traceorders log.

                      Code:
                      protected override void Initialize()
                              {
                                  CalculateOnBarClose = false;
                          TraceOrders = true;
                       
                          SetTrailStop(CalculationMode.Price,stoppoints);
                              }
                      Try:

                      SetTrailStop(CalculationMode.Ticks, stoppointticks)

                      You just have to define stoppointticks instead points

                      Comment


                        #12
                        That works. Thank you

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        649 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        370 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        109 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        574 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        576 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X