Australian (ASX) Stock Market Forum

Dump it Here

Great posts @Skate . Quick question:- am I correct to assume there are two sell conditions in this system? A) when the stop is triggered; and B) the other being when the close crosses below the 25 period ma of the close?

@MovingAverage in my copy of the "WTT" I have 3 stops

Stops
1. A moving average stop
2. A trailing stop level when the index is ON
3. Another Trailing stop level when the Index is OFF

Radges WTT Strategy - has two stops only
1. A trailing stop when the index is ON
2. Another Trailing stop when the Index is OFF

I'll have a short break & upload the backtests from the original version that I constructed (the "WT Strategy") versus Nick Radge strategy rules & paraments.
1. I'll set the Index Filter lookback period from 20 to 10 weeks
2. I'll change the Index Filter to 40% from 20% (Index Filter ON)
3. Remove my moving average exit
4. Nick's exit strategy uses only the Index Filter

Skate.
 
@MovingAverage in my copy of the "WTT" I have 3 stops

Stops
1. A moving average stop
2. A trailing stop level when the index is ON
3. Another Trailing stop level when the Index is OFF

Radges WTT Strategy - has two stops only
1. A trailing stop when the index is ON
2. Another Trailing stop when the Index is OFF

I'll have a short break & upload the backtests from the original version that I constructed (the "WT Strategy") versus Nick Radge strategy rules & paraments.
1. I'll set the Index Filter lookback period from 20 to 10 weeks
2. I'll change the Index Filter to 40% from 20% (Index Filter ON)
3. Remove my moving average exit
4. Nick's exit strategy uses only the Index Filter

Skate.

Interesting. I assume the idea behind the MA stop is that in some situation it would have a level higher than the stop and would be trigger before the stop is. I guess this would help improve system DD?
 
Very much in agreement - the "Strawbroom" plots for Monte Carlo runs in AB are a particularly valuable too for considering the real range of simulated outcomes. More info, but of course can never be definitive going forward.

View attachment 107354

The objective of the sims should be to move that red line in the straw broom pic as close as possible to the green line. Sometimes I which Amibroker would let you optimize to standard deviation
 
@Skate is this type of scenario the motivation for your additional MA exit?

View attachment 107441

The motivation was to fudge the exit (to align with Radges WTT results)
The Index filter is a Simple Moving Average of an Index whereas the additional exit is from the same train of thought but at an individual position level. The Index could be going gangbusters whereas the individual position might not enjoying the same level. It's a line in the sand & when it's crossed I don't want to be in the position anymore.

FYI
I've supplied a versions of this style of exit to other members but I don't use that exit strategy in any of my systems - it was added to get my version of "WTT" near what was uploaded for a benchmark. It's called fudging the exit.

Skate.
 
apology download.png
Apologies for the corrections
In my enthusiasm to make a post about constructing a strategy, in particular, a "WTT Strategy" it appears the parameters are different to the original. After coding my version of the "WTT Strategy" a few of the parameters & setting fall short of the original. In my defence, I have coded a 20-week breakout strategy - the heart of Nick's WTT. The other setting I was going from memory as it's been a while since reading snippets on the internet.

Here is the differences as brought to my attention
1. My version of the WTT Strategy "Index Filter" uses a lookback period from 20 weeks == The Radge "WTT strategy" uses a 10 week lookback period for the Index Filter
2. My version of the WTT Strategy the "Trailing Stop" is set at 20% when the Index Filter is ON == The Radge "WTT strategy" uses 40% when the Index Filter is ON
3. My version of the WTT Strategy uses a moving average as an additional exit == The Radge "WTT strategy" only uses a "Trailing Stop Exit" driven by the Index Filter.
4. My version of the WTT Strategy uses a "Price Filter of (min $0.05 & Max of $10.00) == The Radge "WTT strategy" uses a (min $1.00 & Max of $10.00)

Question images.jpg

Is there still a discrepancy
Would you please let me know if there are other discrepancies as I won't upload my version of the "WTT Strategy" until the settings have been confirmed again.

Skate.
 
One of @Skate 's posts today got me thinking about the stop loss that is commonly used in the WTT. These stops often result in loosing positions that if exited a few bars earlier would have been a profitable position. The thing that has always bugged me about the WTT is the relatively low win rate--typically 45% to 48%. This afternoon I augmented the stops in my WTT and the first pass simulation looks promising--I was really pushing to get an average win rate of better than 47% with the existing system, but the first pass of the augmented exit has pushed the win rate up to 56% and it has increased the number of consecutive winners to 18. It also appears to have reduced the overall average hold time, which I like. It does appear to have dramatically increased the number of trades. I'm going to run some more sims tomorrow to verify the new exit but if it checks out I'll share details in case anyone would like to incorporate it into their WTT.
NewExit.PNG
 
more coming soon download.png

I have altered the parameters of my "WTT Strategy" to align with the original "WTT Strategy"
The difference in the backtest results are startling, to say the least.

I'll post a backtest of my version of the "WTT Strategy" that I just constructed
I have changed the parameters to align with the original Radge "WTT Strategy"

# 1. Backtest comparison Skate's WTT Strategy & the Radge WTT Strategy (using the Radge parameters)
Backtest Period = 1st January 2019 to end of trade today
Portfolio Size = $100K
Bet Size = $5k
Positions = 20

Radge 2019 to now Capture.JPG




# 2. Backtest comparison Skate's WTT Strategy & the Radge WTT Strategy (using the Radge parameters)
Backtest Period = 1st January 2020 to 30th June 2020
Portfolio Size = $100K
Bet Size = $5k
Positions = 20

Jan 2020 to now Capture.JPG

I'm sure others will backtest to confirm my results
If my backtests differ from someone with the original it would be appreciated to have a genuine backtest uploaded with the parameters below for comparison.

1. #Backtest Period = 1st January 2019 to end of trade today
Portfolio Size = $100K
Bet Size = $5k
Positions = 20

2. #Backtest Period = 1st January 2020 to 30th June 2020
Portfolio Size = $100K
Bet Size = $5k
Positions = 20

Summary
The parameters being different between strategies does not diminish this exercise of how to construct a tradable strategy.

Skate.
 
View attachment 107448
Apologies for the corrections
In my enthusiasm to make a post about constructing a strategy, in particular, a "WTT Strategy" it appears the parameters are different to the original. After coding my version of the "WTT Strategy" a few of the parameters & setting fall short of the original. In my defence, I have coded a 20-week breakout strategy - the heart of Nick's WTT. The other setting I was going from memory as it's been a while since reading snippets on the internet.

Here is the differences as brought to my attention
1. My version of the WTT Strategy "Index Filter" uses a lookback period from 20 weeks == The Radge "WTT strategy" uses a 10 week lookback period for the Index Filter
2. My version of the WTT Strategy the "Trailing Stop" is set at 20% when the Index Filter is ON == The Radge "WTT strategy" uses 40% when the Index Filter is ON
3. My version of the WTT Strategy uses a moving average as an additional exit == The Radge "WTT strategy" only uses a "Trailing Stop Exit" driven by the Index Filter.
4. My version of the WTT Strategy uses a "Price Filter of (min $0.05 & Max of $10.00) == The Radge "WTT strategy" uses a (min $1.00 & Max of $10.00)

View attachment 107449

Is there still a discrepancy
Would you please let me know if there are other discrepancies as I won't upload my version of the "WTT Strategy" until the settings have been confirmed again.

Skate.
Hey Skate,

No discrepancy. The only thing I will say is just make sure in the code, that if the systems index filter is off, and the stop has been moved up to 10% off the most recent high, and the index filter turns back to on again, the stop must stay 10% off that high until the 40% trailing stop catches up again. In other words, stops are never to be moved down when the index filter goes from off to on.
 
Hey Skate,

No discrepancy. The only thing I will say is just make sure in the code, that if the systems index filter is off, and the stop has been moved up to 10% off the most recent high, and the index filter turns back to on again, the stop must stay 10% off that high until the 40% trailing stop catches up again. In other words, stops are never to be moved down when the index filter goes from off to on.

@Cam019 thanks for the help, the results are disappointing - Tomorrow if there is no other input I'll do a comparison with improvements I've made to the strategy. (Skate's Modified Version)

Skate.
 
You're trying to convince me to buy Amibroker and code my discretionary trading plans into systems so that I can make so much more.

Arrgh, it might actually be a good idea, but can this old dog who used to write Fortran and Pascal programmes learn to code Amibroker at the advanced level in a short time?

It may be easier for me to modify entries and exits in already coded systems. I'll mull it over.

Definitely a "yes" :)

Basics of Amibroker AFL can be learned relatively quickly, then the nuances can come with time. So many helpful resources and people here and on AB forums. Price isn't really a problem - very reasonable. If in doubt, go for it.......
 
@Skate , Nick Radge has posted his current positions as at 10 August 2020 on his Twitter feed. As a cross check on coding you could see what positions your WTT coded portfolio held against those in Nick's. I will have a look tomorrow, at first glance I'm thinking my coding is only a 60% MATCH o_O

Here is a link to his post https://t.co/tKhbff8VEX

My testing came within Cooee of the backtest done by @Skate however I probably think mine is about a 40% match compare to what Nick posted. In saying that Nick did comment that it was his Personal Weekend Trend Trader strategy so he will have some tweaks in there from the original strategy I would suspect.
 
Cranked up the old Kindle last night and noted that there is a Minimum Turnover condition of $500,000 average for 7 days and a Minimum Volume condition of $500,000 average for 7 days.

Also interesting to note that the Universe was the Russell 3000.

Cheers,
Rob
 
WTT Final images.jpg

The WTT Strategy is a 20-week breakout strategy
I had planned to keep posting more about the "WTT Strategy" but trying to duplicate another persons strategy is next to impossible. I coded my version of the "WTT Strategy" as a simple exercise in constructing a strategy. The simple 12 step procedure might be helpful to some.

Uploads
The idea was to upload the constructed version of the "WTT Strategy" then show how a few simple modifications (parameters & settings) can improve the strategy performance. Posting 2 or 3 different codes would be confusing so I'll upload my modified version of the "WTT Strategy" & let others backtest the strategy for evaluation.

Human readable WTT code
The code below is the (AFL) Amibroker "WTT Strategy" code for those who don't own the Amibroker program. I have made comments on each line for a better understanding of what the line of code is hoping to achieve.

/********************************************
Skate's WTT Weekly Modified Strategy for ASF Members
Created by: Skate - Last revision 12th August 2020
*********************************************/


_SECTION_BEGIN( "# Skate's WTT Modified Exploration" );
//=================================================================================
//1. The "SetOptions" are management options & they are a feature of Amibroker
//=================================================================================
TradingFunds = Param( "Trading Funds - $", 5000, 1000, 10000000, 1000 ); // User-definable parameter, accessible via Exploration parameters - changes are reflected immediately. (Default $5k bets) - INSERT any amount
SetOption( "InitialEquity", 100000 ); // $100k Inital Equity (allows for 20 X $5k bets)
SetOption( "PriceBoundChecking", 1 ); // True: Adjust prices so that they fall within the High-Low range
SetOption( "CommissionMode", 2 ); // Use $ amount
SetOption( "CommissionAmount", 19.95 ); // CommSec commission rate
SetOption( "UsePrevBarEquityForPosSizing", 1 ); // True: Use previous bar closing equity to perform position sizing
SetOption( "AllowSameBarExit", False ); // False: Trade is exited & we move to next bar ignoring other signals
SetForeign( "$XAO.au", True , True ); // I've used the new Norgate Updater (NDU) format - change if the format is different to your data supplier
RestorePriceArrays( True ); // Restores original price and volume arrays after the call to SetForeign.
SetTradeDelays( 1, 1, 1, 1 ); // Trade delays, the delay is required for backtesting

//=================================================================================
//2. The "Index Filter" - decides when we will trade & also our trailing stop levels
//=================================================================================
MAfilter = MA( C, 10 ); // 10 week lookback period
IndexBuyFilter = C > MAfilter; // Index Filter = ON: When the close is greater than the 10 week simple moving average the Index Filter is ON [trailing stop set to 20%] + [buy + sell signals generated]
IndexSellFilter = C < MAfilter; // Index Filter = OFF: When the close is less than the 10 week simple moving average the Index Filter is OFF [shortens trailing stop to 10%] + [only sell signals generated]

//=================================================================================
//3. Add all our other filters
//=================================================================================
Liq = C * V; // Liquidity Filter
CV = 500000; // Volume Filter
Liqfactor = Liq > CV; // Liquidity Filter
ROCFilter = ROC( C, 20 ) > 30; // Rate Of Change (ROC) Momentum filter
ROCParameter = Param( "ROC Parameter", 8, 0, 52, 1 ); // 8 week Rate of Change period
MOMFilter = ( ROC( C, 10 ) >= ROCParameter ); // Momentum filter - the closing price of the last 10 weeks is greater than the last 8 weeks
NoStrength = Close < MA( Close, 12 ); // If the closing price is less then the Simple Moving Average of the last 12 weeks it's considered there is no strength in the move

//=================================================================================
//4. Add a Buy condition
//=================================================================================
WTTBP = Param( "Breakout Period", 10, 1, 1000, 1 ); // 10 week Lookback period

Cond1 = C > Ref( HHV( C, WTTBP ), -1 ); // Buy when the closing price is greater than the highest High Value of the last 10 weeks
Cond2 = IndexBuyFilter; // Buy ONLY when the Index Filter is ON
cond3 = C >= 0.05; // Buy only if the closing price is greater $0.05 (5 cents)
cond4 = C <= 10; // Buy only if the closing price is less than $10.00
cond5 = liqfactor; // Buy only when the Liquidity filter is TRUE
cond6 = ROCFilter AND MOMFilter; // Buy only when the Rate of Change filter & Momentum filter is TRUE

Buy = cond1
AND cond2
AND cond3
AND cond4
AND cond5
AND cond6;

//=================================================================================
//5. Add a sell condition
//=================================================================================
Sell = C < MA( C, 50 ) AND NoStrength; // Sell when the close is less than the moving average of the last 50 weeks with the closing price is less than the Simple Moving Average of the last 12 weeks

//=================================================================================
//6. Add a two-stage trailing stop
//=================================================================================
ts1 = 20;
ts2 = 10;
ts = IIf( Indexbuyfilter , ts1 , ts2 );

ApplyStop( stopTypeTrailing , stopModePercent , ts , exitatstop = 2 ); // Apply Stop = [ts] Trailing Stop [exitatstop = 2] means check High-Low prices but exit NEXT BAR on regular trade price.

//=================================================================================
//7. Add "Position Sizing"
//=================================================================================
BuyPrice = Open; // Buy the next day at open
SellPrice = Open; // Sell the next day at open

Buy = ExRem( Buy, Sell ); // Removes additional buy signals
Sell = ExRem( Sell, Buy ); // Removes additional sell signals

PosQty = 20; // Position Quantity = Maximum 20 positions
PositionSize = -100 / posqty; // 100% of the equity divided by the Position Size
SetOption( "MaxOpenPositions", PosQty ); // Maximum number of open position

//=================================================================================
//8. Add "Filters for the Exploration Analysis"
//=================================================================================
Filter = Buy OR Sell; // Buy & Sell Filters

//=================================================================================
//9. Add Buy & Sell coding for use in trading the pre-auction
//=================================================================================
BuyOffered = Close * 1.03; // +3% Buy premium over the last closing price
BuyOffer = ceil( BuyOffered * 100 ) / 100; // The amount is rounded up no matter the price (ceil function used)

SellOffered = Close * 0.97; // -3% Sell premium below the last closing price
SellOffer = floor( SellOffered * 100 ) / 100; // The amount is rounded down no matter the price (floor function used)

//=================================================================================
//10. Add the Exploration code
//=================================================================================
ToBuyPosSize = floor( TradingFunds / BuyOffer ); // Trading Funds divided by buy offer of (+3%) buy premium over the last closing price
ToBuyPosCost = BuyOffer * ToBuyPosSize; // The cost of buying the amount of share

PositionScorer = 100 - Close; // Lowest priced security at BuySetup trigger is taken first
PositionScore = Ref( PositionScorer, -1 ); // Previous bar (-1 bar)

//=================================================================================
//11. Add columns to report & sort the Exploration Analysis results
//=================================================================================
AddColumn( IIf( Buy, ToBuyPosSize, Null ), "# shares", 1, colorWhite, colorDarkGreen, 90 ); // Exploration Analysis - this column displays quantity of shares to buy
AddColumn( IIf( Buy, BuyOffer, Null ), "$ Buy Offer", 1.2, colorWhite, colorDarkGreen, 110 ); // Exploration Analysis - this column displays pre-auction buy offer price (+3% premium added to the last closing price)
AddColumn( IIf( Buy, ToBuyPosCost, Null ), "$ Cost", 1.2, colorWhite, colorDarkGreen, 80 ); // Exploration Analysis - this column displays the total ($) you will pay for the qty of shares at the +3% primum
AddColumn( IIf( Sell, SellOffer, Null ), "$ Sell Offer", 1.2, colorWhite, colorRed, 110 ); // Exploration Analysis - this column displays pre-auction sell offer price (-3% discount to the last closing price)
SetSortColumns( 2, -3, -4, -5, -6, 1 ); // Sort the columns in correct order
_SECTION_END();

//=================================================================================
//12. Add code to the chart & plots the signals. Also adding an Index Ribbon
//=================================================================================
_SECTION_BEGIN( "Price" );

SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) ); // Chart settings

Plot( C, "Close", ParamColor( "Color", colorBlack ),
ParamStyle( "Style", styleNoTitle | styleBar, maskAll ) ); // User-definable parameter, accessible via Chart parameters - changes are reflected immediatelly. (Bar Chart Default)

PlotShapes( Buy*shapehollowUpArrow, colorWhite, 0, Low, -20 ); // Displays Buy up arrow on the signal bar
PlotShapes( ( Sell > 0 ) * shapeDownArrow, Coloryellow, 0, High, -40 ); // Displays Sell down arrow on the signal bar
PlotShapes( Ref( Buy, -1 ) * shapeHollowSquare, colorWhite, 0, O, 0, 0 ); // Displays a white square on the buy bar
PlotShapes( Ref( Sell, -1 ) * shapeHollowCircle, colorYellow, 0, O, 0, 0 ); // Displays a yellow circle on the sell bar

Indexfilter = IIf( IndexBuyfilter, True, False ); // If Index Filter is TRUE (ON), or If Index Filter is FALSE (OFF),
RibbonColor = IIf( Indexfilter, colorGreen, colorRed ); // If Index Filter is TRUE (ON) the ribbon is GREEN, or If Index Filter is FALSE (OFF) the ribbon is Red
Plot( 1, "", RibbonColor, styleArea | styleOwnScale | styleNoLabel, -0.0001, 190 ); // Plots Index Filter Ribbon [green = ON] [Red = OFF]

for( i = 1; i < BarCount; i++ )
{
if( Buy[i - 1] ) PlotText( "Buy\n@ " + O, i, L * 0.9, colorWhite ); // Displays white buy price (opening price) under the white box (buy bar)

if( sell[i - 1] ) PlotText( "Sell\n@ " + o[ i ], i, H[ i ] * 1.1, colorYellow ); // Displays yellow sell price (opening price) above the yellow circle (sell bar)

}
_SECTION_END();


Skate.
 

Attachments

  • Skate's Modified WTT Weekly Strategy.afl
    11.8 KB · Views: 153
@Skate, thanks for all your work in this exercise. I am sure all members are appreciative of your time and expertise. I know that there are many aspects of these posts that I can take away and hopefully implement in improving systems that I am looking at.

As to your WTT I have run a series of backtests to see particular statistics over different time frames. Hopefully they will be of interest

Untitled.png
 

Attachments

  • Untitled.png
    Untitled.png
    43.6 KB · Views: 29
@Skate, thanks for all your work in this exercise. I am sure all members are appreciative of your time and expertise. I know that there are many aspects of these posts that I can take away and hopefully implement in improving systems that I am looking at. As to your WTT I have run a series of backtests to see particular statistics over different time frames. Hopefully they will be of interest
View attachment 107477

Hopefully they will be of interest
@CNHTractor they are of interest to me - thank you for uploading the backtest results, it's a real eye-opener.

For a very simple strategy
The idea behind a 20-period Breakout Strategy is not new & utilising a bare-bone code the stats look robust over a variety of periods.

What's most pleasing
My version of the WTT Strategy "handled" the COVID-19 Flash Crash without too much pain.

Skate.
 
Top