Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,227 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    440 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    11 views
    0 likes
    Last Post FAQtrader  
    Working...
    X