Figure out whether the price has been higher than Donchain TOP in the last 20 periods

Created at 16 May 2018, 11:38
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!
irmscher9's avatar

irmscher9

Joined 22.12.2016

Figure out whether the price has been higher than Donchain TOP in the last 20 periods
16 May 2018, 11:38


Hey guys

So if I want to check whether CCI has been higher than 300 in the last 20 periods I do this:

 bool cci300_10 = _cci.Result.Maximum(10) >= 300;

 

...but what in case I would like to figure out whether the price has been higher than Donchain TOP in the last 20 periods?

bool dncTOP = MarketSeries.High.Maximum(20) >= _dnc50.Top.Last(0);

?

 

I'm not sure this code will work since it compares it with with the value of the last period...

Any ideas?


@irmscher9