![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
|
Thanks for the Slope(). Please explain this. My 2 studies are clearly pointing up for currentbar and previous bar. However, as you can see, my readout is showing a negative number. Why? (see attached)
My code: slowLine = Slope(CCI(14), 1, 0); fastLine = Slope(CCI(6), 1, 0); I tried Slope(CCI(14), CurrentBar-1, 0); But got some really funky output. A very large number. I just want the slope from previous bar to current bar. BTW, what is your formula for the calc'ing of Slope();?
Last edited by funk101; 05-19-2007 at 01:36 PM.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Forumula was incorrect. Here is what I am changing it to for the next update. Thanks for pointing this out. I had endBar - startBar, which is correct if the parameters passed in were absolute bar numbers which they are not. They reference the number of bars ago.
return (series[endBar] - series[startBar]) / (startBar - endBar);
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
|
Whew! I thought it was me. Glad I could be of service.
Thanks, let me know when the update is available.
|
|
|
|
|
|
#4 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Any idea when we'll have the updated slope() method available? I'm unable to edit the indicator because I can't see it.
|
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Likely end of this coming week.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Bump any date on the update?
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Slope of EMA | Creamers | Indicator Development | 2 | 04-13-2007 07:03 AM |
| Calculating slope & percentage... | funk101 | General Programming | 2 | 04-13-2007 03:01 AM |