İş tamamlandı
İş Gereklilikleri
I need to convert the attached mql4 file to PineScript.
Here are some ideas that could help you with this project:
1) To find two extermums of the indicator (functions isPeak&LastPeakIndex and isValley&LastValleyIndex).
2) To check if at these extremums we had as wel extremums of the price.
3) To compare extemums for the divergencies detection, usual approach for Regular divergencies, as described here, for example: https://www.babypips.com/learn/forex/regular-divergence
Example of usage are well represented in the functions BullishDivergence and BearishDivergence.
Also, just in case it'll be a helpful clue: in our indicators at the step #2 we use ZigZag. And, in fact, in our case this is a first step, i.e. we firstly detect the extremums of the price by ZigZag"