How would I know? You guys are experts in MQL4... That is why I attached indicator
code, and if there is anything I should change in it, please let me know!!! How
hard it could be to advise me on 5 lines indicator?
And again, I am testing on Open prices only (not every tick) and do not see anything
close to your printout. One line and one value per every 1H bar.
For example
ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
Current ExtBuffer0 value calculated on base of next (not previous!) ExtBuffer0 value (Fish1)
IMHO You've used as example our custom indicator like MACD.mq4. But in this case
direction of calculation does not matter because used right calculated values of
standard indicator MA
See for example our Bands.mq4
2. Value1 and Fish1 are not initialized. All right if You calculates whole cycle
from Bars-1 to 0. But there may be problem if calculate from limit to 0. You need
for 2 additional (not plotted) buffers to store values between calculations.
thank you very much for your suggestions. I took a look into Bands.mq4, but not
sure how it helps (I don't see anything helpful there).
Ok, I think I finally can show you what is going on. Below is a picture taken from
the terminal and strategy tester as well. Now, I am printing values starting from
index 1, not 0! So, in Terminal window Curr is index 1, Prev is index 2 (circled
with red), Curr_1 is index 3 and Prev_1 is index 4 (circled with blue) on MyInd.
In the terminal printout, values are EXACTLY as they are on the chart when I do mouse hoover.
I am using exactly the same indicator in Strategy Tester and last values in tester printout are correct (circled with red). However, next set of values (in blue) are wrong!!! Somehow, Tester does not calculate indicator values in the same way Terminal
does.
Modified MyInd.mq4 is attached for your reference. Any ideas? Thanks.
1. check for prevtime removed 2. Value1 and Fish1 are used for next calculations therefore they should be in the global scope 3. direction of calculation inverted like in the Bands.mq4
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
How would I know? You guys are experts in MQL4... That is why I attached indicator code, and if there is anything I should change in it, please let me know!!! How hard it could be to advise me on 5 lines indicator?
And again, I am testing on Open prices only (not every tick) and do not see anything close to your printout. One line and one value per every 1H bar.
1. Counting from 0 to Bars is way from current (last) bar to oldest (first) bar i.e. reverse direction
For example
ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
Current ExtBuffer0 value calculated on base of next (not previous!) ExtBuffer0 value (Fish1)
IMHO You've used as example our custom indicator like MACD.mq4. But in this case direction of calculation does not matter because used right calculated values of standard indicator MA
See for example our Bands.mq4
2. Value1 and Fish1 are not initialized. All right if You calculates whole cycle from Bars-1 to 0. But there may be problem if calculate from limit to 0. You need for 2 additional (not plotted) buffers to store values between calculations.
thank you very much for your suggestions. I took a look into Bands.mq4, but not sure how it helps (I don't see anything helpful there).
Ok, I think I finally can show you what is going on. Below is a picture taken from the terminal and strategy tester as well. Now, I am printing values starting from index 1, not 0! So, in Terminal window Curr is index 1, Prev is index 2 (circled with red), Curr_1 is index 3 and Prev_1 is index 4 (circled with blue) on MyInd. In the terminal printout, values are EXACTLY as they are on the chart when I do mouse hoover.
I am using exactly the same indicator in Strategy Tester and last values in tester printout are correct (circled with red). However, next set of values (in blue) are wrong!!! Somehow, Tester does not calculate indicator values in the same way Terminal does.
Modified MyInd.mq4 is attached for your reference. Any ideas? Thanks.
sfgsf
1. check for prevtime removed
2. Value1 and Fish1 are used for next calculations therefore they should be in the global scope
3. direction of calculation inverted like in the Bands.mq4