MT5 - How is the "Set current market" block supposed to work??
-
Hi,
I'm trying to get my EA to work with multiple currencies at the same time.
However, what i'm seeing is not what i'm expecting based on the description of the block in question. It opens the various currencies and then stays locked into/onto the currency on which chart the EA runs. As can be seen in the example i never get a handle on the proper values of the various currencies which are supposed to be "active".
Example projectHopefully someone can help me out on this one .. Tia
Fermin -
@dcg This block changes the current market if block has option, then loops back around and activates the next until it's finished then all goes back to original settings, it will not open other charts.
-
That is indeed what it says in the description.
However, this is not what it actually does! When de code is executed i would expect a line to be placed at 06:00 (tz is not relevant) in the chart of each currency in the list, within the strategy tester. Obviously this does not happen.
Trying to get the high and low for each does not work either.
So the question remains. How does one use the block so it actually does what it states ..
-
@dcg Never actually used but to draw line on chart means chart needs to be open so may as well have EA on chart, try saving the asset high/low into a variable and then visually verifying.
-
The line is actually solely there for visual confirmation purposes.
In the strategy tester the charts are actually open so that should not be an issue, as far as placing a line is concerned.
However, storing the H and L in a variable and then feeding it to the comment again shows just one asset being displayed instead of >1. This suggests that there is another requirement to get this working ..?
Btw, your input is appreciated ..
-
@dcg Silly but relevant question. Are you sure all involved charts are available as selectes symbols in the 'market watch' window of your MT5. Otherwise, nothing will happen.
-
Yes, all was available.
Fortunately (or so i convince myself) i made a silly mistake with regards to one of the blocks used. The culprit turned out to be the once per day block. Apparently it works across all assets used during the run. Once 1 asset got 'hit' the rest is skipped.
I solved it via the time block and a once per bar block.
Thank you however for taking the time to reply. -
@dcg You're welcome.