Im trying to create a function that calculates the value in the deposit currency of the spread of each trade open and this function should be calculated differently in each broker, because they have different characteristics.
So I downloaded a blank mt4 terminal from www.metaquotes.com and I introduced external data there. I use this terminal in offline mode and the data is at Default Folder then data comes with a spread of 1. So what it happens is that in this terminal when I run:
It retusn the value 0. Anybody knows why it is?
Also have anybody done this function before?
What I ideally im looking for is something like this:
Return_Money_value(double lots) ---> Return the value of the the spread in deposit currency for the number of lots passed.
MarketInfo() as the name implies, returns values of the current state of the Market currently in use at the Broker.
So, obviously, if you are not connect to the broker (which I assume from your statement of "terminal in offline mode"), you will not get valid results for the function.
double valuePerLot = (Ask - Bid) * MarketInfo(_Symbol,MODE_TICKVALUE) / MarketInfo(_Symbol,MODE_TICKSIZE);
To add comments, please log in or register