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 07-17-2008, 02:27 AM   #1
fragalles
Member
 
Join Date: Aug 2007
Posts: 38
Thanks: 0
Thanked 0 times in 0 posts
Default if x && x not allowed in indicators?

Hello

i wanted to make a BarColor change when the Momentum goes down,
it works but only if i have one condition, the second i add another conditions for example a Low [0] <= Low [1]
the bar colors dont get changed:

protected override void OnBarUpdate()
{
Value.Set(CurrentBar == 0 ? 0 : Input[0] - Input[Math.Min(CurrentBar, Period)]);



if (Value[0] >= 0
&& Low [0] <= Low [1]
&& Value[1] >= Value[0]
)
{
BarColor = Color.Red;
}

What i am making wrong here, or is it only possible in strategies to have a && command in the if section?
fragalles is offline  
Reply With Quote
Old 07-17-2008, 02:38 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Please see here: http://www.ninjatrader-support.com/v...ead.php?t=3170
NinjaTrader_Dierk 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
TRO Indicators NinjaTrader_Josh NinjaScript File Sharing Discussion 148 09-07-2012 11:24 AM
Placing more than 1 stop orders, not allowed? pipal SuperDOM and other Order Entry Windows 4 05-16-2008 12:14 PM
Charting indicators using other indicators as the input Elliott Wave Charting 3 04-04-2008 03:54 PM
Maximum frequency of order modification allowed? MarkSanDiego Automated Trading 1 02-27-2008 02:15 PM
Indicators michaeldavidmiller@comcas ATM Strategies (Discretionary Trading) 1 01-13-2008 01:52 AM


All times are GMT -6. The time now is 03:19 PM.