I know that many guys here love the notorious
Ichimoku Strategy.
Also i know that as many here love the
Ichimoku Strategy, so many here have not the necessary experience in coding.
So it is obvious that here is needed some help.
We, the - more or less - more experienced developers must give this help to the less experienced friends.
In this direction we have:
A. Definitions.1) Closing price: The closing price of the last tick.
2) Chikou Span: The closing price plotted 26 ticks behind.
3) Tenkan Sen: The moving average of the highest high and lowest low over the last 9 trading ticks.
4) Kijun Sen: The moving average of the highest high and lowest low over the last 26 trading ticks.
5) Senkou Span A: The average of the Tenkan Sen and Kijun Sen, plotted 26 ticks ahead.
6) Senkou Span B: The average of the highest high and lowest low over the last 52 ticks, plotted 26 ticks ahead.
7) Kumo (Cloud): The area between Senkou Span A and Senkou Span B.
B. Coding1) Close instrument = data.instruments[0]
close = instrument.close[instrument.close.length - 1]
2) Chikou Spanchikou-span = instrument.close[instrument.close.length - 26]
3) Tenkan Senhh9 = _.max(instrument.high[instrument.high.length - 1 - 9 .. instrument.high.length - 1])
ll9 = _.min(instrument.low[instrument.low.length - 1 - 9 .. instrument.low.length - 1])
tenkan_sen = (hh9 + ll9) / 2
4) Kijun Senhh26 = _.max(instrument.high[instrument.high.length - 1 - 26 .. instrument.high.length - 1])
ll26 = _.min(instrument.low[instrument.low.length - 1 - 26 .. instrument.low.length - 1])
kijun_sen = (hh26 + ll26) / 2
5) Senkou Span AhhA9 = _.max(instrument.high[instrument.high.length - 26 - 9 .. instrument.high.length - 26])
llA9 = _.min(instrument.low[instrument.low.length - 26 - 9 .. instrument.low.length - 26])
tenkan_sen_a = (hhA9 + llA9) / 2
hhA26 = _.max(instrument.high[instrument.high.length - 26 - 26 .. instrument.high.length - 26])
llA26 = _.min(instrument.low[instrument.low.length - 26 - 26 .. instrument.low.length - 26])
kijun_sen_a = (hhA26 + llA26) / 2
senkou_span_a = (tenkan_sen_a + kijun_sen_a) / 2
6) Senkou Span BhhB52 = _.max(instrument.high[instrument.high.length - 26 - 52 .. instrument.high.length - 26])
llB52 = _.min(instrument.low[instrument.low.length - 26 - 52 .. instrument.low.length - 26])
senkou_span_b = (hhB52 + llB52) / 2
C. Ordering Signals1) A bullish signal occurs when the Tenkan Sen crosses from below to above the Kijun Sen.
A bearish signal occurs when the Tenkan Sen crosses from above to below the Kijun Sen.
2) A bullish signal occurs when the price crosses from below to above the Kijun Sen.
A bearish signal occurs when the price crosses from above to below the Kijun Sen.
3) A bullish signal occurs when the price leaves upwards the kumo (=the cloud), that means when the price crosses upwards the max of Senkou Span A and Senkou Span B.
A bullish signal occurs when the price leaves downwards the kumo (=the cloud), that means when the price crosses downwards the min of Senkou Span A and Senkou Span B.
4) A bullish signal occurs when the Senkou Span A crosses from below to above the Senkou Span B.
A bearish signal occurs when the Senkou Span A crosses from above to below the Senkou Span B.
5) A bullish signal occurs when the Chikou Span rises from below to above the closing price.
A bearish signal occurs when the Chikou Span falls from above to below the closing price.
D. Conclusions.The
ichimoku Strategy is a good strategy, better and more stable than the EMA strategy.
But as with all things in our life, don't believe in miracles...