Resposta

wrong lot size calculation for MM simulation multicurrency trades

0 respostas

krzysiaczek99

Subscriber, bbp_participant, community, 57 replies.

Perfil da visita

5 meses atrás #285175

I have a trade of NZDJPY but account currency is USD 10000$. Then I made MM simulation and used ‘Risk fixed % balance 2%’. got size 0.2 lot. Exch rate at time of trade of NZDUSD was 0.58 so to calculate lot size its 10000* 0.02 / 0.58 / 100000 = 0.0034 lot. Why we are getting 0.2. Looking code below calculation don’t consider exchange rate at all !!

Krzysztof

@Override
public double computeTradeSize(SQOrder order, double tickSize, double pointValue) throws Exception {
if(mmRisk < 0) {
throw new Exception(“Money management wasn’t properly initialized. Call init() method before computing trade size!”);
}

double tradeSize = 0;
double orderSL;

tradeSize = (equity * mmRisk / 100 ) * 100 / 100000; !!!! assuming trade is in account currency !!!

0