Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop Entry

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

    Trailing Stop Entry

    How could it be done:

    If entry criteria are generally met, I want to optimize the entry, similar to an trailing stop. Eg. the last close was in the near or above a Bollinger Band or a fast SMA crosses the slow ect, etc. Then I want to watch and follow the actual price movements just for further optimizations: If the actual price would go immedeately against me, I would accept to enter a position 2, 3 or 4 pips, ticks etc. worser price, but if the price goes in the right direction, I would get the Instrument for a better price. My codeing skills are basic but I guess, that a NJ Script has to induce a ATM-Strategy to do the "fine-works", after the Script has found the criteria to be true. Probably the System should also be FIFO optimized.

    #2
    Hello kupra,

    Just to be clear, you are wanting to optimize the conditions for an entry is this correct?

    If so, you need some kind of input that can be incrementally optimized over. (Something like a number of ticks from the bollinger band upper or lower value, or an amount of bars to wait after the condition is met, etc)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Correct. It's about optimizing an entry: If there is a "rought" entry signal (like two crossing SMA or a "close" is crossing a Bollinger Band etc) I'd like to place an "trailing entry", let's say 2 pips (ticks, points etc) under the current price for a short entry (long: visa versa).

      Please correct me if I'm worng: a trailing stop is an "easy" entry in an order book: "exit the position when the trailing stop is met". But in the case of an "trailing entry" you don't have anything in the orderbook.You need to watch the actual price and also to calculate the trailing mechanism. Something like:

      "If "actual price" > "buy price" + "trailingoffset"
      "buyprice = "actual price" - "trailingoffset"
      else If "actual price" = "buy price"
      buy
      Last edited by kupra; 07-23-2015, 09:51 AM.

      Comment


        #4
        Hello kupra,

        What are you trying to optimize?

        The number of pips from entry that the trailing stop will trail?

        The periods used for the bollinger / sma indicators?

        Are you sure you are trying to do an optimization?

        Or are you simply trying to add a trailing stop to an order?

        Is this a NinjaScript Strategy or an Atm Strategy?


        Below is a link to the help guide on running an Optimization on a NinjaScript Strategy.
        http://ninjatrader.com/support/helpG...a_strategy.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you for you instant answer. I want to optimize the number of pips from entry.
          I think optimizing the periods of in indicator is a matter of backtesting.

          I'm a beginner in NT coding. I guess, that a NinjaScript Strategy is ideal for the "rought" entry signal and the trailing mechanism is Atm level.

          Comment


            #6
            Hello kupra,

            Create a private int variable in the #region Variables.

            Create a public int variable in the #region Properies.

            Use either of these variables as the value for the SetTrailStop call.

            private int trailDistance;

            SetTrailStop(CalculationMode.Ticks, TrailDistance);

            [Description("Numbers of bars used for calculations")]
            [GridCategory("Parameters")]
            public int TrailDistance
            {
            get { return trailDistance; }
            set { trailDistance = Math.Max(1, value); }
            }

            Then you can optimize this distance in the optimization.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            77 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            45 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            27 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            64 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X