Ok, here's the function:
function convertProfit(string Rate)
{
char OldAsset[40];
strcpy(OldAsset,Asset); // store original asset
if(!asset(Rate)) return;
var Price = price();
asset(OldAsset);
if(Price > 0.)
PIPCost = PIP*LotAmount/Price;
}
In your run function, call
convertProfit("EUR/USD");
when your account currency is EUR and the counter currency is USD.
- No, forward peeking is something quite different. What you're doing here is training the strategy to trade more often in the months with better exchange rate. But there's most likely no correlation between your trade signals and the exchange rate, so you'll get distorted parameters and less profit in real trading.
At least that's what I suspect. I don't think that many people simulate a strategy this way, so there are no experiences how this really affects the profit, and my objections are purely theoretical. Just try it!
You can easily check the result of your method with walk forward analysis f.i. with the strategies from workshop 5, 6, or 7, or with your own strategies. Let me know how it worked.