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 terofs, Yesterday, 04:18 PM
    1 response
    21 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by CommonWhale, Today, 09:55 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by Gerik, Today, 09:40 AM
    2 responses
    7 views
    0 likes
    Last Post Gerik
    by Gerik
     
    Started by RookieTrader, Today, 09:37 AM
    2 responses
    13 views
    0 likes
    Last Post RookieTrader  
    Started by alifarahani, Today, 09:40 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X