Adding rebate to AccountBalance() - page 2

 
Donex:

I still think this solution won't give me the result I'm looking for.

I really need the account balance incremented by the rebate to see the affect of the dynamic risk during the testing. Eg, if I risk 1.6% of the account balance per trade, the compounding of the rebate on the account balance will affect the final result.


Sorry I dont understand why my suggestion doesnt work?


In your dynamic risk code you replace calls to AccountBalance() with calls to realBalance()

In your Rebate code simple call addCredit(xxx) and it will be incorporated into the balance calculated by realBalance().

If risk is 1.6% it's simply 1.6 % of realBalance().

Seems simple enough unless I'm missing something?

 

Sorry ydrol, you're right, understand what your method is now. thx heaps


Just didn't get my head around what you were saying, but got it now. Brilliant m8 :)

 
Thirteen:

Why not simply adjust the dynamic risk profile to use the sum of AccountBalance() and the cumulative rebate?



Only issue with that is possible margin call because tester cant see the rebate. That's why I suggested using a bigger account and then wrap the AccountXXX functions with custom ones.


The custom ones should also check the IsTesting() function so the EA can run unchanged live.

 

Thx ydrol, your method works great.


Some preliminary testing looks quite promising. Getting an extra 10-15% return a year when adding the rebate to the account balance each month.

Reason: