Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailStop question.

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

    SetTrailStop question.

    Hello,
    From this 3 line codes, how does the system manages to sell stop at 147.82, 148.21? and why didn't it sell at 148.21 at earlier bar? Please see attached. Thanks a lot.
    -Pumin

    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    SetTrailStop(CalculationMode.Ticks, 40);
    }

    protected override void OnBarUpdate()
    {
    EnterLong();
    }
    Attached Files

    #2
    Hello,

    I'm not sure I understand your question. Can you refer to one order and clarify? I don't see anything wrong with what you posted...
    DenNinjaTrader Customer Service

    Comment


      #3
      hi Ben,
      First order, the system buys at 147.845 and sells at 147.825. That's 0.02 difference. I set trailstop to 40, how does it calculate to get 0.02 ?

      Second order, it buys at 147.955, and sells at 148.21, how does it calcuate for 0.26 difference ? and why didn't it sell at the earlier bar at the same price point?

      3rd order, it buys at 148.505, and sells at 148.34, how does it calcuate for 0.165 difference ?

      -pumin

      Comment


        #4
        Hello,

        1 - notice that you are buying at the start of the bar and the bar pulled your trailer up a bunch, then back tracked on the next bar which it stopped out on.

        2- notice the big run up (the top wick on the bar just before the exit bar), that wick pulled up your trailer then the next bar retraced and stopped you out.

        3- the same reason as above, your trailer was pulled up then stopped out by a retracement.
        DenNinjaTrader Customer Service

        Comment


          #5
          May you explain by using real number calculation?

          Comment


            #6
            Hello,

            Yes, I'll do one to illustrate. So take the far lefthand buy at 148.84'5. (Note that you are displaying half pips --> '5)

            buy --> 148.84'5
            The high of your entry bar must about 147.82'5 + .40/.5 = 148.02'5
            Which brings your trailing stop up to 147.82'5.
            And the next bar wick shows the stop out.

            Maybe where you are getting confused is this: one tick is .5 of .01, or 1/2 a pip.
            DenNinjaTrader Customer Service

            Comment


              #7
              ok Ben, now I can see how it works, and thank you very much!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sofortune, 05-18-2024, 11:48 AM
              2 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by Zach55, 02-19-2024, 07:22 PM
              2 responses
              65 views
              0 likes
              Last Post lbadisa1  
              Started by JGriff5646, Yesterday, 05:47 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by AlphaOptions, 06-18-2013, 08:24 AM
              9 responses
              2,203 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by ttrader23, Yesterday, 09:33 AM
              3 responses
              29 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X