![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2008
Location: Seattle, WA
Posts: 47
Thanks: 0
Thanked 1 time in 1 post
|
Easy one for ya, I know I've done this before, not working for me now though.
Making a new indicator, want this new indicator to also plot a few SMA's over the price data. I'm using: Add(SMA(PeriodTrendFast)); in the Initialize() area. Where PeriodTrendFast is a variable already listed in the Variables section. Keeps giving me 1729 1502 and 1503 errors for wrong overloads. Do I need something in the Properties area? Help? Thanks, S |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
Hi Steve, yes if you refer to the public property in your code you would need to add the corresponding parts in the properties section as well, you could see an example in the SampleMaCrossOver strategy.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
|
Quote:
It is probably more efficient to create an instance, then call that specific instance when needed. That way you bypass NinjaTrader cycling through all instances, looking for the correct one to call, on every OnBarUpdate(). (Part of the NT magic code automatically added as part of a wrapper). Just think if you had the calling indicator on more than one chart, and had CalculateOnBarClose = false. Eek, a few million calls on some /ES bars? |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| indicator to plot the 50 period sma of the 5 sma | brdnickel | NinjaScript File Sharing Discussion | 6 | 01-26-2011 01:03 PM |
| Sma | kaywai | General Programming | 16 | 01-26-2010 09:49 AM |
| Sma | rtj4201 | Charting | 1 | 04-11-2009 07:48 AM |
| Draw a x minute SMA/SMA/WMA on another timeframe? | ninjamouse | Indicator Development | 4 | 04-06-2009 06:54 AM |
| Cannot add return of SMA() | RandyT | Indicator Development | 1 | 09-25-2008 06:10 AM |