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 CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,265 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X