Could you please help me?
I’ve got some strange behaviour happening and I don’t know if it is something I’m doing incorrectly.
I’ve got a strategy, when I apply that strategy to a USD or EUR cross there is no problem. The strategy returns the correct account size. However, when I apply that strategy to a JPY cross the AccountSize value returns 0 when processing historical bars. I’ve used VS to inspect the variables when the strategy is being applied using the Strategies Tab (Control Centre) and when it is in backtest to confirm it is returning different values. When applied in the Strategy Tab (Control Centre) the AccountValue returns 0 on the historical bars. When applied in backtest it returns the 50000 that is set in the initialise section of the code.
Tests i’ve done:
1. Exactly the same strategy applied to the GBPUSD & USDJPY via the Strategies tab (Control Centre) – different AccountSize being returned
2. USDJPY backtested in Strategy Analyser across the same dates – correct AccountSize returned
3. GBPUSD backtest in Strategy Analyser across the same dates – correct AccountSize returned
The code I use to segment between Historical vs real time is here:
double CAccountSize;
if (Historical) {
CAccountSize = AccountSize + Performance.AllTrades.TradesPerformance.Currency.CumProfit;
} else {
CAccountSize = GetAccountValue(AccountItem.CashValue);
}
AccountSize = 50000;
Any help you could offer would be greatly appreciated.
Thanks,
drolles

Comment