I would like to use in a strategy some indicators, which will use current bars array and parent timeframe, for example:
** The strategy runs on M1 and I use:
1/ Parabolic M1
2/ MA 21 M1
3/ custom akSuperTrend indicator M5
so I need some from M1 and some from M5 (current time frame and higher)
I am trying to do smth like this:
protected override void Initialize()
{
initParabolic();
initZigZag();
initSuperTrend();
switch (BarsPeriod.Id)
{
case PeriodType.Minute:
Add(PeriodType.Minute, ParentTimeframe);
break;
}
}
.....
private void initParabolic()
{
double aFMax = 0.2;
double step = 0.02;
this.sar = akParabolicSar(aFMax, step);
Add(this.sar);
}
private void initZigZag()
{
double aFMax = 0.2;
double step = 0.02;
this.zigzag = akParabolicZigZag(aFMax, step);
Add(this.zigzag);
}
private void initSuperTrend()
{
int length = 14;
double multiplier = 2.618;
[B] this.superTrend = akSuperTrend([COLOR="Red"]BarsArray[1][/COLOR], length, multiplier, false);
[/B] Add(this.superTrend);
}
what should I do to ?

Comment