Calculating risk with MarketInfo()

 

In preparing to write my first EA (which includes code to calculate lot purchase size based on risk), I wrote a script to pull various pieces of data from the broker's server, in this case Alpari-US, to make sure the data was being pulled as I expected it to be. I noticed the following in regards to MarketInfo() MODE_POINT and MODE_TICKSIZE and am hoping to at least spur discussion on the matter if not get a logical answer as to why this is happening. Below is the results returned by my script for 5 currency pairs.

Function USDJPY USDCHF USDCAD EURUSD GBPUSD EURJPY
MarketInfo(symbol,MODE_BID) 91.503 1.03913 1.05027 1.43261 1.59321 131.085
MarketInfo(symbol,MODE_POINT) 0.001 0.00001 0.00001 0.00001 0.00001 0.001
MarketInfo(symbol,MODE_TICKSIZE) 0.00001 0.00001 0.00001 0.00001 0.00001 0.001
MarketInfo(symbol,MODE_TICKVALUE) 1.09286 0.96234 0.95214 1 1 1.09286

My question lies with the TICKSIZE of the USDJPY pair. Specifically, why is the TickSize smaller than Point for this pair? Other threads on this forum suggest that there can be multiple Points in a tick, which on the surface seems logical, but that would not explain why TickSize is SMALLER than Point in this case. All of the other pairs (including those not shown here) have Point equal to the TickSize and multiplying either by 100,000/Bid Price yields the Tick Value (for pairs with a base currency equal to deposit currency). However, for the USD/JPY, this is not so (in fact, to get to Tick Value you must multiply Point by 100,000/Bid). My understanding is that the Broker sets these values, but after speaking with an Alpari rep., it is clear they don't know the answer to the above question. The only conclusion I have been able to come to is that the USD/JPY TickSize is an error and should instead be .001. Note that for another pair with the JPY as the quote currency, the EUR/JPY, the TickSize is .001 which is as expected because this equals TickValue when multiplied by 100,000/Bid of the USD/JPY (we use USD/JPY here because TickValue returns the value in the Deposit currency which in this case, is the USD).

So in summary, does anyone know why the TickSize for this pair is less than its Point? I'd love to know why so that I can be sure I'm calculating risk correctly. Thanks.

 

Looks buggy.

 

I wish it was with my code, but my guess is that it's their data that's messed up.

I did a little manual manipulation of the output, but didn't change any of the values. Here's the script:

int start()
{
string symbol, filename="forumscript.csv";
string symbolarray[9]={"EURUSD","USDJPY","GBPUSD","USDCHF","EURJPY","GBPJPY","CADJPY","USDCAD","AUDNZD"};

int Handle=FileOpen(filename, FILE_CSV|FILE_WRITE, ",");

for(int x=0; x<=8; x++)
{
symbol=symbolarray[x];
FileWrite(Handle,"Currency Pair",symbol);
FileWrite(Handle,"Bid price", MarketInfo(symbol,MODE_BID));
FileWrite(Handle,"1 Point", MarketInfo(symbol,MODE_POINT));
FileWrite(Handle,"Tick size in quote currency",MarketInfo(symbol,MODE_TICKSIZE));
FileWrite(Handle,"Tick value in deposit currency",MarketInfo(symbol,MODE_TICKVALUE));
}
FileClose(Handle);
return(0);
}

Reason: