Value[0] = High[0] - Low[0];
That would assign the high minus low for every bar as a plot. Now to do something for the past 50 bars you could use a indicator to work with that data. For example if you wanted to now average that you could use a custom indicator or an existing one like the SMA:
Code:
double averaged = SMA(Value, 50)[0];
that will return the average of a 50 period SMA using the High - Low data.
If the problem is conversion then can you try to be a little more specific about conversion from double to series? Should simply changing MyCandleSize_min_OR to MyCandleSize_min_OR[0] be enough? The code below is written in the OnBarUpdate() section of the script
double MyCandleSize_min_OR[0] = (High[0]-Low[0]);
double Average_Candle_min_OR = SMA(MyCandleSize_min_OR, 50)[0];
I tried this but end up with a compiling error that states "Bad array declarator" and "Array size cannot be specified in a variable declaration"
Is my issue in the way this is initialized and I need to create a private property to set up the Series <T> object? What is the difference between my code above and the example below?
protected override voidOnBarUpdate()
{
// Calculate the range of the current bar and set the value
myDoubleSeries[0]=(High[0]-Low[0]);
// Print the current 10 period SMA of range
Print("Value is "+SMA(myDoubleSeries,10)[0]);
Sorry for all the questions/confusion, I just have very limited seat time programming in C#
Comment