View Full Version : Syntax question
T2020
02-17-2010, 06:42 PM
I've created moving averages of other things like :
Value.Set(SMA(OBV(), Period)[0]);
Which worked fine , but the snap shot doesn't .
It looks like it could use one more ..... ) ......
but that gives an error to .
It's just an experiment . thx .
NinjaTrader_Bertrand
02-18-2010, 05:27 AM
T2020, you would need to pass a dataseries to the SMA, not a double (no index after the Middle) -
SMA(Bollinger(1, 30).Middle, 20)
T2020
02-18-2010, 06:06 AM
T2020, you would need to pass a dataseries to the SMA, not a double (no index after the Middle) -
SMA(Bollinger(1, 30).Middle, 20)
So , just that one set of brackets basically . Not sure I'll ever make it as a
programmer . ;) Thank you .
NinjaTrader_Bertrand
02-18-2010, 06:19 AM
Yes, without choosing to retrieve an index value a dataseries is passed to the SMA - when you apply an index you retrieve a double value of the Middle dataseries...this generated the error you ran into, an SMA needs a history to calculate thus a dataseries is expected.