I can't seem to find a way to the get the Median of a different time frame in a strategy. I know there is a way :P Can someone please point me in the right direction. Variable0 works by itself, its the Median of the other 2 time frames that I want to add.
protected override void Initialize()
{
Add(PeriodType.Minute, 60); // ON CHART
Add(PeriodType.Minute, 20); // ON CHART
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
Variable0 = SMA(Median, 200)[0];
Variable1 = SMA(BarsArray[1].Median, 200)[0];
Variable2 = SMA(BarsArray[2].Median, 200)[0];
}
Comment