Wrong numerical result?
OK, I've done some more testing, turned out that the PastHigh[i] is wrong, it returns the highest high calculating from the current month, rather than only months in past year. I think PastLow would have the same problem.
How do I get round this? Please help?
-
Why did you post your MT4 question in the
Root /
MT5 Indicators section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. -
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle
4066/4073 errors.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
Sorry, I didn't know anything about root directory etc... I came in via the front page of Forum and got to the 'Technical indicator' .
Just an update, I got the problem sorted. I changed '0' to 'Month()', then it would calculated from the December candle of last year.
Sorry for any wrong posting. If necessary, you can delete the thread.
Dear All
I tried to calculate the pivot of last 3 years' range, ie the highest high, the lowest low of the last 3 years, and the closing price of the last year, then sum these 3 together and divided by 3.
I got the code working, but the numerical result is wrong. Using euro as example, it should be 1.1479 for 2018 (based on past 3 years' range), but the indicator shows 1.1630.
Please can someone take a look and see why the result is wrong?
Thanks,