NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 03-16-2011, 12:21 PM   #1
CaptainAmericaXX
Senior Member
 
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
Default Rising & Falling ADX issue

Hello,
I'm trying to identify a previous bar that the ADX was Rising or Falling. My idea was this:
if (Rising(ADX(10)[1]) == true
&& Falling(ADX(10)[0]) == true),
but of course I'm getting an error that I can't "convert from 'double' to 'NinjaTrader.Data.IDataSeries'".
Might there be another way around this issue?
CaptainAmericaXX is offline  
Reply With Quote
Old 03-16-2011, 12:54 PM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thanks for the forum post.

Take the [0] and [1] off there and it should compile now.

When you add the [] this returns a double. If you leave them off this is a data series object.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 03-16-2011, 01:02 PM   #3
CaptainAmericaXX
Senior Member
 
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
Default

Thanks for the reply. Yes, that will compile, but will it do anything? I want check to see if the previous bar was rising and if the current bar is falling.
CaptainAmericaXX is offline  
Reply With Quote
Old 03-16-2011, 01:07 PM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

No this would not work for this as this works in realtime only.

Therefor If I was going to do this I would just program it manually.

Close[2] < Close[1] &&.//Rising of the last bar
Close[0] > Close [1 ] //Falling of the current bar
NinjaTrader_Brett is offline  
Reply With Quote
Old 03-16-2011, 01:13 PM   #5
CaptainAmericaXX
Senior Member
 
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
Default

Good suggestion, but with the ADX indy the Closes can be >or< than the previous without the ADX rising or falling. I need to identify the ADX rising or falling in each bar. I can easily color a bar to show that, but I can't use bar coloring in a strategy.
Last edited by CaptainAmericaXX; 03-16-2011 at 01:15 PM.
CaptainAmericaXX is offline  
Reply With Quote
Old 03-16-2011, 01:33 PM   #6
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
Default

Well of coarse you would want to substitute my example of close with your indicator of choice.

ADX(10)[2} < ADX(10)[1] etc. etc.
NinjaTrader_Brett is offline  
Reply With Quote
Old 03-16-2011, 02:41 PM   #7
CaptainAmericaXX
Senior Member
 
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
Default

That did it. Thanks so much!
CaptainAmericaXX 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
Rising/Falling Strategy Syrinxgroup Strategy Development 1 03-14-2011 05:20 AM
Hma rising and falling arrows djkiwi General Programming 41 01-10-2011 03:04 AM
Rising/Falling colors for MA... Art09 General Programming 5 10-27-2010 09:57 AM
Rising and falling eventrader Strategy Development 1 06-13-2010 07:13 PM
Falling(), Rising() on bars before symphys Strategy Development 4 05-15-2010 09:32 AM


All times are GMT -6. The time now is 10:44 PM.