![]() |
|
|||||||
| NinjaScript File Sharing Discussion Discussion for shared NinjaScript files. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#61 |
|
Senior Member
Join Date: Jul 2009
Posts: 132
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#62 |
|
Member
Join Date: Mar 2008
Posts: 87
Thanks: 3
Thanked 4 times in 4 posts
|
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 . . .
|
|
|
|
|
|
#63 | |
|
Senior Member
Join Date: Jul 2009
Posts: 132
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
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. |
|
|
|
|
|
|
#64 |
|
Junior Member
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#65 | |
|
Member
Join Date: Mar 2008
Posts: 87
Thanks: 3
Thanked 4 times in 4 posts
|
Quote:
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. |
|
|
|
|
|
|
#66 |
|
Junior Member
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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!
|
|
|
|
|
|
#67 |
|
Junior Member
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
Scratch that last post. Figured it out...
|
|
|
|
|
|
#68 |
|
Junior Member
Join Date: Jun 2009
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
|
Importing gives lots of errors..
|
|
|
|
|
|
#69 | |
|
Junior Member
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
Last edited by FredMorgan; 01-03-2010 at 06:17 PM.
|
|
|
|
|
|
|
#70 |
|
Junior Member
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
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).
|
|
|
|
|
|
#71 |
|
Certified NinjaScript Consultant
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
|
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
"You look closely enough, you can find everything has a ... weak spot where it can break, sooner or later"
PureLogikTrading |
|
|
|
|
|
#72 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
I will have someone reply to you on Monday. Thank you for your patience.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#73 |
|
Member
Join Date: Mar 2008
Posts: 87
Thanks: 3
Thanked 4 times in 4 posts
|
|
|
|
|
|
|
#74 | |
|
Member
Join Date: Feb 2009
Location: Melbourne, Australia
Posts: 84
Thanks: 0
Thanked 1 time in 1 post
|
Quote:
regards Paul |
|
|
|
|
|
|
#75 | |
|
Member
Join Date: Jul 2009
Location: Las Vegas
Posts: 34
Thanks: 0
Thanked 1 time in 1 post
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |