![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2008
Posts: 650
Thanks: 0
Thanked 0 times in 0 posts
|
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 .
Last edited by T2020; 02-17-2010 at 06:51 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,570
Thanks: 262
Thanked 1,018 times in 999 posts
|
T2020, you would need to pass a dataseries to the SMA, not a double (no index after the Middle) -
Code:
SMA(Bollinger(1, 30).Middle, 20)
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jun 2008
Posts: 650
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,570
Thanks: 262
Thanked 1,018 times in 999 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| formula / syntax question . | T2020 | General Programming | 9 | 12-17-2009 04:32 PM |
| Syntax Problems | skat100 | Automated Trading | 3 | 06-01-2009 08:27 AM |
| Problem of Syntax | germano | Strategy Development | 13 | 04-02-2009 10:55 AM |
| Syntax Problems | skat100 | Strategy Development | 77 | 12-16-2008 08:47 AM |
| Plotting Question - Syntax | tazatek | Indicator Development | 1 | 07-16-2008 06:25 PM |