Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

connected charts

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

    connected charts

    Hi,

    i am building a strategy on the 5 minue chart but i want it tolook at an indicator on the 20 minute chart, does anyone have advice on how best to do this?

    Thanks

    #2
    Hello,
    You can achieve this by adding in a secondary data series that is a 20 minute data series and then calculate your indicator within your strategy using BarsArray.
    I have provided an example of how you could do this below:

    Code:
    protected override void Initialize()
    {
    	Add(PeriodType.Minute, 5);
    
    }
    protected override void OnBarUpdate()
    {
    `			if(EMA(BarsArray[1], 20)[0] > Close[0])//Checks if the EMA of the 20 minute series is greater than the close of the primary series
    		//DoSomething
    }
    I would recommend reviewing the following sections of our help guide:

    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    7 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
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    12 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    13 views
    0 likes
    Last Post bltdavid  
    Working...
    X