Hi,

I'm writing a backtest AFL that does SpreadBetting on the FOREX.

The spreadbet company deducts (or adds to - depending on the security
and interest rate) money at the end of each day from your account for
each day the trade rolls over to the next day.

How do I do this in AFL? - I need the following:

1. After each trade has concluded (ie. sold if long), I multiply the
number of days between the buy and sell bars by a value - say X.

(Please note - it is important to make sure the number of bars
between buy and sell are counted in days and not mins or hrs - as I
may be running this AFL on intraday data also).

2. I then deduct X from the current equity value after each trade.

It is important to ensure Step 2 occurs immediately after each trade
has concluded, as gains/loses from my overall equity will affect
position sizing on future trades.

Most grateful!
Alex

Reply via email to