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 DavidHP, Today, 07:56 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by kujista, Today, 06:23 AM
    3 responses
    9 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by Mindset, Yesterday, 02:04 AM
    2 responses
    18 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Started by f.saeidi, Today, 08:03 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by samish18, 04-17-2024, 08:57 AM
    15 responses
    53 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X