Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Heiken ashi rounding on tick value - how to remove it?

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

    Heiken ashi rounding on tick value - how to remove it?

    I use Heiken ashi candles on /ES chart and the open and close of candles is rounded on a tick value which is 0.25 points for /ES. In NT7 that was not the case.
    So my question is how to draw candles which are not rounded on a tick value but on a real HA calculation?

    thanks

    #2
    Hello,

    We use the RoundToTickSize() method (part of NinjaScript) in the HeikenAshi Bar Type to accomplish this behavior. If you have experience with NinjaScript, you could make a new copy of this Bar Type and replace the calls to RoundToTickSize() with your own rounding logic to include as many decimal places as you would like.

    Other than copying and editing the Bar Type, there will not be a way to change the rounding going on behind the scenes, since it is part of the Bar Type code itself.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Dario,

      I ran into issues with the HeikenAshi bars myself. I use them mostly with range bars and there's no support for that in NT8. I ported over the NT7 version, along with some other modifications I had made. I've attached the port and left a couple of the modifications in that might be useful to you.

      The modifications are:

      1. When used with range bars, the color of the last bar will be different than normal until the bar has reached the full range.
      2. There's a Boolean parameter that allows showing the regular bars next to the Heiken Ashi bars.

      I had to make some changes because I put custom code on the Indicator base class that this indicator was using. In case I missed removing something and it doesn't compile for you, let me know.

      Wil
      Attached Files

      Comment


        #4
        Thank you both...

        Comment


          #5
          Dario,

          No problem. I've attached another file that I normally use with Heiken Ashi. Since the values are not aligned to tick size, as ninja Dave suggested, I usually round up or down to tick size based on the direction I'm concerned with. The two functions are RoundUpToNearest and RoundDownToNearest - you pass the Heiken value as the first parameter and TickSize as the second in both. There are some other functions in there for equality comparisons as well. They are created as extension methods so you could do something like "heiken.HAHigh[0].RoundUpToNearest(TickSize);".

          I make no guarantees about the accuracy so verify the results for yourself
          Attached Files

          Comment


            #6
            Thanks Wil...

            Comment


              #7
              Hey there,

              thanks for porting it over. I also think NT8 should support Heiken Ashi for Range / Renko bars.

              Is there an update for the Heiken Ashi indicator? I'm using it with NT8 Beta too, but the candle shadows (or the bar itself) are offset.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,606 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              8 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              13 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X