Back

Output of Ichimoku Indicator

When you use the IchimokuKinkoHyo indicator (python) and plot the result, only one data series is given. Which aspect of the ichimoku indicator does this represent? The Ichimoku indicator usually consists of the following: 

  • Tenkan-sen = (9-period high + 9-period low) / 2
  • Kijun-sen = (26-period high + 26-period low) / 2
  • Senkou Span A = (Tenkan-sen + Kijun-sen) / 2
  • Senkou Span B = (52-period high + 52-period low) / 2
  • Chikou Span = Close plotted 26 periods in the past
Update Backtest







Backtest is attached. 

0


Thank you for submitting a backtest! After looking through the source code:

protected override decimal ComputeNextValue(IBaseDataBar input)
{


TenkanMaximum.Update(input.Time, input.High);
TenkanMinimum.Update(input.Time, input.Low);
Tenkan.Update(input);
KijunMaximum.Update(input.Time, input.High);
KijunMinimum.Update(input.Time, input.Low);
Kijun.Update(input);
DelayedTenkanSenkouA.Update(input.Time, Tenkan.Current.Value);
DelayedKijunSenkouA.Update(input.Time, Kijun.Current.Value);
SenkouA.Update(input);
SenkouBMaximum.Update(input.Time, input.High);
SenkouBMinimum.Update(input.Time, input.Low);
DelayedMaximumSenkouB.Update(input.Time, SenkouBMaximum.Current.Value);
DelayedMinimumSenkouB.Update(input.Time, SenkouBMinimum.Current.Value);
SenkouB.Update(input);
return input.Close;
}

It can be seen that while the indicator values are updated, the Close value of the DataBar (the OHLC values) is returned. So in the algorithm above, the Close values of AAPL are being printed. In order to access the values of the indicator try calling:

self.PlotIndicator("Indicator", self.Ichi.Tenkan)

0

Gurumeher, 

Thanks for the responce, that was very helpful to know for other indicators as well!

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed