![]() |
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 |
|
Junior Member
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
Dear support and forum members,
I was searching for an answer to my problem, but couldn't find one on the forum or internet. Hoping it will not sound to ridiculous to you, here is what I am trying to solve: I would like to construct an indicator that plots the difference between KAMA[0] and KAMA[n], n days ago; for simplicity I assume n=3. First I coded in OnBarUpdate(): Code:
Plot0.Set(KAMA(Close,2,10,30)[0]); Code:
Plot0.Set(KAMA(Close,2,10,30)[0]-KAMA(Close,2,10,30)[3]); Can somebody help me out with this? Thank you in advance, kindest regards, nescio |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,385
Thanks: 252
Thanked 967 times in 950 posts
|
Welcome to the support forums at NinjaTrader - please check this tip here -> http://www.ninjatrader-support2.com/...ead.php?t=3170 Most likely you run into this...
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for your really quick answer. I helped, but now my indicator looks weired as you can see in the screenshot. Any idea?
I changed the code to: Code:
if (CurrentBar < 3)
{
return;
}
if (Close[0] > Close[1])
{
Plot0.Set(KAMA(Close,2,10,30)[0]-KAMA(Close,2,10,30)[3]);
}
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
Found the problem myself. Used the wrong if clause from copy and pasting from the code you provided. Thank you for your quick support!
|
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,385
Thanks: 252
Thanked 967 times in 950 posts
|
You're welcome, great you got it resolved!
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| KAMA coding error? | higler | Indicator Development | 14 | 07-13-2009 02:57 PM |
| Converting KAMA to operate on other than close | BurtOD | Indicator Development | 2 | 02-26-2009 03:51 PM |
| Tip: How to make NinjaTrader’s ROC indicator to calculate the difference in points? | KamaCoder Eric | Indicator Development | 0 | 05-17-2008 09:03 AM |
| What is the difference between indicator and strategy? | clearpicks | Indicator Development | 1 | 04-21-2008 09:51 AM |
| Difference between strategy and indicator | JangoFolly | Automated Trading | 3 | 05-16-2007 09:47 AM |