Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Heikin-Ashi
Collapse
X
-
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.Tags: None
-
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
-
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 ?
Comment
-
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
-
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;
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
-
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 ?
Comment
-
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
-
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
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
239 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
6 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
Comment