![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Sep 2008
Posts: 75
Thanks: 0
Thanked 0 times in 0 posts
|
Nasty looking code alert... just trying to port some TS code
I get a compile error when trying to compile this code. "Operator '+' cannot be applied to operands of type 'NinjaTrader.Indicator.SMA and 'NinjaTrader.Indicator.SMA" which would be adding two doubles. What am I missing... ST1 = 100 *(Close - (( SMA(Close,Len1) + SMA(SMA(Close,Len1),Len1) + SMA(SMA(SMA(Close,Len1),Len1),Len1) + SMA(SMA(SMA(SMA(Close,Len1),Len1),Len1),Len1) + SMA(SMA(SMA(SMA(SMA(Close,Len1),Len1),Len1),Len1), Len1) + SMA(SMA(SMA(SMA(SMA(SMA(Close,Len1),Len1),Len1),Le n1),Len1),Len1) + SMA(SMA(SMA(SMA(SMA(SMA(SMA(Close,Len1),Len1),Len1 ),Len1),Len1),Len1),Len1) + SMA(SMA(SMA(SMA(SMA(SMA(SMA(SMA(Close,Len1),Len1), Len1),Len1),Len1),Len1),Len1),Len1) + SMA(SMA(SMA(SMA(SMA(SMA(SMA(SMA(SMA(Close,Len1),Le n1),Len1),Len1),Len1),Len1),Len1),Len1),Len1) + SMA(SMA(SMA(SMA(SMA(SMA(SMA(SMA(SMA(SMA(Close,Len1 ),Len1),Len1),Len1),Len1),Len1),Len1),Len1),Len1), Len1)) / 10)) / (High(Close, Len2) - Low(Close, Len2)); |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
Try including an index after each SMA(). For example the first one may look like this: SMA(Close, Len1)[0] + etc... The next one may look like this: SMA(SMA(Close,Len1),Len1)[0] + etc... This link may help: http://www.ninjatrader-support.com/H...verageSMA.html
Ben
NinjaTrader Customer Service
Last edited by NinjaTrader_Ben; 09-25-2008 at 06:13 AM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Market analyzer and chart return different values | nicko9 | Market Analyzer | 5 | 08-04-2010 05:26 AM |
| How to return the Position Entry Price?? | Ninja in Training | Strategy Development | 3 | 08-05-2008 10:06 AM |
| Standard Return Code for Functions | arbifox | Automated Trading | 1 | 12-13-2007 08:21 PM |
| Positions[0].Quantity return negative value when short? | Folls | Strategy Development | 2 | 10-23-2007 01:13 PM |
| Return values for NTOrderStatus() | ccooper | Automated Trading | 2 | 11-11-2006 11:47 AM |