Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Difference between SetStopLoss and SetTrailStop

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

    Difference between SetStopLoss and SetTrailStop

    Hello everyone, I'm a new Ninjatrader user and I have difficult to understand the difference between SetStopLoss and SetTrailStop methods. Can someone explains me with an example or giving a documentation link?
    I'm already looking for in this forum and on google but I didn't find nothing about this.

    Thank you
    Enrico

    #2
    If you open up the help guide and type the below information, I believe you will get what your looking for in terms of explaining how they work.

    SetStopLoss()
    SetTrailStop()

    Comment


      #3
      Thank you for your response. I've already read user guide. It explains the syntax but not how it works.

      Thank you
      Enrico

      Comment


        #4
        Ok. The simple explanation on how they work is as follows:

        SetStopLoss()
        If you set a stop loss of 30 ticks from entry price, then when your entered into a trade, you will see a stop placed on the chart 30 ticks from entry if you open up a chart and click on chart trader or code into your strategy to see.


        SetTrailStop()
        Assuming you use a 1 tick trailing stop from entry 10 ticks behind the entry price, the trailing stop will move up 1 tick for every 1 tick in profit the instrument moves. If you choose calculateonbarclose to false, the trailing stop will move in real time, which you can see if you display on the chart.

        Hope this helps.

        Comment


          #5
          Hello ealterani

          Thanks for your post and welcome to the Forums!

          gretzkyless has provide a good explanation of how they work.

          Please let us know if you need further information.

          Comment


            #6
            Originally posted by gretzkyless View Post
            Ok. The simple explanation on how they work is as follows:

            SetStopLoss()
            If you set a stop loss of 30 ticks from entry price, then when your entered into a trade, you will see a stop placed on the chart 30 ticks from entry if you open up a chart and click on chart trader or code into your strategy to see.


            SetTrailStop()
            Assuming you use a 1 tick trailing stop from entry 10 ticks behind the entry price, the trailing stop will move up 1 tick for every 1 tick in profit the instrument moves. If you choose calculateonbarclose to false, the trailing stop will move in real time, which you can see if you display on the chart.

            Hope this helps.
            I notice that gretzkyless in his very helpful post, said:

            If you choose calculateonbarclose to false, the trailing stop will move in real time
            I thought that even if CoBC=true, then the trailing stop moved in realtime, i.e. tick by tick.

            Can someone please clarify this?

            Thanks in advance.

            Comment


              #7
              Hello arbuthnot,

              Thank you for your post.

              gretzkyless is correct, the trail stop would not move tick by tick unless using CalculateOnBarClose = False.

              Comment


                #8
                Thanks very much, Patrick. That's something I had clearly misunderstood.

                Given I'd got that wrong, could you kindly confirm the situation with a strategy like SampleAtmStrategy which is automatically entering ATM-based trades.

                Even if CalculateOnBarClose = True, do the ATM auto-trailing stops nevertheless operate on a tick-by-tick basis?

                Many thanks in advance for the clarification.
                Last edited by arbuthnot; 03-16-2015, 02:59 AM.

                Comment


                  #9
                  Hello,

                  This is to confirm that ATM strategies run tick by tick regardless of a strategy that calls them being set to CalculateOnBarClose=true.

                  This is to confirm that Ninjascript strategies using SetTrailStop, will execute according to the setting of CalculateOnBarClose. True means will move at bar close, false will move per tick.

                  Comment


                    #10
                    Much obliged to you, Paul, for clarifying this.

                    This is obviously a huge advantage of using strategies which launch ATM-based trades (such as SampleAtmStrategy) despite their complexity.

                    Comment

                    Latest Posts

                    Collapse

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