Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Heikin-Ashi Candle technique Help to CREATE!!

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

    Heikin-Ashi Candle technique Help to CREATE!!

    Hi folks

    Can anyone help to modify or create a Heikin-Ashi Candle technique with these calculations
    • xClose = (Open+High+Low+Close)/4
      o Average price of the current bar
    • xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
      o Midpoint of the previous bar
    • xHigh = Max(High, xOpen, xClose)
      o Highest value in the set
    • xLow = Min(Low, xOpen, xClose)
      o Lowest value in the set
    I see that NT has a Heikin-Ashi Candle, but they do not have these exact calculations.

    Can anyone help to modify the NT Hekin-Ashi, or create a New one with these calculations

    Thanks

    #2
    As a last resort you can also try contacting one of our NinjaScript Consultants. http://www.ninjatrader.com/webnew/pa...injaScript.htm
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by akwonline View Post
      calculations
      • xClose = (Open+High+Low+Close)/4
        o Average price of the current bar
      • xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
        o Midpoint of the previous bar
      • xHigh = Max(High, xOpen, xClose)
        o Highest value in the set
      • xLow = Min(Low, xOpen, xClose)
        o Lowest value in the set
      Please note that the only coding difference between your code (the traditional HA coding) and the NT HA code is the inclusion of above xClose. You will find that in all cases xClose is always going to be less than the High (in the third condition) and greater than the Low (in the fourth condition). Therefore there is no reason to do the comparison in the code. This is a fairly well known redundant code in the original Heikin-Ashi calculation.

      You can try this out with TS or any other charting package you are using and please post a sample of the difference if you can find one.

      Should you decide to go ahead and try this in NT as an exercise, you could consider the following code changes starting with line 65:

      Code:
      [SIZE=2][FONT=Courier New]Values[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Set((Open[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] + High[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] + Low[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] + Close[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) / [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]4[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]); [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]// Calculate the close[/COLOR][/SIZE][/FONT]
      [FONT=Courier New][SIZE=2]Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Set((Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] + Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) / [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]); [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]// Calculate the open[/COLOR][/SIZE][/FONT]
      [FONT=Courier New][SIZE=2][COLOR=#008000]//http://www.ninjatrader-support.com/vb/showthread.php?t=5382[/COLOR][/SIZE][/FONT]
      [FONT=Courier New][SIZE=2]Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Set( Math.Max(Math.Max(High[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]], Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]), Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) ); [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]// Calculate the high[/COLOR][/SIZE][/FONT]
      [FONT=Courier New][SIZE=2]Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Set( Math.Min(Math.Min(Low[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]], Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]), Values[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) ); [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]// Calculate the low[/COLOR][/SIZE][/FONT]
      HA with the original (& redundant) xClose test attached.
      Attached Files
      Last edited by thrunner; 02-02-2008, 11:21 AM.

      Comment


        #4
        I tried

        Hi Josh

        I did contact some of those people on the list and I did not get a response.

        IF you know of others please let me know

        Thanks

        Comment


          #5
          Hello akwonline,

          I've posted the classic Heiken-Ashi indicator here, it's available as a free download.

          I also have coded the Heiken-Ashi smoothed indicator (ported over from Metatrader code). You can see its picture here.


          Ben

          Originally posted by akwonline View Post
          Hi Josh

          I did contact some of those people on the list and I did not get a response.

          IF you know of others please let me know

          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by TraderBCL, Today, 04:38 AM
          2 responses
          17 views
          0 likes
          Last Post TraderBCL  
          Started by martin70, 03-24-2023, 04:58 AM
          14 responses
          106 views
          0 likes
          Last Post martin70  
          Started by Radano, 06-10-2021, 01:40 AM
          19 responses
          609 views
          0 likes
          Last Post Radano
          by Radano
           
          Started by KenneGaray, Today, 03:48 AM
          0 responses
          5 views
          0 likes
          Last Post KenneGaray  
          Started by thanajo, 05-04-2021, 02:11 AM
          4 responses
          471 views
          0 likes
          Last Post tradingnasdaqprueba  
          Working...
          X