Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing stop

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

    #16
    Sure, Bill.

    1) Paste the code into a new reply.
    2) Highlight all NS code by clicking and dragging.
    3) Click the # (code) button on the forum toolbar.

    That wil enclose all the selected text into the code block.
    Ryan M.NinjaTrader Customer Service

    Comment


      #17
      Hi Ryan. It had been a while since posting on this thread, so by the time I had an attempted code written, I ended up posting it here: http://www.ninjatrader.com/support/f...ad.php?t=32643
      "Attempt at trailing stop".

      In short, I have been frustrating Bertrand on my new thread with my novice attempt at writing this thing. I remembered we had this discussion, so I thought you might have a chance to take a look since it is really a continuation of this discussion.

      Thanks.

      Comment


        #18
        did you guys actually come to a solution on the intrabar stoploss triggering ?
        When I read this thread, I still get the impression Bill's question is not answered properly...;

        please consider this scenario:
        - I run a strategy - with COBC = true - on a regular 5 min chart..
        - In the Initialize section of the strategy code I set a trailing stop of 10 Ticks, with simulated = true.

        When running this strategy in Sim or Live, the stoploss is triggered whenever the price hits -10 ticks, so on a tick-by-tick basis.
        What I would like to have, is that the stoploss is ONLY triggered at the Close of a bar, and NOT intrabar. So if price goes to -20 ticks intrabar do nothing, but if price still is < -10 ticks at the Close of this bar then trigger stoploss.

        Is this possible from within the strategy builder ?

        Or can this only be done by adding code that compares price to a certain threshold level ( = Price - TrailingStopp ticks amount) at the Close of a bar, and then sending an ExitLong() / ExitShort() ?

        Marco

        Comment


          #19
          Originally posted by billr View Post
          Ryan,
          At the risk of over-explaining, your comment about setting the stop also helps insofar as I don't want to set a stop at the threshold point. I want to trigger an Exit Position if said threshold is met at Close[0].
          To do that you will have to manually code it, adjusting the TrailStop to be zero ticks away on the bar close that exceeds the target number of ticks.

          Comment


            #20
            Marco, as koganam has mentioned, you will need to do this with custom code.
            AustinNinjaTrader Customer Service

            Comment


              #21
              Sorry, I did reply in wrong thread. Isn´t there a possbility to delete? When editing I have to fill in at least 10 characters and I can´t delete the reply.
              Last edited by tonynt; 07-30-2011, 09:21 AM.

              Comment


                #22
                Tony, when you click on the edit post button, the top section is where the deleting can take place.
                Attached Files
                AustinNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

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