NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

Reply
 
Thread Tools Display Modes
Old 09-24-2009, 08:26 PM   #61
crmcwi
Senior Member
 
Join Date: Jul 2009
Posts: 132
Thanks: 0
Thanked 0 times in 0 posts
Question Can HeikenAshiSmoothed be used in a strategy?

Guys,

I'm trying to use HASmoothed in a strategy, but I keep getting errors in my log. Has anyone encountered problems and have you found a solution?

Here's what I get:

I'm having trouble using this indicator in a strategy. The log shows the following entry:

Error on calling the 'OnBarUpdate' method for indicator 'HeikenAshiSmoothed' on bar 1: Object reference not set to an instance of an object.

My code is simple enough:
protected override void OnBarUpdate()
{

HA_Open1 = HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAOpen[1];
HA_Open0 = HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAOpen[0];
HA_Close1 = HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAClose[1];
HA_Close0 = HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAClose[0];



if (HA_Open1 > HA_Close1 && HA_Open0 > HA_Close0)
{
ExitLong("ExitLongHeiken", "LongOnHeikenReverse");
EnterShortLimit(DefaultQuantity, GetCurrentAsk(), "ShortOnHeikinReverse");

}

// Condition set 2
if (HA_Open1 > HA_Close1 && HA_Open0 > HA_Close0)
{
ExitShort("ExitShortHeiken", "ShortOnHeikenReverse");
EnterLongLimit(DefaultQuantity, GetCurrentBid(), "LongOnHeikenReverse");
}
}
Last edited by crmcwi; 09-24-2009 at 08:28 PM. Reason: needed to copy code from another post.
crmcwi is offline  
Reply With Quote
Old 09-24-2009, 09:51 PM   #62
mrpowerballad
Member
 
Join Date: Mar 2008
Posts: 87
Thanks: 3
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by warrior View Post
Hi, I think it will be great if Elliott Wave's HK implimentation can be modified to actually show true length of Wicks of the HK candles.
I use this indicator every day and that's a feature I've wanted ever since I started using it. Like you said, it'd be very useful for S/R and TLs. Maybe someone here can dial this in, or else maybe I'll pay someone to do it and pass it along . . .
mrpowerballad is offline  
Reply With Quote
Old 09-30-2009, 08:39 AM   #63
crmcwi
Senior Member
 
Join Date: Jul 2009
Posts: 132
Thanks: 0
Thanked 0 times in 0 posts
Default trying to build HASmoothed into my strategy

Quote:
Originally Posted by mrpowerballad View Post
I use this indicator every day and that's a feature I've wanted ever since I started using it. Like you said, it'd be very useful for S/R and TLs. Maybe someone here can dial this in, or else maybe I'll pay someone to do it and pass it along . . .
Hi Powerballad,

I'm trying to build at least a portion of the code into my strategy to keep it from blowing up. I'll apprise as I make progress. Thanks.
crmcwi is offline  
Reply With Quote
Old 10-02-2009, 04:12 PM   #64
ciremo
Junior Member
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

to know what the current price is plot a 1 period sma (dot) of the close. It will move inside the current HA bar and show where the last price is.
ciremo is offline  
Reply With Quote
Old 10-15-2009, 09:44 AM   #65
mrpowerballad
Member
 
Join Date: Mar 2008
Posts: 87
Thanks: 3
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by ciremo View Post
to know what the current price is plot a 1 period sma (dot) of the close. It will move inside the current HA bar and show where the last price is.
Thanks. I think I've found a slightly better solution, as follows:

1. In the HA indicator properties, set "Bar Type" to "3, Both".
2. In the chart properties, set down bars and up bars to the same color that the "Shadow Color" is set to in the HA properties.
3. Change "Chart Style" to HiLo.

This results in the HiLo bars extending the HA wicks to their true level without affecting the HA bodies. The HiLo bars actually blend in perfectly with the HA wicks, so it's pretty seemless. This method should save a little more memory than the SMA method.
mrpowerballad is offline  
Reply With Quote
Old 10-17-2009, 01:22 PM   #66
nmk85roll
Junior Member
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

I really like the option of painting price bars along with the HK bars. Is there anyway to set the HK parameters so it is NOT smoothed? I want to see what a regular HK looks like along with the price bars. Much appreciated!
nmk85roll is offline  
Reply With Quote
Old 10-17-2009, 05:13 PM   #67
nmk85roll
Junior Member
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Scratch that last post. Figured it out...

Quote:
Originally Posted by nmk85roll View Post
I really like the option of painting price bars along with the HK bars. Is there anyway to set the HK parameters so it is NOT smoothed? I want to see what a regular HK looks like along with the price bars. Much appreciated!
nmk85roll is offline  
Reply With Quote
Old 10-25-2009, 01:52 PM   #68
tomtom
Junior Member
 
Join Date: Jun 2009
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
Default Has anyone gotten this working in NT7?

Importing gives lots of errors..
tomtom is offline  
Reply With Quote
Old 01-03-2010, 01:36 PM   #69
FredMorgan
Junior Member
 
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default The Best Haiken Ashi Implementation I Have Seen.

Quote:
Originally Posted by elliott wave View Post


for those that know how to convert metatrader indicators to nt i think this one is definitely worth it.

Although a proper conversion would be optimal, i'd like to mention that the t3 slope value (positive/negative) gets really close to this as does macd using 5,13 with a smooth of 1. When the plot is above zero the bar is blue, when below its red etc..
do we have a ninjatrader version of this file - file is a mq4.
Last edited by FredMorgan; 01-03-2010 at 06:17 PM.
FredMorgan is offline  
Reply With Quote
Old 01-03-2010, 06:22 PM   #70
FredMorgan
Junior Member
 
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default Alert on Change in Haiken Ashi Colors.

Do we have, or can anyone out there write a script to give an audible alert when the Haiken Ashi candles change colors (using green and red).
FredMorgan is offline  
Reply With Quote
Old 07-11-2010, 09:40 AM   #71
mrlogik
Certified NinjaScript Consultant
 
mrlogik's Avatar
 
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
Default

I was asked via email if I could convert this to NT7. Figured it would be best to post it here for everyone to use.

Although NT7 has a built in T3, I kept the original T3 from this file and renamed it to T3Mod. This was done to keep the calculation as close to the original MQ4 code as possible.

logiK
Attached Files
File Type: zip HeikenAshiSmoothed_NT70.zip (27.7 KB, 864 views)
"You look closely enough, you can find everything has a ... weak spot where it can break, sooner or later"

PureLogikTrading
mrlogik is offline  
Reply With Quote
The following 2 users say thank you to mrlogik for this post:
Old 07-11-2010, 10:16 AM   #72
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

I will have someone reply to you on Monday. Thank you for your patience.
NinjaTrader_Ben is offline  
Reply With Quote
Old 07-11-2010, 11:25 AM   #73
mrpowerballad
Member
 
Join Date: Mar 2008
Posts: 87
Thanks: 3
Thanked 4 times in 4 posts
Thumbs up

Quote:
Originally Posted by mrlogik View Post
I was asked via email if I could convert this to NT7. Figured it would be best to post it here for everyone to use.

logiK
Great indicator -- thanks for sharing
mrpowerballad is offline  
Reply With Quote
Old 07-13-2010, 07:41 AM   #74
paulchow2k
Member
 
Join Date: Feb 2009
Location: Melbourne, Australia
Posts: 84
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by mrlogik View Post
I was asked via email if I could convert this to NT7. Figured it would be best to post it here for everyone to use.

Although NT7 has a built in T3, I kept the original T3 from this file and renamed it to T3Mod. This was done to keep the calculation as close to the original MQ4 code as possible.

logiK
Thanks for sharing mate...

regards

Paul
paulchow2k is offline  
Reply With Quote
Old 09-13-2010, 03:23 AM   #75
FulcrumTrader
Member
 
Join Date: Jul 2009
Location: Las Vegas
Posts: 34
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by Elliott Wave View Post
I made a few minor changes.

-Selecting 3 for bar type, now shows both the heiken ashi and regular candles (or whatever chart type is being used).

- When viewing the standard candles, the candle outline color is now equal to the shadow color for the heiken ashi bars (makes them look better imo).

----
To the poster below:

I don't trade futures, but generally the market shouldn't matter.

To each his own, but a few indicators I personally like:

-This one.
-SuperTrend
-FibLines
-QQE
-ASCTrend
-StepMA7.1
-KasePeakOscillator and Permission Function (real versions, not the clones)
-The JurikUT package.
Anyone using this version of SMOOTHED HA (from post #23) with any success in the beta #21 of NT7??? I tried to import this exact post .zip file but getting errors.....hmmmm?
FulcrumTrader 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
Bug: Ninja Trader very slow using Heiken Ashi Currywurst Charting 6 07-20-2008 04:41 AM
Heiken Ashi arilano Strategy Development 14 06-23-2008 12:18 PM
Strategy implementation stefy Strategy Development 1 06-03-2008 02:37 PM
Heikin-Ashi Candle technique Help to CREATE!! akwonline Indicator Development 4 03-04-2008 08:07 AM
Using Heinkin ashi indicator in strategy latkinso Strategy Development 1 01-08-2008 06:56 AM


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