Hello,

It’s possible to enter both MarginCost and Leverage in an asset list. As I understand, for a proper backtest the following parameters should be used in the asset list:
  • For brokers that are using fixed margin (like, FXCM) the MarginCost should be entered in the asset list (entered Leverage in this case will be ignored). MarginCost remains constant throughout a backtest unless it’s updates, for example, once a month with the formula: MarginCost = Initial MarginCost * Asset Price / InitialPrice.
  • For brokers with variable margin (like, Global Prima, OANDA, etc.) MarginCost should be 0 and Leverage value should be entered. In this case the MarginCost is calculated from the leverage and the current asset price.

Do I understand this correctly?

Now about the MarginVal in a backtest. MarginVal of an open trade remains constant until the trade is closed even if MarginCost changes. MarginVal could be calculated in a script to be in align with MarginCost changes. Right?

Please correct me if I’m wrong.