This is a trading object shared by a member. You can use this object as well as hundreds of others with QuantShare - Trading Software.
Click on the Like button or on one of the share buttons to share this object and spread the word about QuantShare.
QuantShare is an advanced trading software for stock, forex, futures, ETF and options markets. It is the best and the most complete EOD trading software software and it is FREE (beta version).
Historical trading volatility-based system to adjust trade sizes
Another popular position sizing system, often using in trading, is the one that uses volatility to adjust the number of shares to buy or short for stocks, FOREX currencies, options or futures contracts.
This technique has several variations; each one has its own volatility rule that will be used to determine the size of each trade. The current script analyzes and calculates the volatility of the security you are about to buy/short and update the number of shares according to this volatility. The 10 day standard deviation is used to calculate the volatility.
Here are the different scenarios that can occur during the simulation/backtest of your trading strategy:
First, the ratio of the historical volatility to the current trading volatility is calculated.
- If this ratio is lower than one then buy or short (1 - Ratio) in percentage the amount of the initial trade size
- If this ratio is between one and two then buy or short the amount of the initial trade size multiplied by the ratio (Expressed in Percentage)
- If this ratio is higher or equal to two then buy or short two times the amount of the initial trade size
The initial trade size is calculated by taking the total current equity of your trading system and dividing it by the number of allowed positions or trades.
You can also apply two position sizing systems in backtests. This script will simply modify the size of the positions that were determined by the first position sizing method.
The script currently uses 10 days to calculate the historical trading volatility; you can of course update and optimize this value.