![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2007
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
Code:
if ((ATR(Period) >= Avalue) && (Range() <= Rvalue))
{
BarColor = Color.Yellow;
}
Operator '>=' cannot be applied to operands of type 'NinjaTrader.Indicator.ATR' and 'double' and Operator '<=' cannot be applied to operands of type 'NinjaTrader.Indicator.Range' and 'int' Period and Rvalue are integers, Avalue is a double. Thanks. |
|
|
|
|
|
#2 | |
|
Senior Member
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
|
You are trying to compare a the whole ATR array / data series... not just the last value.
Try ATR(Period)[0] Same for Range, or any other indicator used like this. Quote:
|
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2007
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
Perfect, although now I'm feeling pretty stupid!
Thanks! |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
|
No worries, we've all tripped over this one !
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can someone suggest what I'm doing wrong? | coolmoss | Indicator Development | 7 | 12-06-2007 04:23 PM |
| Forex trading - wrong reporting, wrong Close action, connecting | jcervinka | Miscellaneous Support | 2 | 08-30-2007 09:42 AM |
| [NT6 bug?] Compiles the wrong indicator | FireFly | General Programming | 2 | 04-28-2007 06:45 PM |
| PnL wrong display | PrTester | Automated Trading | 6 | 03-05-2007 10:24 AM |
| Wrong strategy executed | BradB | Automated Trading | 1 | 02-21-2007 02:41 AM |