NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-19-2007, 02:54 AM   #1
funk101
Senior Member
 
Join Date: Jan 2006
Location: Margate, Florida, USA
Posts: 426
Thanks: 0
Thanked 2 times in 2 posts
Send a message via AIM to funk101
Default Slope()...

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();?
Attached Images
File Type: jpg slope.jpg (40.8 KB, 95 views)
Last edited by funk101; 05-19-2007 at 01:36 PM.
funk101 is offline  
Reply With Quote
Old 05-19-2007, 04:51 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

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);
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-19-2007, 05:11 PM   #3
funk101
Senior Member
 
Join Date: Jan 2006
Location: Margate, Florida, USA
Posts: 426
Thanks: 0
Thanked 2 times in 2 posts
Send a message via AIM to funk101
Default Ah!

Whew! I thought it was me. Glad I could be of service. Thanks, let me know when the update is available.
funk101 is offline  
Reply With Quote
Old 05-26-2007, 05:40 PM   #4
AO76
Member
 
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
Default

Any idea when we'll have the updated slope() method available? I'm unable to edit the indicator because I can't see it.
AO76 is offline  
Reply With Quote
Old 05-26-2007, 06:01 PM   #5
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Likely end of this coming week.
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-16-2007, 09:39 AM   #6
AO76
Member
 
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
Default

Bump any date on the update?
AO76 is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 09:36 PM.