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 04-09-2008, 08:07 AM   #1
kian1
Junior Member
 
Join Date: Jan 2008
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
Default bar and HeikenAshi

// Condition set 1
if (High[0] > High[1] + 5 * TickSize)
{
EnterLong(DefaultQuantity,
"long HA");

it will not compile the above conditions any reason

or how can write if HeikenAshi turns red which is down bar go short
and turns green which is up go long
Thanks
kian1 is offline  
Reply With Quote
Old 04-09-2008, 08:12 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

You are missing a curly brace at the end. Should be:

// Condition set 1
if (High[0] > High[1] + 5
* TickSize)
{
EnterLong(DefaultQuantity,
"long HA");

}
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-06-2011, 10:58 PM   #3
luxurious_04
Senior Member
 
Join Date: Jul 2010
Location: Philippines
Posts: 248
Thanks: 7
Thanked 6 times in 4 posts
Send a message via Skype™ to luxurious_04
Default

Hello, anyone have found a way to know if HeikenAshi bar is red or green? Please share it. Thanks in advance.
luxurious_04 is offline  
Reply With Quote
Old 06-06-2011, 11:04 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,858
Thanks: 162
Thanked 579 times in 570 posts
Default

Hello luxurious_04,

Thank you for your post.

You would need to replicate the conditions from the HeikenAshi indicator source code for when this condition is true.

You can view the source code for this indicator by going to Tools--> Edit NinjaScript--> HeikenAshi.

From there, you should be able to find the conditions that are met when a bar is red or green.
NinjaTrader_Matthew 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
Heikenashi nelson Charting 6 08-03-2007 12:59 PM


All times are GMT -6. The time now is 08:26 AM.