Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Closes with Indicator Trailing Stop

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

    Closes with Indicator Trailing Stop

    I have a strategy running on a NQ 12-20 chart that is executing trades on a secondary instrument MNQ 12-20

    AddDataSeries("MNQ 12-20", Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Last);


    I want to create an exit if the primary instrument NQ 12-20 trades below the ATR trailing stop.


    if (BarsInProgress == 1)
    && Closes[0][0] <= AtrTrailingOnClose1.Upper[1])
    && Position.MarketPosition == MarketPosition.Long)

    Will this reference the AtrTrailingOnClose1 from the primary chart?


    I wasn't sure and tried... AtrTrailingOnClose1.Upper[0][1] this caused errors when compiling.



    #2
    Hello sdauteuil,

    Thank you for your note.

    How is your AtrTrailingOnClose1 series set up in State.DataLoaded? If you didn't specify a different series for it to be calculated on, this would calculate on the primary bars series. I'd suggest taking a look at this section of our help guide for a detailed example:



    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X