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

Multiple Time Frame and Bars Array

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

    Multiple Time Frame and Bars Array

    I am trying to trade from a MNQ chart using the price and indicator values from the NQ.
    MNQ is the primary series and NQ is the secondary series

    Question 1

    Will the code below reference the ADX indicator from the NQ and enter a trade on the MNQ?

    if ((BarsInProgress == 1)
    && (ADX1[0] < AdxValue))

    EnterLong(Convert.ToInt32(Contracts), Convert.ToString(EntryNameDtv));


    I was trying to use BarsArray under the primary series but was getting error messages compiling. I must not have defined the series properly.
    "ADX1 is a field but is used like a method"

    if ((BarsInProgress == 0)
    && (ADX1(BarsArray[1])[0] < AdxValue))

    I have reviewed the help guide on multiple time frames but I am missing something.

    I have been successful using an NQ chart as primary and entering the trades on the MNQ.
    But I would like to be able to see the indicators and manage the trade on one chart.
    Currently the indicators are on the NQ chart but if I want to manage the exit I have to do it on the MNQ chart.

    #2
    Hello sdauteil,

    Thank you for your post.

    You would have to specify the bars array to be used for the ADX when you assign the instance of it in State.DataLoaded for it to be calculated on the secondary NQ series:

    else if (State == State.DataLoaded)
    {
    ADX1 = ADX(BarsArray[1], myPeriod);

    }

    The issue would be that AddChartIndicator() will only work with indicators being plotted on the primary data series you have in your chart. So you could use the additional data series for the indicator for calculating your strategy logic, but you wouldn't be able to correctly add that to the chart from the strategy.

    You could add that data series within the hosted indicator, add that data series to the strategy as well, and have the indicator calculate on secondary data series and plot on primary.

    There's a note in our help guide regarding this:



    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 jaybedreamin, Today, 05:56 PM
    0 responses
    3 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Working...
    X