just8
- ago
Searched the forum but only two hits for "liquid".

Many of my strategies take unrealistic position sizes in illiquid stocks. What is the best practise for dealing with this in backtesting?

I found preferences->backtest->Other Settings->Volume % limit.

Or should I set a condition like follows?:

0
577
Solved
4 Replies

Reply

Bookmark

Sort
Glitch8
 ( 7.90% )
- ago
#1
The Volume Percent Preference that you discovered was designed for this purpose.
0
Best Answer
- ago
#2
Is that the only way one can manage testing regarding low liquidity? Is there a dollar limit one can use? EG: the stock must have a dollar turnover of X amount in the last 4 weeks.
0
- ago
#3
There is the AvgTurnover indicator (part of finantic.Indicators extension).
It returns Volume*Close smoothed by an moving average.

In his latest book "Trading Retirement Acounts" L. Bensdorp even uses
QUOTE:
"Trade only stocks that are currently in the top 25 percent of the highest average [dollar] volume over the last twenty days"


Such an idea can be implemented with the "Portfolio Percentile Rank" indicator (PFPR), also available form the finnatic.Indicators extension:

CODE:
// average dollar volume of last 20 days avgVol2 = new AvgTurnover(bars, 20);           // rank of average dollar volume string dataSetName = this.Backtester.Strategy.DataSetName; int startYear = this.Backtester.Strategy.DataRange.StartDate.Year;          avgVolRank2 = new PFPR(bars, dataSetName, startYear, avgVol2);


Here is how you use this rank indicator in the Execute method:
CODE:
// Top 25% of average volume if(avgVolRank2.Values[idx] < 75.0)) return;

1
- ago
#4
Another idea:
Tha main purpose of a liquidity filter is avoidance of trade signals for stocks that have not enough liquidity to ensure a good fill.

This is usually done by smoothing the volume series or the turnover series and making sure that the smoothed values are above a certain threshold.

By observing closer it is important that volume/turnover on quiet days is high enough and some days with exceptionally high volume should not disturb the result.

A good tool to get there is the ASEMA indicator, an asymmetric moving average that allows to put higher weight on the quiet days and less weight on high volume days:

CODE:
IndicatorBase asema = new ASEMA(bars.Volume, 20, 5);




(ASEMA is part of the finantic.Indicators extension)
0

Reply

Bookmark

Sort