I am designing a robot in MetaTrader 4 that will trade 7 currencies, at a time.
I want to make a B (Buy) S (Sell) or W (Wait) decision in the Current (1 of 7) currencies based on the current signals from the BSW signals in the other 6 currencies.
The way that I set it up, each currency has a small .txt file with only one record in it, “B” or “S” or “W”. I have written 7 functions (one for each text file) to retrieve the current value from each of the 7 text files.
Technically, I have this coded this but there are A LOT of hits to these texts files, writing and reading simultaneously. I think that too many many read and write accesses are conflicting.
My question is, what is the best way to do something like this?
1. I am using .txt (are other formats faster)
2. Can I use error trapping to test access to a text file and if it is being block continue trying until I get the value read.
Sample code? I am a developer but only 1 year with meta trader 4 so I am learning.
3. I am working with Void Tick (every tick). Would a timer format be better to control access to the text files?
Any other suggestions.
Why are you using text files and not an array or even single variables ?
Yes a timer would be better because sometimes it takes a long time for a new tick to arrive.
I don't know how to do this, use an array.
Is there a way to get the current candle information from external currencies (currencies that are outside my current currency (for example retrieve the
AUDUSD candle base value (and set the value to a variable in the EURUSD EA) while the EA is operating in the EURUSD currency?
I am exporting to a text file from AUDUSD so that I can import to the EURUSD EA and set to a variable for calculations in the EURUSD EA>
Is there a way to drop the text file deal, which is not reliable enough, at this point and pull the AUDUSD market values directly from the Market.
That would change my life!