Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Native Heikin Ashi bar types not quite correctly implemented?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Native Heikin Ashi bar types not quite correctly implemented?

    Hi,

    I actually made my own Heikin Ashi bars, based on the HA indicator hosted in the user contributed forums here. It plotted almost exactly the same as the user contributed one and worked very well. There was a drawback though. As it was not a native bar type, other indicators could not set bar colours, high/low etc were slightly out vs the hidden bar, etc. Performance a bit of an issue. It was perfect visually, but broken technically! So, I switched to trying to use the native HA bars in NT8. They are not formed the same and I suspect they may be incorrectly coloured etc. Looking at the code, the native HA bar type seems to set the high/low/close and inherit the rest? This includes bar colouring. So, for instance, NT8 native HA will colour a HA down bar green (up colour), when under the HA rules, it's still a down bar. Also, I notice differences in the opens, wicks, and closes. In looking at the code, the calculation formulas are written differently, but seem essentially the same, so I cannot see the reason for this.

    So, couple things. Can your developers take a look at the HA bar type and check the bar colouring? (example below). If there were a way to look at the formula and determine why the indicator HA bars look so much nicer and closer to what would be expected in HA (IMO), that'd be good. I want the native bar type, but I want the indicator bars!

    To replicate, you can just add 2 of the same data series to any chart. Leave one as a standard tick bar for instance, then add the HA indicator to it, then add the same tick data series to the same chart, but with the native HA type. They should be the same, assuming the calculations are correct, but they are not. Feel free to compare the same on another platform too. PRT for example, I tried.

    The NT8 native ones look quite clunky and not smooth, like the NT8 indicator and HA on other platforms. The differences are subtle, but it does seem the NT8 indicator version is much more in line with what would be expected when I compare with other platform HA etc., and I certainly prefer it, visually etc.

    [edit] some of the issues I am seeing, might be down to series rounding. I tested a version of the bar type without the 'roundtoticksize' calls, but it seems NT8 may simply internally round the bar numbers anyway, as this made no difference and I found other posts indicating same. Some of the errors arefar more than a tick or 2 though, particularly the odd body open/closes, so not sure this is the issue.

    If it is, and there is no way to use precise numbers for bar high/lows etc., there might be a workaround (albeit with performance penalties) if I could retrieve dynamically set bar colour outlines and body colours on each tick and hide the original bar series, rather than making it transparent.This would allow other indicators to change the bar outline colour for example and for it to be correctly used when the bar is re-drawn in onrender by the indicator. I cannot however see this is possible.

    Any comments?

    Thanks.
    Attached Files
    Last edited by pjsmith; 12-30-2018, 09:59 AM.

    #2
    Hello pjsmith,

    When you say the coloring is wrong, are you showing a bar where the open is lower than the close and the color is not green or the open is higher than the close and the color is not red?
    Can you show a screenshot with the data box open showing the colors are incorrect based on the open and close values for that bar?

    The HeikenAshi bars included with NinjaTrader are rounded to tick size. This is required for the bar type to work with order sending (as orders must be sent at an exact tick size). This causes the values to be different.

    If the rounding to tick size is an issue, you can use the indicator instead which does not round to tick size.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I am hesitating to post here, but after checking the in-built NinjaTrader Heikin-Ashi bars today, I understand that they are not in line with the original formula published by Dan Valcu. I have also compared the NinjaTrader in-built bars against bars from ThinkOrSwim, and my suspicion was confirmed.

      Could you point me to the source of the Heikin Ashin formula that was implemented in NinjaTrader?

      Please find attached a chart showing original Heikin Ashi bars (upper panel, also identical with those I have checked at TOS) and the NinjaTrader in-built Heikin Ashi bars. Is there any setting that can be changed to make the NinjaTrader in-built bars match the upper bars?
      Attached Files

      Comment


        #4
        Hello Harry,

        The HeikenAshi bar type included with NinjaTrader has the values rounded to the nearest tick size. This is necessary for the functionality of submitting orders, Atm, and NinjaScript Strategies.

        You can view the code for the HeikenAshi bar type by clicking New -> NinjaScript Editor -> BarsTypes -> and double click the HeikenAshiBarsType to open the script and view code.

        If you would like the values of the HeikenAshi without rounding, use the HeikenAshi indicator instead.
        NinjaTrader 8 natively provides Heiken Ashi as a bar type for most common bar types (minute, tick, volume, second, day, week, month, year). This Heiken Ashi indicator is provided for the Range, Renko and any custom bar types that may be added. The indicator performs in the same manner as the NinjaTrader 7 version. 4-27-18 […]


        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Barry Milan, Today, 10:35 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,428 views
        0 likes
        Last Post Handclap0241  
        Started by DJ888, Yesterday, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Working...
        X