Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceEntry

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

    BarsSinceEntry

    I have multiple entries under BarsSinceEntry... they all seem to work, however I can't get Trailing Stop to work under BarsSinceEntry. By itself it works fine but the following code I can't get. Is this not possible?


    if (BarsSinceEntry() >= 20)
    {
    SetTrailStop("", CalculationMode.Ticks, 12, false);
    }

    #2
    Hello shawnkm,

    That code is valid code and would trigger the stop loss to set at 12 ticks from the entry point once the entry fills. The stop would then trail tick for tick as the price moved in a favorable direction.

    One thing to keep in mind, is that once set, a stop loss cannot be unset. This means if one order is placed and a stop loss / trail stop is used, any new order will automatically have that stop loss applied if the signal name / from entry signal pairing is not unique.

    What is the behavior you are expecting?

    What is the behavior you are experiencing?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ChelseaB,

      Thank you for the reply. I just want to say that I think NinjaTrader and its support staff is just wonderful.... So thank you.

      Basically, it is ignoring the 20 bar waiting period. I have another entry right below the stoploss entry and it works perfectly. Its a moving average, and it waits 20 bars, then exits if it falls below the moving average.

      This stoploss will not wait the 20 bars.

      Comment


        #4
        Hello shawnkm,

        Each time you place an order, if you want the stop loss to not be applied automatically, you will need to make each new order's signal name unique (use a counter integer that increments each time you make an order). The SetTrailStop will need to use that signal name as its from entry signal.

        This will prevent the new order from automatically having the stop loss applied.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        3 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        9 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X