If anyone could point me in the right direction I would be greatly appreciative?
I managed to fix the issue by creating my own ATR function and using that instead of MQL5's but can anone tell me why the ATR reading was off?
Bruno Harris :
I managed to fix the issue by creating my own ATR function and using that instead of MQL5's but can anone tell me why the ATR reading was off?
I managed to fix the issue by creating my own ATR function and using that instead of MQL5's but can anone tell me why the ATR reading was off?
In MQL5, the indicator handle must be created in OnInit, after which the values must be obtained using CopyBuffer.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have an EA that enters a stoploss based on the low of the last '5' bars. This is updated each bar to make a trailing stop. There is also a dot drawn once a bar to track the updated stoploss.
This has been working fine and I have backtested it multiple times.
I have recently purchased a third party VPS (not metatraders) and installed 2 instances of MT5 on to the VPS.
Using the EA on the VPS creates vastly different stoploss'.
Example:
Comparision of trade made at 2021.01.27 22:00:00
The ATR (for below) for both VPS and PC is 12.0.
The attached screenshot 727 show the entry on the PC (the desired affect).
This does not happen on the VPS. The stoploss is far too large.
Here's the code below:
Custom functions:
I have copied the EAs and related indicators etc exaclty.
There are two instances of MT5 on the VPS with two of the same EAs.
Each MT5 was set up in a different folder with different name. Each instance is run from a different broker account and they have different magic numbers.
Can anyone help me with what the issue might be?
Why does it give the desired results on my PC but on the VPS the stoploss changes?
Is there something else I'm missing?
Any advise would be grealty appreciated thank you.