calculate lotsize on account in euro

 

Good evening!

I want to calculate the lotsize depending on the risk per trade. Therefore I calculate the value per pip like that:

double pips2dbl;
   
if (Digits == 5 || Digits == 3)    
{pips2dbl = Point*10;} else {pips2dbl = Point;}

double pip_value  = (pips2dbl/Ask) * 100000;

If I do that calculation on a EUR / XXX - pair, I get the result in Euro - that is what I want as my account is based on euro.

But if I calculate it for a pair that is not in euro, I have to calculate the exchange rate between the traded currency and euro. Is there a function or a another easy way to do so without using

double ask   =MarketInfo("XXX/XXX",MODE_ASK);

?

Thanks in advance for any hint :-)

 
APeng:


Thanks in advance for any hint :-)


This is why you have to factor in TickSize . . . reams and reams have been written about this . . use the Search.
 
RaptorUK:
This is why you have to factor in TickSize . . . reams and reams have been written about this . . use the Search.

DAMNED!

Raptor, you are simply to fast :)

I checked for the solution of my problem some time before posting it and right now I found

double PV=MarketInfo(Symbol(),MODE_TICKVALUE);   //Tick value in the deposit currency.
and wanted to answer my question by myself - but you were to fast ;)
 
See my code, no hard coded constants (10000), TickValue must be used as a ratio.
Reason: