Code: getting current exchange rate in testing mode

 

I'm backtesting my EA and in my EA I am trying to get the current exchange rate using the SymbolInfoTick() function, but this function is not allowed in testing mode.

I couldn't find any threads on this forum about it (the search sucks), so any idea how I can convert to and from base currency? (for the purposes of calculating trade volumes)

 

thanks 

 
  1. You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
  2. Account Balance * percent = RISK = (OrderOpenPrice - OrderStopLoss)*DIR * OrderLots * DeltaPerlot (Note OOP-OSL includes the SPREAD)
  3. Do NOT use TickValue by itself - DeltaPerlot
  4. You must normalize lots properly and check against min and max.
  5. You must also check FreeMargin to avoid stop out
 

Thanks, I'll try and research those functions you mention, and see if I can rewrite my stop loss calculation. (whats DIR?)


If I am trading on several different symbols (forex, metals, bonds, etc) I'd need to have different calculations right based on base currencies and appropriate normalisation?

Reason: