![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
|
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
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2011
Posts: 182
Thanks: 16
Thanked 0 times in 0 posts
|
That did it. Thanks so much!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |