I'm using DrawRegion() but the dataseries that I want to shade between depend on input parameters, and they are moving averages.
Is there a way that I could create a dataseries pointer, set it to point the EMA series that I need during intialization(), then use the pointer in DrawRegion()?
so something like this...
DataSeries MyDataseries1, MyDataSeries2;
Initialize() {
MyDataseries1 = EMA(21); // this doesnt compile
MyDataseries2 = WMA(12); // this doesnt compile
}
OnBarUpdate()
{
DrawRegion("tag"+CurrentBar.ToString(), 1, 0, MyDataSeries1, MyDataSeries2, colour, colour, opacity);
}
Thanks,
will.
Comment