Check if tenkan and kijun are over /inside /below kumo

Created at 05 Feb 2021, 13:04
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
notzen's avatar

notzen

Joined 30.01.2017

Check if tenkan and kijun are over /inside /below kumo
05 Feb 2021, 13:04


Hello, 

I try to figure out how to insert this checks on cbot, 

Is there any function or way to know when tenkan sen and kijun sen are below, above or inside kumo? 

Also, there is a way to Chek if the last 2 candles close above, below on inside kijun sen?

Thank you! 


@notzen
Replies

PanagiotisCharalampous
08 Feb 2021, 08:13

Hi notzen.

The cloud is defined by Senkou Span A and Senkou Span B. Therefore you can check the Tenkan Sen and Kijun Sen in relation to these two values. Also you need to take into consideration the shift in the cloud which is defined by the Kijun Sen periods. For example, to check if Tenkan Sen is within the cloud, you should use the following code

            if (_ikh.TenkanSen.LastValue < _ikh.SenkouSpanA.Last(KijunSenPeriods) && _ikh.TenkanSen.LastValue > _ikh.SenkouSpanB.Last(KijunSenPeriods) ||
                _ikh.TenkanSen.LastValue > _ikh.SenkouSpanA.Last(KijunSenPeriods) && _ikh.TenkanSen.LastValue < _ikh.SenkouSpanB.Last(KijunSenPeriods))

The same logic should apply for the rest of the checks as well

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous