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 Brevo, Today, 01:45 AM
              0 responses
              6 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by aussugardefender, Today, 01:07 AM
              0 responses
              3 views
              0 likes
              Last Post aussugardefender  
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              242 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              9 responses
              384 views
              1 like
              Last Post Gavini
              by Gavini
               
              Started by oviejo, Today, 12:28 AM
              0 responses
              6 views
              0 likes
              Last Post oviejo
              by oviejo
               
              Working...
              X