Ichimoku is a moving average based trend identification system. It contains more data points than standard candlestick charts and thus provides a clearer picture of potential price action.
Signature
1
publicabstractinterfaceIchimokuKinkoHyo
Namespace
cAlgo.API.Indicators
Examples
1 2 3 4 5 6 7 8 91011121314151617
//...privateIchimokuKinkoHyoichimokuKinkoHyo;//...protectedoverridevoidOnStart(){ichimokuKinkoHyo=Indicators.IchimokuKinkoHyo(tenkanSenPeriods,kijunSenPeriods,senkouSpanBPeriods);}protectedoverridevoidOnBar(){Print("ChikouSpan Value = {0}",ichimokuKinkoHyo.ChikouSpan.LastValue);Print("KijunSen Value = {0}",ichimokuKinkoHyo.KijunSen.LastValue);Print("SenkouSpanA Value = {0}",ichimokuKinkoHyo.SenkouSpanA.LastValue);Print("SenkouSpanB Value = {0}",ichimokuKinkoHyo.SenkouSpanB.LastValue);Print("TenkanSen Value = {0}",ichimokuKinkoHyo.TenkanSen.LastValue);//...}
usingcAlgo.API;usingcAlgo.API.Indicators;namespacecAlgo.Robots{/// /// This sample cBot shows how to use the Ichimoku Kinko Hyo indicator/// [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]publicclassIchimokuKinkoHyoSample:Robot{privatedouble_volumeInUnits;privateIchimokuKinkoHyo_ichimokuKinkoHyo;[Parameter("Volume (Lots)", DefaultValue = 0.01)]publicdoubleVolumeInLots{get;set;}[Parameter("Stop Loss (Pips)", DefaultValue = 10)]publicdoubleStopLossInPips{get;set;}[Parameter("Take Profit (Pips)", DefaultValue = 10)]publicdoubleTakeProfitInPips{get;set;}[Parameter("Label", DefaultValue = "Sample")]publicstringLabel{get;set;}publicPosition[]BotPositions{get{returnPositions.FindAll(Label);}}protectedoverridevoidOnStart(){_volumeInUnits=Symbol.QuantityToVolumeInUnits(VolumeInLots);_ichimokuKinkoHyo=Indicators.IchimokuKinkoHyo(9,26,52);}protectedoverridevoidOnBar(){if(Bars.ClosePrices.Last(1)>_ichimokuKinkoHyo.SenkouSpanB.Last(1)){ClosePositions(TradeType.Sell);if(_ichimokuKinkoHyo.TenkanSen.Last(1)>_ichimokuKinkoHyo.KijunSen.Last(1)&&_ichimokuKinkoHyo.TenkanSen.Last(2)<=_ichimokuKinkoHyo.KijunSen.Last(2)){ExecuteMarketOrder(TradeType.Buy,SymbolName,_volumeInUnits,Label,StopLossInPips,TakeProfitInPips);}}elseif(Bars.ClosePrices.Last(1)<_ichimokuKinkoHyo.SenkouSpanA.Last(1)){ClosePositions(TradeType.Buy);if(_ichimokuKinkoHyo.TenkanSen.Last(1)<_ichimokuKinkoHyo.KijunSen.Last(1)&&_ichimokuKinkoHyo.TenkanSen.Last(2)>=_ichimokuKinkoHyo.KijunSen.Last(2)){ExecuteMarketOrder(TradeType.Sell,SymbolName,_volumeInUnits,Label,StopLossInPips,TakeProfitInPips);}}}privatevoidClosePositions(TradeTypetradeType){foreach(varpositioninBotPositions){if(position.TradeType!=tradeType)continue;ClosePosition(position);}}}}
1 2 3 4 5 6 7 8 910111213141516
importclrclr.AddReference("cAlgo.API")# Import cAlgo API typesfromcAlgo.APIimport*# Import trading wrapper functionsfromrobot_wrapperimport*importmathclassTest():defon_start(self):self.ichimokuKinkoHyo=api.Indicators.IchimokuKinkoHyo(tenkanSenPeriods,kijunSenPeriods,senkouSpanBPeriods)defon_bar(self):print(f"ChikouSpan Value = {self.ichimokuKinkoHyo.ChikouSpan.LastValue}")print(f"KijunSen Value = {self.ichimokuKinkoHyo.KijunSen.LastValue}")print(f"SenkouSpanA Value = {self.ichimokuKinkoHyo.SenkouSpanA.LastValue}")print(f"SenkouSpanB Value = {self.ichimokuKinkoHyo.SenkouSpanB.LastValue}")print(f"TenkanSen Value = {self.ichimokuKinkoHyo.TenkanSen.LastValue}")
Print("ChikouSpan Value = {0}",ichimokuKinkoHyo.ChikouSpan.LastValue);
1
print(f"ChikouSpan Value = {self.ichimokuKinkoHyo.ChikouSpan.LastValue}")
SenkouSpanA
Summary
Leading span 1, this line forms one edge of the kumo, or cloud.If the price is above the Senkou span, the top line serves as the first support level while the bottom line serves as the second support level.