Skip to main content

pjsHeikenAshi – A Heiken Ashi indicator for Ninjatrader 8

I have been using Heiken Ashi bars for many years. I developed my own because the available indicators at the time did not fulfil my requirements and Ninjatrader did not support them natively. NT8 has since added a crude version of HA. I call it crude because it is implemented within the restrictions of their bar types, which means all the numbers are rounded to the nearest tick size and historical bars don’t always match real-time bars. This can create some odd-looking HA bars in instruments like NQ and you lose a lot of the patterns and smoothing effect you would typically see on some other platforms. For this reason, this version is implemented as an indicator, not a native bar type. Of course, I also wanted better performance, optional volatility smoothing, to be the ability to use the HA bars with range and Renko charts (not possible natively in NT), automation possibilities, and much more! This is it. The solution I came up with, refined and tested daily for many years now. It is the highest-performing HA indicator I have tested and can produce some beautiful charts.  

Some of the features
Traditional and alternative Heiken Ashi calculations are available. Take a look at the 8-range MES chart below. This is what pjsHeikenAshi is good at. Keeping you in the trend, and probably more importantly, stopping you from fighting it.

Heiken Ashi Turning Points
As well as the standard candles, pjsHeikenAshi can optionally mark Heiken Ashi turning points as supply and demand zones. These are areas on the chart where the trend changed. They often provide reactions on subsequent tests, even long after they have been tested, and re-tested, particularly on the longer time frames so you might want to mark them across your charts for future reference when they appear. If you are a short-term scalper, for instance, paying attention to the zones on the 60-minute chart should prove valuable. Here is an example of the 5m and 60m NQ. Here, the optional bar strength and turn point markers are enabled also. The time in the top right is the remaining candle time from my Priceline indicator.

Turn bars and turn zones shown

HAMA mode – (Smoothed Heiken Ashi)
Here is an example of smoothing in action. This is referred to on many other indicators as HAMA. This is with wicks turned off. Note how much more information you get regarding the acceleration of a move than with a simple MA line via the size of the bars.

HAMA mode

Delta Mode
pjsHeikenAshi also includes a ‘Delta’ Mode. It’s not delta in the traditional sense, but it will show a plot you can put in an indicator panel, whilst keeping your traditional bars in the main chart window. You can actually get quite creative with this. Here, I’m using the delta mode plotted over several panes to show multi-market correlation.

A video of pjsHeikenAshi in motion

 

Full feature list

  • Extremely efficient rendering with automatic degradation if required, during times of volatility on lower-performing systems (the NT chart lag issue!). A huge amount of time was spent on making the rendering up to 300% more efficient than some of the other HA implementations.
  • Works on any time frame, with ANY underlying bar type (including non-time-based charts)
  • Don’t lose the ‘feel’ of the big, fast bars from time charts. pjsHeikenAshi will optionally detect abnormal volatility and optionally paint fast bars a different colour so you know it was a fast move, even looking at historical data.
  • Larger-width candles (not enabled on very small bars as it’s pointless) are beautifully rendered with gradients. We spend a lot of time looking at candles. Let’s do them justice! 🙂
  • Bar wicks and shadows are customisable for colour and line width
  • HAOpen, HAClose, etc. are all exposed as plots for use in strategies and other automation
  • ‘Equivolume’ style bars and our own idea, volumetric shaded bars are supported. Our implementation will automatically size or shade the bars according to the volume of the bars currently displayed on the screen. This gives you a relative bar size for the duration you are looking at, rather than the whole session, which we find much better given the volume at certain times (i.e. the open/close) can distort the numbers.
  • Optionally, discreetly mark double tops and double bottoms on adjacent bars. This is surprisingly useful for scalpers!
  • Optionally marks Heiken Ashi turning points. Important areas where the trend changes. You’ll want to observe how these play out for a while!
  • Optionally show the current bar trend strength
  • Unlike many other implementations, this indicator supports other indicators overriding its bar fill and outline colours, if you want to use that.
  • Has a ‘Delta’ mode, that enables you to use pjsHeikenAshi like a typically indicator in another pane, shown as an oscillator, rather then the bars.
  • Has a mini chart mode to display charts, picture in picture style
  • Can colour chart backgrounds based on trend, giving clear and constant reminders of the bias.
  • Works with futures, FOREX, stocks, etc.
  • Can override the existing plot, or use it in a separate indicator pane.
  • Supplied free with a native NT add-on bar type which will efficiently hide the standard NT bars (if you desire). 
  • Many optional smoothing types are available, making this an excellent smoothed Heiken Ashi implementation, also.
  • Many other improvements have also been added since release. Please read the ‘Updates’ section below to learn about any new features.

Here are the settings. 

 

So there you go.

What do you think? Have any ideas? Let me know in the comments section below.

You might like to take a look at some of my other Ninjatrader bits and pieces.

Requirements

Ninjatrader version 8.0.27.0 or above for this release (Ninjatrader changed to a 64bit-only model), however, at this time, we cannot recommend using the 8.1.x.x branch. 8.0.27.1 is the last known recommended version.

Updates 

2022.03.11 – Improvements to how supply and demand zones are generated, with more options.  Items such as bar rejection strength. This means the price much reject from the zone for X bars before the zone is accepted as valid. After all, if the price moves away and never comes back, it’s a better zone, no? There are also new options to limit just where the zone can be made. Must it be a local pivot within X bars, so we only put zones at local highs, for example? I urge you to have a play with these options. It can filter out many of the minor zones and leave you with the really important ones.

2021.12.23 – Seems in a recent update I omitted the NullStyle chart style. Apologies. This would not affect upgrades, but the style would not have been installed on new installations. This would not affect the indicator, but you were missing this feature. This has been rectified. Please simply re-install to get the additional chart style (if you want it).

2021.11.25 – Update posted. Most of the new features are covered here https://youtu.be/WmcJF0XDbl8

2021.10.25 – Added some momentum opacity options for delta mode, so declining momentum can be shown like this 

Some minor bug fixes to mini chart mode to do with the layout in different panels. As a result, the mini chart now works in different panels than the main panel. You can do multi-time frame alignment things like this (the chart template is included in the download). Get creative! The background colouring here is set by the Long or Short bias, all green/all dark green, go! You can of course set any colour you want. I just have a thing for green at the moment 🙂 I’ve also added a maHAMA indicator template into the package as I seem to often get asked how to use the HAMA average mode.  Also, exposed the Indecision bars as a public series for use in strategies.

2021.10.05 – Added SMA to smoothing options. Now calculates volumes in background. Added a ‘Colour chart background with BIAS (all BIAS changes)’ option. This is different from the original ‘Colour chart background with BIAS’, in that instead of painting the whole background one colour, you get a colour reflecting the bias changes per bar, so charts like this are possible. 

or this (using hidden HA bars on main bar set, and HADelta mode on the panel below for longer term trend)

Note – If using the Background option in the main pane, you may wish to use the Ninjatrader shift and mouse wheel to change the ‘level’ to the highest, behind everything else (else your background colouring will be on top!).

2021.09.22 – I’ll post this one in a few days if all testing works out. This one has some performance tweaks (not that it could get much better, but any improvement is good), a few other minor tweaks and a big new feature! You can now use pjsHiekenAshi to show multiple charts on a single Ninjatrader 8 chart, picture-in-picture style. The chart need not be the same data series or even type, so you can mix time, range, tick, etc. It all works. Even the delta mode and BIAS backgrounds work! I’ve also added a couple of indicator templates for the mini charts into the distribution so you can easily fire up a couple per these examples if you wish. 

This one is a test chart, where I am testing HA bars and Delta bars from 2 different time frames on Left and Right alignment.

Here is an example from one of my entry charts, where I now have larger bars and the delta bars from the higher time frame to the right of my low tick normal bars.

And a short live example where there I am using it just as a bar magnifier, so I can see the last few bars blown up for reading PA better.

Most of the normal bar options still work! Turn zones and a few other the other bits do not yet. To use this feature, add a new instance of the indicator to your chart and take a look at the ‘Virtual canvas’ settings group. You can tell the indicator to use an alternative data series in the usual way. There isn’t a limit to the number of these you can add.

tbr – Updated turn zones with additional options. Fix to prevent off-screen future turn zones showing on the right edge if you had a large right margin and scrolled left.

2021.03.31 – Updated some config options to do with the turn zones. These are now an integral part and will be developed further. The turn zone behaviour has been changed slightly from prior versions. The turn zone is now ranged off the prior bar. This appears to give better results (there is logic behind this which will be covered later). New options were added to mark the turn zones too. These are not bought and sell signals. I will add some videos showing typical use, but there are a number of ways you can integrate them into your own strategy. They will work even if you have the Heiken Ashi bars turned off, so you can apply this over traditional candles if you wish. A “Minimum bars to keep zones” option has been added. This keeps the zone for at least X bars, before a re-test or break will remove it. This allows for some consolidation in the zone before the price moves off. We found the zones would be cleared too early in prior versions many times. The default is 1, which keeps the prior behaviour.

Turn zones

An option to show the bull/bear bar strength has been added. Of course, you can see this from the candles yourself and this option is off by default, but it can be added to the screen as an additional reminder of the current strength of the trend. On longer-term candles, like 60 minutes, etc., you might consider this a pre-trade sanity check – Are you going against a strong trend? Are your time-frame momentums aligned? It’s meant as an unobtrusive but obvious reminder as to what price is doing right now. The strength is based on the bodies of the candles over the ‘Period’ specified in the settings, so it’s relative to recent bars. You might use this on your normal primary price series chart, but you also might use it to display on your primary series chart, but based on a secondary series / longer time frame, for instance.  If you are on the strongest bar of the period, you will be pinned at 100% bull/bear.

A strong up trend in progress

A strong up trend in progress

2021.02.21 – 2 new public series have been exposed. PublicISVelocitySeries, and PublicVelocityMSSeries. The first holds a numeric integer 1 if the bar is a velocity bar, zero otherwise. The second actually holds the time in milliseconds that bar took to complete. The series can be used in Strategy Builder, Bloodhound, your own code, etc. As a result of these changes, some other small updates were made which actually makes for some minor performance improvements (any performance improvement is always a good thing in NT!).
Also, Antialiasing support has been added for the graphics rendering. This, depending on your preferences can provide for smoother, softer looking shapes/graphics. It does come at a minor graphical performance cost, though I think it is unlikely you will notice any difference on most modern pc’s. The default is OFF to keep prior behaviour (and not all people like the fuzzier look, so try it yourself and see what you prefer). You will find the open in the ‘Visual’ settings. Here is a side by side, Antialiasing on, and off (click pic for larger version).

2020.12.10 – Few more minor updates, and the addition of something I’ve been using a lot of late. Volume coloured bars. There is already the ‘equivolume’ chart style in many platforms (and in pjsHeikenAshi), but it messes with the bar width and I don’t like the look of the chart so much. Recently, I found that varying the opacity of the bar colours works much better (for me), and looks nicer too, so, it’s included in this new version. In the indie properties, in the ‘volume’s section, enable the ‘volume gradient’ option. Once you get used to this, it is immensely useful…
HeikenAshi with volume gradient bars

2020.09.11 – A few minor updates, plus the addition of _experimental_ ‘turn zones’. This option can be turned on even if you have the candles turned off. Find this option here

and will look something like this. They are only valid for ‘untouched’ zones, i.e., they disappear once tested.

2020.06.30 – A ‘delta’ mode has been added so you can use it in an indicator panel as well as the normal ‘bar’ mode. See the example below.
HeikenAshi delta mode

2020.05.28 – Minor update to rename internal smoothing class to prevent possible naming conflict with another often used smoothing class users might already have installed

2020.04.18 – Minor performance tweaks

2019.11.17 – Some bug fixes where smoothing is used as well as some additional new features and a tidying of the settings page.

Additional screenshots below

 

 

In stunning black, green and red 🙂

Notes

if you are using the pjsHeikenAshi indicator and want to hide the underlying NT8 bar type, select ‘NullStyle’ as the NT ‘Chart Style’, or select it from the bars drop down at the top of every chart. This is efficient as it stops the NT native bars plotting altogether. I’ve also bundled my ‘CandleStyleOneColour’, for free, in case you want to use that. It enables single colour candles, if you like those. Something NT8 natively does not do.

Real-world usage

We are actual traders, trading real money and not just software developers trading SIM. We’ve traded with this indicator, live, for 1000’s of hours. We can offer some ideas for usage, though we strongly recommend you experiment and find your own edge. We’ll be posting more details here and some video content soon 🙂

Download

if you already have a license key, please make sure you enter it in the indicator properties as part of the process of adding the indicator to your chart. Probably a good idea to ‘save as default’, so your key is remembered in your indicator template. 

As usual, let me know below if any issues and I will try to resolve them, time permitting.

Licensing

This tool requires a license after the 7-day trial period. You can purchase one here. Please make sure the indicator meets your requirements, prior to purchase. Thanks for your support!

FAQ

Can I install this on multiple computers? Yes – Up to 2 with the same licensed version of NinjaTrader, with the same license key.

Can I disable volatility bars? Yes – Just set the numbers for the relevant configuration options to zero.

How to I use pjsHeikenAshi as a momentum indicator in ‘Delta’ mode? Here’s a quick live stream replay I did showing how to use this feature

 

Support

if you have any questions, please contact us via the website (or email). If you already have the indicator, please be sure to provide your product key and machine id with the request. We cannot help you unless you provide your product key AND your machine id. Please note, your machine ID can be found in Ninjatrader, under the ‘Help, About’ menu.

Please be sure to check the DOCUMENTATION

Contact us

Please use the contact form via the website if you want to get in touch.

62 Comments

  • Cindy says:

    Hi, I’m trying to download the heiken ashi indicator but I’m getting the following error.

    Error! Failed to log the download request in the database table

    Is this still available?

    Thanks

    • pjsmith says:

      Hi – Please try again now. Unfortunately, I think you tried just as the site was upgrading a couple modules! Should be all OK now. I just also tested it my side and it seems fine. Let me know if any issues. Apologies for the timing!

  • Zeeman says:

    pjsmith – my email fxtradewin@gmail.com – I Need a dashboard base on range breakoout indicator — I have it for MT5
    can you please email

  • Gary Rodgers says:

    Hi, just dl’d the HA. Can you please give me the settings as follows: 2 tick renko with a 34 HAMA. want to see if this will do the same setup in NT8 that people use in MT4/5. Thank you.

  • Gary Rodgers says:

    I’m having trouble duplicating what you have on your NQ chart above. The moving average. That’s actually what I’m trying to get over the 2 tick renko.

  • Brad says:

    In the description above, you state, “HAOpen, HAClose, etc. are all exposed as plots for use in strategies and other automation”. Can you please explain, ideally with a bit of sample code, how to access these values from another indicator or strategy?

    • pjsmith says:

      Hi – This means that the HA values are exposed so you can easily use them with the NT strategy generator, etc. if you want to. Example strategy code below to buy when close > open. Hope this helps

      ” else if (State == State.DataLoaded)
      {
      pjsHeikenAshi1 = pjsHeikenAshi(Close, @””, HATypes.SylvainVervoort, 100, true, true, false, false, false, 50, 0, true, false, UniversalMovingAverage.HMA, 4, 0, 25, 2.5, false, true);
      }
      }

      protected override void OnBarUpdate()
      {
      if (BarsInProgress != 0)
      return;

      if (CurrentBars[0] < 1) return; // Set 1 if (pjsHeikenAshi1.HAClose[0] > pjsHeikenAshi1.HAOpen[0])
      {
      EnterLong(Convert.ToInt32(DefaultQuantity), “”);
      }

      }”

  • doc says:

    I cannot find a way to email you directly on the site in order to ask a specific question and i don’t really think it needs to be publicly posted. Please reply to my email submitted so that i can ask my questions. Thank you.

  • Jorge Martinez says:

    Hello,
    Can you please share with me the indicator screens that led to the 2 instance NQ chart showing the 1 minute HA bars and the EMA plot. Mine does not seem to coincide with yours and I feel it would be very useful. Also Looks like the up velocity bar color setting is on cyan and yet it draws bright lime green. Any tips to get the color to draw as I set it on the indicator setup screen? I have set NT to Nulltype.

  • Jorge says:

    Am loving the HA indicator but have specific questions.
    Is there an email address you can share to allow conversation relative to my questions please?Thanks.

  • Randy says:

    I Just downloaded your Heiken Ashi indicator for the 7-day trial a day ago but I cannot get it to appear at all on any style of chart no matter what settings I seem to use. I also have no idea what Velocity Bars means vs. regular HA Bars. Do I need to send you my Machine ID or something for the free trial to work? I found no contact email address at the website to accomplish that so I chose instead to make this post.

    • pjsmith says:

      Hi – It should work. Few things. Make sure you set it to display in the same window as the instrument. Velocity bars will give you an indication of how fast a bar completed (if you are using non-time based bars, like tick/range). it has no function on the minute or second bars, etc. Check your control centre ‘Log’ tab. If there are any issues, and error will likely be shown there. It will generally work right away out of the box, as it were, with no settings changes, and there really isn’t anything I can think of you could change to prevent that. I take it you did in fact manage to add it as an indicator to a chart?

  • Shah says:

    Hi Pjsmith,

    Thank you for the beautiful indicator. I’m currently building an algo bot, and planning to use HA candles. Does your HA candle can be accurately used with auto trading with real price of open and close for order submission? If this is possible, mind explain briefly how is this being achieved?

    • pjsmith says:

      Hi – Thanks. The answer is, yes, and no! I use it in exactly that scenario. During testing, in NT8, at least, Close[0] will always be the REAL current price. As you likely know, the opens on HA bars are not real. The Open, close etc., of the HA bars IS exposed via a plot for exactly this use in strategies etc. though, as HAOpen, HAClose, etc. So, as long as you submit orders using Close[0], bid, etc., – the usual Ninja methods, you’ll get the tick accurate price at the time. If you want to refer to the HA bars directly, use HAOpen[0], HAClose[0], etc. I hope this helps.

  • Sparky says:

    Hi, paid for the indicator, do activate it once you see this, thank you.

  • Ed says:

    Hi-

    I am thinking about purchasing your indicator, but I would like to know if this works for the e-mini contracts (ES, NQ, etc.). Also, does this work with other instruments, such as forex, stocks, etc.?

    Thank you!

    • pjsmith says:

      Hi,

      Yes – It works on emini contracts. I use it on them every day. It basically works on ANY instrument you can chart via NT8 and shows candles normally.

      All the best,

  • Ed says:

    Thank you for the reply, pjsmith. I myself have never applied (or seen anyone else) Heiken Ashi bars to Renko charts (or vice-versa). How would use a Heiken Ashi bar with a Renko chart? May I ask if you can post an example of the graphic above?

    • pjsmith says:

      I can’t post an image here, but happy to email you something. One of the reasons to build this as an indicator, rather than bar type, was specifically to apply it to ANY bar type. I use it on renko / unirenko all the time. I find it simply makes for a better-looking chart. Renko with range, for instance, something that is not possible with stock ninja, I really like.

  • Ed says:

    Thank you once again for the reply, pjsmith. Please email me something if possible – I am really looking forward to working with your indicators. Much appreciation in advance for this outstanding piece of coding!

  • Edgar says:

    Hello PJSmith, hope all is well. I downloaded the Heiken Ashi indicator and would appreciate if you can re-activate the trial to test it with my automation tool. Please reply back with your email to send you the key listed in the indicator.

    Thank you

  • A says:

    Hey PJ, can I please email you about activating the trial for Heiken Ashi for another week? I actually have a strategy that uses Heiken Ashi this time as opposed to whenever I tried it last and didn’t actually get a chance to test it out. Would appreciate it,thanks,

  • Jimmy says:

    Hi, is Gapless EMA is one of the option to use? I want to know if this heikenashi indicator can shwo gaps. Thank you,

    • pjsmith says:

      Hi – pjsHeikenAshi has an ‘Allow session gaps’ option, so, yes, it will so session gap open/closes. Not sure that this will work with smoothing though. Most of the smoothing functions are standard and don’t tend to cater for gaps. Feel free to try it.

  • pjsmith says:

    Hi – pjsHeikenAshi has an ‘Allow session gaps’ option, so, yes, it will so session gap open/closes. Not sure that this will work with smoothing though. Most of the smoothing functions are standard and don’t tend to cater for gaps. Feel free to try it.

    • Jimmy says:

      Hi, Thank you for the quick reply. I did download and installed it. How can I hide the original bar. I am having both bar on the chart. I am new to NT 8, please help.

  • Michael says:

    Hi Paul,

    Downloaded and imported the files. For some reason, after applying the indicator (tried minutes and seconds) and there is no change. Not sure what to do. Your help is appreciated when you get a chance. THanks.

  • HI PJ. I am trying out the PJS-Heiken Ashi for NT8. I have some questions before purchasing, but I am not finding any email to contact you. My email address is farooqm59@yahoo.com.

  • Hi Mr. Smith. I am trying out PJS-HeikenAshi for NT8. I have some questions before purchasing. I cannot reach you by email. My email address is farooqm59@yahoo.com.

  • Kevin says:

    hi Paul – Any chance you can share some templates using your HA code? I am interested in the zones on a tick chart or minute charts.

  • Alan Burch says:

    Hi Paul,

    I contacted you last year, but lost that conversation I had with you about a tool that wasn’t complete that I found.
    I tried to use your implementation of the HeikenAshi indicator so never go the evaluation that I needed to know if I want to buy your version. Can I try another 7 day trial of the indicator so I know if it will preform the way similarly to the pattern in the youtube video by Traderjoe63 with the link here – https://www.youtube.com/watch?v=gXs8PiPLWW4&t=146

  • Pierre says:

    Hi, thanks for creating this indicator. My problem with Ninja Traders’ version of the Henkin Ashi bars was that the open and close prices of the bars would look different the following day, the changes in open and close prices made it difficult for me to trust my manual backrest when using their bars. Did you experience a similar problem with NT’s version, and have you solved this problem?

    • pjsmith says:

      I believe this is a known issue with NT8’s default HA implementation. It also rounds to tick size, making it kinda useless, IMO. Anyway – I don’t believe the issue exists with the implementation on this site.

  • Pierre says:

    The candle body and current trading price in a live market are not in sync. Is this an error?

  • Ed says:

    Hey PJ-

    Do you have any renko-related indicators similar to your HA candlesticks for Ninjatrader?

    Thank you!

    • pjsmith says:

      Hi – Sorry, no. Not released ones, anyway. I do use UniRenko in some of my charts, particularly in combination with pjsHiekenAshi to get zones and levels though.

  • Michael Jones says:

    Hello,
    I was wondering if its possible to modify the code so an alarm would sound when the turn zones are generated?
    This indicator has been a great addition to my trading.

    Thank You,

    Mike

    • pjsmith says:

      Hi – I am glad you are finding it useful. Do you have the latest version? If you have voice alerts enabled, there is an ‘alert on new zone’, which will announce when a new zone is created. I think that has been released.

  • Rob says:

    Hi,

    I can’t find a place on your web site to order your Heiken Ashi bars. Can you send a link please?

    Rob

  • eugene says:

    HI. I’m not that technical, all I’m looking for, is the bars to paint accurately in real time without me having to refresh the data. Will the standard setting do that or do i have to make adjustments?

  • eugene says:

    Thanks!

  • Gary says:

    Hi Paul,
    I added a comment earlier that I was having trouble ordering. Do you offer some bundle pricing for three indicators (pjdProfile, pjsHeikenAshi, and pjsTamer)?
    Awesome work!
    Please send me an email and let me know.
    Thanks!

  • JonB says:

    i just want a tutorial on how to make that supertrend moving average into a strategy.
    Ninja trader is horrible at helping in doing this

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.