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 01-14-2009, 07:25 AM   #1
pdmoney
Junior Member
 
Join Date: Jan 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default Heiken-Ashi - Alert Development Question

I havent found it anywhere on here or been able to figure out how to do this but can an alert be generated when a Heiken-Ashi bar changes from red to green and vice versa?
pdmoney is offline  
Reply With Quote
Old 01-14-2009, 07:29 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

The Heiken Ashi indicator is a visualization indicator only and cannot be programmatically accessed for values. Because of this reason you cannot create alerts for it.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 07:41 AM   #3
pdmoney
Junior Member
 
Join Date: Jan 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default I'm NOT a Programmer

but isnt there somewhere in the code that says if then=green or something? How do the colors change? Just wondering...
pdmoney is offline  
Reply With Quote
Old 01-14-2009, 07:46 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

You cannot programmatically access the values of the HA indicator. You can feel free to muck around in it and modify its code all you want, but you cannot access the values from another script currently.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 01:14 PM   #5
pdmoney
Junior Member
 
Join Date: Jan 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default They ahve to be SOMEHWRE NO?

Like I said...I wouldnt know the first thing about playing around with the code..However, I was looking at calculations of the Heiken bars:

Heikin-Ashi candles are different and each candle is calculated and plotted using some information from the previous candle:
1- Close price: the close price in a Heikin-Ashi candle is the average of open, close, high and low price.
2- Open price: the open price in a Heikin-Ashi candle is the average of the open and close of the previous candle.
3- High price: the high price in a Heikin-Ashi candle is chosen from one of the high, open and close price of which has the highest value.
4- Low price: the high price in a Heikin-Ashi candle is chosen from one of the high, open and close price of which has the lowest value.

So clearly they are calculated in the code somehow. I am not trying to be a pain in the ass but can you explain in laymens terms why the code cannot be accessed? How does it know when to turn the bars red or green?
pdmoney is offline  
Reply With Quote
Old 01-14-2009, 01:19 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

pdmoney,

Yes, it is coded in there. The indicator is visualization only. There is no layman's term for why it can't be accessed. It is for various programming reasons. If you want more from it you need to do it yourself. If you do not want to do it yourself you can try one of the 3rd party NinjaScript Consultants here: http://www.ninjatrader.com/webnew/pa...injaScript.htm

I cannot provide you any further assistance on this. If you want to know when bars turn red or green I suggest you google Heikin-Ashi in general. You should be able to find several articles discussing its philosophy. We are not trade educators and as such cannot answer that question for you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 01:56 PM   #7
brain77
Junior Member
 
Join Date: Dec 2008
Posts: 8
Thanks: 0
Thanked 0 times in 0 posts
Default

hi,
try this one Mod Heiken Ashi from the downloadarea.
it is done in another way of coding - without that paintstuff - alerts should be possible with this i think.
hope that helps !
brain77 is offline  
Reply With Quote
Old 01-14-2009, 02:05 PM   #8
pdmoney
Junior Member
 
Join Date: Jan 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default Thanks..Leads to another question

Sorry if this is all newbie stuff, but how would I use that as an alert?
I am new to NT and working my way through this stuff...any help would be appreciated..
pdmoney is offline  
Reply With Quote
Old 01-14-2009, 02:06 PM   #9
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

http://www.ninjatrader-support.com/H...lertConditions
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 02:15 PM   #10
angelohr
Junior Member
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default open-close price

Hi Josh
Is there any way to set up price open/close on heikinachi indicator and in the mean time to keep colors on the bar the way it is?




Quote:
Originally Posted by NinjaTrader_Josh View Post
angelohr is offline  
Reply With Quote
Old 01-14-2009, 02:29 PM   #11
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

angelohr,

I'm not sure what you mean. Can you please elaborate a little bit more? Thanks.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 02:34 PM   #12
roonius
Certified NinjaScript Consultant
 
Join Date: Oct 2008
Location: Chicago, IL
Posts: 523
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to roonius
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
You cannot programmatically access the values of the HA indicator. You can feel free to muck around in it and modify its code all you want, but you cannot access the values from another script currently.
Josh,

May be I am missing something there, but according to my knowledge you can access the values of the HA indicator.
All these values are plots, just they are "transparent"...

roonius
roonius is offline  
Reply With Quote
Old 01-14-2009, 02:42 PM   #13
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

roonius,

When you try it you will get this error message: "Error on calling the 'OnBarUpdate' method for indicator 'hatest' on bar 0: The indicator 'HeikenAshi' is intended for visualization and can only be used on a chart".

If you guys want to access the values you need to mod the indicator.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 04:44 PM   #14
roonius
Certified NinjaScript Consultant
 
Join Date: Oct 2008
Location: Chicago, IL
Posts: 523
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to roonius
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
roonius,

When you try it you will get this error message: "Error on calling the 'OnBarUpdate' method for indicator 'hatest' on bar 0: The indicator 'HeikenAshi' is intended for visualization and can only be used on a chart".

If you guys want to access the values you need to mod the indicator.
Josh,

Sorry, you are absolutely right... Overlooked "ChartOnly"...
roonius is offline  
Reply With Quote
Old 01-14-2009, 07:33 PM   #15
roonius
Certified NinjaScript Consultant
 
Join Date: Oct 2008
Location: Chicago, IL
Posts: 523
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to roonius
Default

I see people are looking for this for a long time, so I took a quick shot and
modified existin HeikinAshi. You can access values from strategies or other indicators, plus I used override Plot method to draw it, so it's less resource hungry...
Attached Files
File Type: zip RHeikenAshi.zip (2.8 KB, 204 views)
Last edited by roonius; 01-14-2009 at 09:05 PM.
roonius 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
The best Heiken Ashi implementation I have seen!!! Elliott Wave NinjaScript File Sharing Discussion 91 05-31-2012 06:40 AM
Making Heiken/Ashi candles to take less system resources RK_trader Miscellaneous Support 25 08-27-2009 12:32 PM
Bug: Ninja Trader very slow using Heiken Ashi Currywurst Charting 6 07-20-2008 04:41 AM
Heiken ashi Indicator needed nqtraderman NinjaScript File Sharing Discussion 1 07-07-2008 08:20 AM
Heiken Ashi arilano Strategy Development 14 06-23-2008 12:18 PM


All times are GMT -6. The time now is 01:55 AM.