Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Heikin-Ashi

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

    Heikin-Ashi

    It would be really nice if there were a choice in the chart type drop down box for Heikin-Ashi, rather than having to go into Indicators (and technically, it is a chart type rather than an indicator). I like to switch between this and regular candlesticks, and it's so much easier when it's right there.

    #2
    Hello shali27,

    Thank you for your suggestion.

    With NinjaTrader 7 we will be adding additional chart styles which can be accessed from the chart, of which HeikenAshi will be one. Please see the following link.
    Ryan O.NinjaTrader Customer Service

    Comment


      #3
      Hello
      Looking for Heikin Ashi indicators, I found the attached Ninjascript as well as this post on Ninja forum.
      Now I wonder if I can use this indicator for a simple strategy (for istance, enter long after 3 bearish candles and 3 bull candles). Although I have a limited skill with Ninja Script, I feel I could implement it by myself if I only knew how I identify/initialize the OHLC (Open-High-Low-Close) values of a Heikin Ashi candle.
      Can you help me here ?
      Attached Files

      Comment


        #4
        Hello fliesen,

        Thank you for your post.

        The HeikenAshiSmoothed would be accessed in the following manner for an up bar:
        Code:
        			if(HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).Close[0] >
        				HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).Open[0])
        			{
        				// Do something.
        			}

        Comment


          #5
          Very helpful, thank you.
          I could compile this "HA" code with no error enabling the strategy with 1 minute timeframe, however I got no alert in the last hour - what is surely unrealistic.
          (The strategy search for a retracement, then gives an alert + sets a marker for eventual reversal).
          What is wrong with it ?

          Furthermore: is it possible to change the neutral outline of the normal candles to green or red, or give them a whatsoever evidence of their bullish or bearish nature ?
          Attached Files

          Comment


            #6
            Hello fliesen,

            Thank you for your response.

            You can use CandleOutlineColor or the outline of the bars to indicate bullish or bearish signals: http://www.ninjatrader.com/support/h...tlinecolor.htm

            I will test your strategy on my end and follow up when I have further details.

            Comment


              #7
              Hello fliesen,

              Thank you for your response.

              Comment out the following lines at the beginning of the Initialize() method:
              Code:
              //			Variable40 = Math.Round(Volume[0]);
              //			if  (Instrument.MasterInstrument.InstrumentType  !=  InstrumentType.Future)
              //            {Variable40 = Math.Round(Volume[0]/1000000);}
              //			if (Variable40 < 1 || ADX(14)[0] < 15) return;
              Then change the Close and Open of the HeikenAshiSmoothed to HAOpen and HAClose:
              Code:
              			if (HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAClose[1] <
              				HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAOpen[1] && HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAClose[2] <
              				HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAOpen[2] && HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAClose[0] >
              				HeikenAshiSmoothed(0.7, HAMA.SMA, HAMA.SMMA, 1, 2).HAOpen[0])

              Comment


                #8
                Perfect, the code now works pretty fine, although some small inconsistencies rarely occur, as for istance the 3 opposite alerts in the same instant of the attachment (can this depend upon the lack of volume v=0 ?) and the fact that NOT EVERY reversal and/or exit warning are signalized in the alert window (even when all internal and external conditions are triggered). May it be that Ninja loses some data at some moments ?
                Otherwise everything is ok, many thanks
                As to the CandleOutlineColor function, I may implement NinjaScript in a strategy, but how is it in a chart indicator like the HeikinAshiSmoothed_NT70.zip ? Can't I do anything from Parameters/Data/Visual/Plots of a normal indicators window ?
                Attached Files

                Comment


                  #9
                  Hello fliesen,

                  Thank you for your response.

                  The two Close alerts have the same condition to alert:
                  HAClose < HaOpen.

                  There is no option in the Indicators menu to change the CandleOutlineColor.

                  Comment


                    #10
                    1) ok
                    2) Then, what is the CandleOutlineColor function to add to ?

                    Comment


                      #11
                      Hello fliesen,

                      Thank you for your response.

                      CandleOutlineColor is a function in NinjaSCript to color the bars outline: http://www.ninjatrader.com/support/h...tlinecolor.htm

                      This would be the same as changing it through the Data Series menu of your chart.

                      Comment


                        #12
                        I know this.
                        I suppose I must write something like

                        if close > open, then CandleOutlineColor = Color.Blue
                        if close < open, then CandleOutlineColor = Color.Red

                        but this isn't a strategy, just a chart, therefore:
                        to which script must I add it ?

                        Comment


                          #13
                          Hello fliesen,

                          Thank you for your response.

                          It would have to be in a script, such as a custom indicator.

                          Comment


                            #14
                            ok Patrick. Thank you

                            Comment


                              #15
                              Excuse me Patrick
                              I realize that this strategy, just after its enabling, gives me many signals, but very strangely, these signals become fewer and fewer with the day progress, till when they practically disappear with no alert at all. In other words, the strategy seems to work only for a few minutes, what makes it useless.
                              I am not sure how the HAMA or the HeikenAshiSmoothed is being calculated but I suspect that those values are being smoothed or being calculated over time, producing less variations which is reducing your signal frequency.
                              If so, how may I avoid this ?
                              Thnx for any help.

                              Mauro
                              • PS: Variable16 is used just to identify when I should have entered a position (HeikinAshi+ -> 1 or HeikinAshi- -> -1) or closed it (opposite alert -> 0).
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Brevo, Today, 01:45 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Brevo
                              by Brevo
                               
                              Started by aussugardefender, Today, 01:07 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post aussugardefender  
                              Started by pvincent, 06-23-2022, 12:53 PM
                              14 responses
                              239 views
                              0 likes
                              Last Post Nyman
                              by Nyman
                               
                              Started by TraderG23, 12-08-2023, 07:56 AM
                              9 responses
                              384 views
                              1 like
                              Last Post Gavini
                              by Gavini
                               
                              Started by oviejo, Today, 12:28 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post oviejo
                              by oviejo
                               
                              Working...
                              X