Hi niuniu, thanks for your contribution, it comes in handy considering MT5 laks of this indicator.
I was double checking the math routine on your script to make sure it would correspond to how I would calculate pivot points based on different sources (e.g. Wikipedia, BabyPips, etc), and it seems we have a difference on how you calculate the third support (S3). You have this:
S3 = (2*P)-((2* LastHigh)-LastLow);
I would instead have done it this way:
S3 = (2*P)-((2* LastHigh)+LastLow);
Notice the positive sign for the LastLow variable.
In fact, if MQL5 does proper order of operations --which I believe it does--, you could safely simplify your routine by getting rid of most of the parenthesis, from this:
Hi niuniu, thanks for your contribution, it comes in handy considering MT5 laks of this indicator.
I was double checking the math routine on your script to make sure it would correspond to how I would calculate pivot points based on different sources (e.g. Wikipedia, BabyPips, etc), and it seems we have a difference on how you calculate the third support (S3). You have this:
I would instead have done it this way:
Notice the positive sign for the LastLow variable.
In fact, if MQL5 does proper order of operations --which I believe it does--, you could safely simplify your routine by getting rid of most of the parenthesis, from this:
To this:
Please double check the S3 calculation to check if you got ir right, and thanks again for the script!