AFL Strategy Description:
EOD data portfolio-level backtest with user-specified daily, weekly, monthly, or n months rebalance.
There is a universe of approximately 100 symbols.
There are up to 10 user-defined sectors.
The user begins by defining sectors and assigning each symbol in the universe to a sector. Sector assignments are persistent between tests.
The user specifies a sector allocation as a percentage of the total portfolio $ (e.g., sector 1 = 10% target allocation; sector 2 = 12%).
The user also defines a maximum number of positions for each sector (e.g., sector 1 maxPositions = 3; sector 2 maxPositions = 4).
The user defines a simple binary permission screen (e.g. if symbol > 200d SMA, permission = true). This allows a symbol to be bought or held. When false, a position is to be sold
The user defines a simple price strength indicator (e.g., strength = 30d price change + 90 day price change + 180 day price change).
At the rebalance period, (specified in the setup above), the strategy:
- Calculates the binary permission screen for each symbol
- Calculates the strength indicator for each symbol
- For each sector, calculates the dollars allocated to it. Sector $ = total portfolio $ * sector allocation % (sector allocation % defined above)
- For each position, size of the position $ = Sector $ / maxPositions
- For each sector, rebalances by selecting the top maxPosition symbols by strength rank order AND binary permission screen.
- If a top strength-ranked symbol DOES NOT have permission screen, pass down the rank list to the next highest strength score. If there is less than maxPositions symbols which pass the permission screen in the sectors, hold the remainder of positions as cash
- Buy and sell according to this policy on the NEXT open, high, low or close (user specified)
Đã trao cho:
Hi! I am proffesionall programmer for Metatrader,TradeStation, Multicharts, Amibroker API, InteractiveBrokers API, C++, VB for more than 10 years. Best regards, Alexander