Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailingStop issue

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

    SetTrailingStop issue

    Hello!

    I use Strategy Wizard to develop simple strategy for a first time.

    At the first stage I want to achive the following result:
    1. Build a condition to enter short position
    2. Set trailing stop

    But I struggled with the following issues:
    1. The instrument I use for backtesting has tick size 5. I want to use the fixed stop equal 1000 points in price. So I use SetTrailStop with mode = CalculationMode.Ticks and value = 200(200*5 = 1000). Am I right?
    2. On the image I attached one of the setups is shown. The condition is triggered at green bar before purple pointer. I want to do the following:
    a. Enter at the close of this green bar
    b. Understand why trailing stop is triggered

    Can anyone help me please?
    Attached Files

    #2
    Hello aks19,

    Thank you for your post.

    Can you please provide the code you are using for the order entry and SetTrailStop().

    To enter at the Close of the green bar you would need to use Intrabar granularity to see the intrabar data for the code to use, calculate and place orders to that lower timeframe

    http://www.ninjatrader.com/support/f...ead.php?t=6652
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Hello aks19,
      Can you please provide the code you are using for the order entry and SetTrailStop().
      Generated by Strategy Wizard:
      protected override void Initialize()
      {
      SetTrailStop("RSI Short", CalculationMode.Ticks, 200, false);

      CalculateOnBarClose = true;
      }

      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()
      {
      // Condition set 1
      if (RSI(High, 14, 1)[0] >= 70)
      {
      EnterShortLimit(1, Close[0], "RSI Short");
      }
      }

      Comment


        #4
        Hello aks19,

        Thank you for your response.

        This should not be occurring. Please advise what instrument, bar type and interval you are testing this on (example: ES 03-15, Minute, 1).

        In addition, do you receive any messages in the Log when this occurs?

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello aks19,

          Thank you for your response.

          This should not be occurring. Please advise what instrument, bar type and interval you are testing this on (example: ES 03-15, Minute, 1).

          In addition, do you receive any messages in the Log when this occurs?
          Hello!

          I uploaded historical data of russian Index RTS future in 1 min bars format, tick size 5. I do the testing using 2h(120min) timeframe.

          What the Log do you mean? I don't receive any explicit warning/error messages.

          Comment


            #6
            aks19, it looks to me like the 200 tick stoploss is simply to small for your setup and would immediately trigger. Can you perhaps show us a screenshot how the instrument is exactly configured?

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              aks19, it looks to me like the 200 tick stoploss is simply to small for your setup and would immediately trigger. Can you perhaps show us a screenshot how the instrument is exactly configured?
              I have attached the screenshot with settings.
              Attached Files

              Comment


                #8
                Hello aks19,

                Thank you for your response.

                This could be due to the set up of the instrument. I could not locate information on the Point Value or Tick Size. I see that the Contract Size is 1 but what is the value? Can you send a link to this information as I could not locate it on the moex webpage: http://moex.com/en/contract.aspx?code=RTS-12.14

                Comment


                  #9
                  Originally posted by NinjaTrader_PatrickH View Post
                  Hello aks19,

                  Thank you for your response.

                  This could be due to the set up of the instrument. I could not locate information on the Point Value or Tick Size. I see that the Contract Size is 1 but what is the value? Can you send a link to this information as I could not locate it on the moex webpage: http://moex.com/en/contract.aspx?code=RTS-12.14
                  Hello!

                  RTS-12.14 is last expired contract. The current contract is RTS-3.15: http://moex.com/en/contract.aspx?code=RTS-3.15
                  Tick size now is 10 but earlier it was 5.

                  Comment


                    #10
                    Hello aks19,

                    Thank you for your response.

                    What technology provider are you connecting to in NinjaTrader for the RTS Futures data from Moex? If you are not connecting, did you import historical data? If so, may I review the file you imported?

                    Comment


                      #11
                      Originally posted by NinjaTrader_PatrickH View Post
                      Hello aks19,

                      Thank you for your response.

                      What technology provider are you connecting to in NinjaTrader for the RTS Futures data from Moex? If you are not connecting, did you import historical data? If so, may I review the file you imported?
                      I imported historical data. The file is about 78 Mb, so I uploaded it here: http://www.filedropper.com/cfrtslast (Hope it was successfull)

                      Comment


                        #12
                        Aks19,

                        Is this a Stock or Future that you are wanting to import the historical data?

                        The link that you provided was for a future contract.
                        Cal H.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Cal View Post
                          Aks19,

                          Is this a Stock or Future that you are wanting to import the historical data?

                          The link that you provided was for a future contract.
                          It is future contract.

                          Comment


                            #14
                            Aks19,

                            Thank you for the clarification.

                            You would then need to ensure that you have this setup as a Future instrument when creating it.

                            Additionally you will need to create the contracts for the Future from the Misc Tab on the very bottom of the Tab. This is where you will define contracts.

                            Once that is set you would need to split the file up for each individual contract that you have. So if the text file has 3 contract periods in it, you would need three separate text files, one for each contract.

                            You then need to label them appropriately, which can be found on the following link below -
                            http://www.ninjatrader.com/support/h...?importing.htm
                            Cal H.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Cal View Post
                              Aks19,

                              Thank you for the clarification.

                              You would then need to ensure that you have this setup as a Future instrument when creating it.

                              Additionally you will need to create the contracts for the Future from the Misc Tab on the very bottom of the Tab. This is where you will define contracts.

                              Once that is set you would need to split the file up for each individual contract that you have. So if the text file has 3 contract periods in it, you would need three separate text files, one for each contract.

                              You then need to label them appropriately, which can be found on the following link below -
                              http://www.ninjatrader.com/support/h...?importing.htm
                              Ok.
                              Thank you all!

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              637 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              366 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              107 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              569 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              571 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X