Australian (ASX) Stock Market Forum

Dump it Here


My HappyCat is at +4.4%. Not a bad return! Obviously this strong upturn can't last and we will all lose some of these profits. Still interesting to see 2 lost positions compared to yours results in such large differences. But even if I had chased price, I would have just bought at a higher price and still without the profit margin you have (never chase). I hope other live followers are enjoying the returns as well!
 
I'm sure everyone is rolling in it this week.

FYI
This month has been my best month on record & there is one more week to go (So-Far-So-Good)

Skate.

Must be satisfying!

I've been estatic to see my profits go up. I am quickly reminded that any such good run will come to an end and as trend traders we will give up part of the profits while we let it run. But until then, enjoy the ride.
 
Thanks for sharing this project on "pocket pivots". I was interested in how you were going to code the pocket pivot (PP) The PP seems to be a better entry into a trend than the regular break-out of horizontal resistance. The main benefit is the smaller initial risk when compared to the standard BO-HR. Smaller initial risk allows for larger size winners.

Have you ever wondered why some strategies perform better than others?
Most trend traders are having a field day at the moment because the price is being pushed higher. More traders are entering back into the markets with the "fear of missing out". Institutional investors are prepared to take on more risk at this stage pushing prices higher as well.

A Strategy going gangbuster at the moment (The Pocket Pivot Strategy)
Peter has eluded "that there are many different buy points" that meet the definition of a pocket pivot & some perform better than others. While researching "Pocket Pivots" it was soon apparent that there are multiple ways to calculate it. I was curious to find which calculation worked better (better is very subjective) & frankly the methods used to establish a "Pocket Pivot" is just pushing around the edges, meaning the outcome didn't really change that much. The idea behind a pocket pivot is buying in-the-pocket. "Buying in the pocket" is easier said than done & difficult to code. Adding a strength indicator sharpens entries, thereby reducing false signals. In simple terms, a "Pocket Pivot" is a price/volume pattern that reveals larger moves.

Pocket Pivots are featured in the book - "Trade Like an O'Neil Disciple: How We Made Over 18,000% in the Stock Market"
Many times in the book they refer to a base formation & strength of the position within a consolidation period. I've found it very hard to code all the parameters explained in the book - it's near impossible with so many variables. Having a feel for the markets is not a parameter that can be coded & this "feel" is the very reason O'Neil was a freak trader.

How my "Pocket Pivot Strategy" backtested over two time periods
I have included the first backtest period between "1st January to 20th November 2020" if others were wondering if the strategy could cope with the COVID-19 flash crash. The second backtest period is from "1st July 2020 to 20th November 2020" that clearly shows the "Pocket Pivot Strategy" performs well in trending markets. I've made posts about "Pocket Pivot" previously saving me time to explain it all over again - search for my previous posts if interested.

Disclaimer
I didn't trade the "Pocket Pivot Strategy" between 1st January to 30th June 2020 - if others were wondering.

PP Backtest Combined 2020 Capture.jpg

Summary
For those looking for an edge - revisiting "Pocket Pivots" might go some way to achieve it.

Skate.
 
Impressive numbers Skate. The programming up of O'Neill pivot points is definitely trcky with subjective definitiions required.

Presumably your design decisions here were primarly around the entry "squeeze and pop" out of the pivot (entry), then the "other legs of the table" include qualifying entry parameters (including position scoring), position sizing, and volatility trailing exit logic?
 
Didn't write that well - when you're playing with other strategy ideas, do you usually just change the entry and migrate over most of your existing Position Scoring and Exit code, or find you need to heavily modify all of it?

(Rarely do I play with other ideas and end up with such promising numbers!)
 
Didn't write that well - when you're playing with other strategy ideas, do you usually just change the entry and migrate over most of your existing Position Scoring and Exit code, or find you need to heavily modify all of it? (Rarely do I play with other ideas and end up with such promising numbers!)

@Newt I've found each new strategy needs to be written separately, basically from the ground up. Parameters & settings have to be optimised as well. When it comes to "PositionScore" any trend following rating will do. Over the years I've found just dropping new entry conditions into a template never seems to works out, well not for me at least (been there done that). In saying this - using a strength indicator sorts the wheat from the chaff.

The "exit strategy"
The "Pocket Pivot Strategy" is unique as it has three exits. (1) a dedicated Pivot Exit (2) a Volatility Exit & (3) a two-stage Trailing Stop.

A momentum exit is not suited at all
In the book - "Trade Like an O'Neil Disciple: How We Made Over 18,000% in the Stock Market" they use a "Take Profit" exit - AFAIC, a Take Profit exit certainly didn't work for me. Using a momentum exit stifles performance & not suggested.

What I can tell you
The "Pocket Pivot Strategy" loves to have free rein as the "Pocket Pivot " code does all the work. Whether you trade the "Pocket Pivot Strategy" using a "Weekly or Daily" periodicity really doesn't matter - surprisingly the results are very similar. I should also point out the parameter settings are slightly different between the periodicity selected (as you would have guessed). My preference is to trade the strategy as a weekly system. Also, as a hint, don't overuse filters as my research has found the "Pocket Povit Strategy" doesn't like to be restrained & certainly hates being curtailed by an Index Filter.

The reason for my post today?
At times I like to nudge others so they don't forget about some of the strategies I have written about previously. I try to post about strategies or ideas that have the potential to make money, pure & simple.

Skate.
 
So my question is for the mechanical chaps:

Here we have your current market:

Screen Shot 2020-11-23 at 6.42.18 AM.png

Your seasonality:

Screen Shot 2020-11-23 at 6.43.28 AM.png

And a longer term chart of your market:

Screen Shot 2020-11-23 at 6.49.33 AM.png

An example of one of Mr Skate's systems:

Screen Shot 2020-11-23 at 6.40.37 AM.png

So my question:

You have a back test of period X (let's say 2016 - current). Your system is profitable on backtesting. Do you then back test discrete periods: say Dec. 2017 to March 2018, then Dec. 2017 to Jan. 2018, Jan 2018 to March 2018, etc, to find the change in within the aggregate? The purpose being to identify when your system is indicating a deviation away from the expected average of periods? If not why not?

Your market as against the US

Screen Shot 2020-11-23 at 7.03.10 AM.png

Have you chaps tested whether US breakdowns correlate to your market: prima facie, it looks to be the case.

Intra-day, Friday, your market:

Screen Shot 2020-11-23 at 6.45.41 AM.png

Implications for today?


jog on
duc
 
So my question is for the mechanical chaps:

Here we have your current market:

View attachment 115041

Your seasonality:

View attachment 115042

And a longer term chart of your market:

View attachment 115044

An example of one of Mr Skate's systems:

View attachment 115040

So my question:

You have a back test of period X (let's say 2016 - current). Your system is profitable on backtesting. Do you then back test discrete periods: say Dec. 2017 to March 2018, then Dec. 2017 to Jan. 2018, Jan 2018 to March 2018, etc, to find the change in within the aggregate? The purpose being to identify when your system is indicating a deviation away from the expected average of periods? If not why not?

Your market as against the US

View attachment 115045

Have you chaps tested whether US breakdowns correlate to your market: prima facie, it looks to be the case.

Intra-day, Friday, your market:

View attachment 115043

Implications for today?


jog on
duc
For what it is worth and from a forever apprentice and not a Master,
what I do:
part one:
seasonality: no, not taken into account at all
But discrete check: definitively;
I do not apply a mathematical formula for a period definition but I created scripts to backtest on a set of finite periods
And these are expected to cover recent events and various market moves:
Recent only as in my opinion, while history does kind of repeat, backtesting on markets more than 10y old is useless: apples and orange;
I mechanically test against different annual starts:
01/01 2010 to now
then 01/01/2011 to now
then etc;
I also test on the last 10 calendar years 01/01 to 31/12 of each year
This is the basic dumb stuff
then a set of manually chosen periods including crash, boom , slow or so so markets on short or long periods:

2/07/2010..29/06/2012
7/01/2011..30/12/2011
7/01/2005..15/11/2019
3/01/2014..27/12/2019
3/01/2014..28/02/2020
6/07/2018..28/12/2018
5/07/2019..27/12/2019
5/01/2018..28/12/2018
4/01/2019..27/12/2019
3/01/2020..9/04/2020
3/03/2017..28/02/2020
1/03/2019..21/02/2020
9/08/2019..20/03/2020
I found this very interesting when comparing results and in my opinion a must have.
Just a press of a button and AB spew up the reports that I can then compare between systems or after a small change..then up to me for final choice.
That assumes backtests are representative of actual trades which they do ...
until i hit issues like my ZL laggard being at 10X worse than backtest of same period, but this definitively means an error somewhere in my code.
note: The ZL extra is being sold and closed today until I can analyse the issue, if a system was not able to win last week, it never will....
 
important note: based on how long it takes for your system to get fully invested, some may ramp up on 3 to 6 months, it is important to either extend the minimal period, and ensure a ramp-up period to properly analyse behaviour:
no point starting on 01/02/2019 to check crash behaviour if your system is still 90% cash when the crash hits..common sense.
 
So my question: You have a back test of period X (let's say 2016 - current). Your system is profitable on backtesting. Do you then back test discrete periods: say Dec. 2017 to March 2018, then Dec. 2017 to Jan. 2018, Jan 2018 to March 2018, etc, to find the change in within the aggregate? The purpose being to identify when your system is indicating a deviation away from the expected average of periods? If not why not?

@ducati916 you have raised some interesting points. Let me give you an overview of what I used back in my strategy development days. There are many ways of developing a system that eventually gives you the confidence to trade a particular strategy. Confidence is the keyword as no matter how fastidious you are in the development phase, nothing is certain trading it.

Back in the old days
I'm referring to (2013) my early days when I was trying to figure all this stuff out, I stumbled on the ability to "Backtest" my ideas. The more you learn - the more you understand the importance of having statistical data to compare results. I soon realised I could use that same data & run a "Monte Carlo Simulations". Monte Carlo Simulations adds randomness to the strategy by running several thousand simulations using different data points to compute the average of the results.

Microsoft Excel
Originally, I used Microsoft Excel to visualise this data from the Monte Carlo Simulations creating a histogram showing the minimum & maximum return. With that same data, I was able to create a "scatter plot" to show the average annual returns versus the maximum drawdowns. But from AmiBroker version 5.94 onwards, a Monte Carlo simulator is built-in to the backtest, saving you all this extra work.

The general idea behind Monte Carlo analysis
Monte Carlo Analysis is a process of validating the robustness of the Trading Strategy by performing multiple trial runs using a combination of positions from your trading system (backtested data). It's worthy to note "seasonality" automatically becomes part of the equation. You can use these statistics to analyse the characteristics of your trading system - simulating a set of Equity curves using random numbers from the backtest data. These large sets of simulations are then used to find the likely probability of unseen risks in your trading the strategy. The Monte Carlo Simulations "out-of-sample" (OOS) results are the true measure of the strategy. Why? because the strategy has been developed using "in-sample" data & is already known.

More to come...

Skate.
 
Monte Carlo Simulation
This process allows you to randomly select any number of Monte Carlo runs. I run either 100 or 1,000 runs all depending on how quickly I want to view the results. The more runs the more reflective the results will be. I prefer to use 1,000 runs which means a 1,000 different trades from the original trade list. 1,000 runs are used to produce new random trades thus it's unlikely to pick the original "PostionScored" trades.

1,000 runs will give a random perspective of the robustness of your strategy
Understanding the robustness of your trading system helps identify any problem with your trading strategy. It's worthy to understand "Monte Carlo" analysis will not solve any problems. To put it in simple terms "Monte Carlo Simulation" is just a validation process - a tool to help you create a better trading system.

Interpreting the results
The results of the Monte Carlo simulations are displayed in the "Monte Carlo" tab of the Backtest report. At the top of the backtest results, the Monte Carlo tab displays a table that gives values of a few key statistics derived from the cumulative distribution charts.

Here are the results from my actual trading strategies
I have highlighted the areas of importance - at a quick glance, it tells me the story I want to know in a heartbeat. The two have been uploaded for you to compare. I should say in advance both are profitable strategies.

Monte Carlo Capture.JPG

What does the chart mean?
The first column shows the percentile level. The values along the line is designated by the heading that is easy to read & understand. Scan your eyes to the 10th percentile of the LH chart (Pocket Povit results) - this tells us that 10% of the time the annual profit would equal (+25.32%) or lower. So we can say that there is about a 10% chance that our system would make money. The RH chart (the KingFisher Strategy) - this tells us that 10% of the time the annual profit would equal to or less than (-8.2%) drawdown. It is important to note that the table above is generated using the analysis settings (Monte Carlo) tab with - "Use negative numbers for drawdown" turned on.

Turning on "Use negative numbers for Drawdown" option
Means, all drawdown numbers will become negative making more sense that is easier to relate to.

Tab Capture.JPG

1% percentile
Moreover, the 1% percentile value of the "Pocket Povit" Strategy Maximum Drawdown is (-19.16%) - This percentile tells you that in 1% of cases you would experience drawdowns equal or worse (more negative) than (-19.16%) whereas the "KingFisher" Strategy Maximum Drawdown is (-28.59%) - This percentile tells you that in 1% of cases you could experience drawdowns worse than (-28.59%) directly comparing the level of risk being taken on. The "1% percentile value" of (-19.16% & -28.59%) respectively tells you that in 1% of cases you would experience drawdowns more negative than those listed. When comparing the two strategies the 10% percentile & below are "pessimistic" scenarios & hardly the norm so don't get too hung up on those results listed above (but they are handy to know).

99% percentile
The 99% percentile row shows that the drawdowns could be worse than the specified amount, 99% percentile value of (-2.92% & -3.70%) respectively means that in 99% of cases you will see drawdowns worse than (-2.92% & -3.70%) respectively. The table above is read "row-wise" & (small percentiles) refer to "pessimistic" scenarios or the worst case to put it into perspective.
The purpose being to identify when your system is indicating a deviation away from the expected average of periods? If not why not?
Tools at our disposal
This is a long-winded way of assuring @ducati916 that systemic traders have the tools to do the "what-if" & "worst-case" scenarios - having a full understanding of the risk involved trading each strategy. I'm unable to speak for others but I certainly make the best use of these tools.

Skate.
 
1,000 runs are used to produce new random trades thus it's unlikely to pick the original "PostionScored" trades.
The Amibroker monte carlo process does not use any trades that were not included in the "PositionScored" backtest.
The process randomly picks trades from the original backtest trade list to produce a new random set of trades. This new random set contains the same number of trades, they are ordered randomly and some original trades may be skipped and some used more than once.
Refer to the Amibroker documentation https://www.amibroker.com/guide/h_montecarlo.html
 
The Amibroker monte carlo process does not use any trades that were not included in the "PositionScored" backtest.
The process randomly picks trades from the original backtest trade list to produce a new random set of trades. This new random set contains the same number of trades, they are ordered randomly and some original trades may be skipped and some used more than once.
Refer to the Amibroker documentation https://www.amibroker.com/guide/h_montecarlo.html

@elbee contributions to the "Dump it here" from long term members are always appreciated & warmly welcomed.

Skate.
 
The Amibroker monte carlo process does not use any trades that were not included in the "PositionScored" backtest.
The process randomly picks trades from the original backtest trade list to produce a new random set of trades. This new random set contains the same number of trades, they are ordered randomly and some original trades may be skipped and some used more than once.
Refer to the Amibroker documentation https://www.amibroker.com/guide/h_montecarlo.html

I have found making the "PositionScore" random you no longer have a set trade list, and it does indeed become more random. It essentially removes your position score as a source of Alpha from the strategy.

Can be useful to determine whether your entry and exit conditions are robust vs the PositionScore filtering.



How about Monte Carlo randomization instead of bootstrap test?

The Monte Carlo randomization is different than bootstrap test because it does not use actual (realized) trade list from the backtest but it attempts to use "all individual returns whenever they are realized or hyphotetical". For example when trading system is generating way more signals than we can actually trade due to limited buying power, then we have to choose which trades we would take and which we would skip. Normally this selection is a part of trading system and in AmiBroker PositionScore variable tells the backtester which positions are preferred and should be traded. In randomization test, instead of using some analytic/deterministic PositionScore, you use random one. If there are more signals to open positions than we could take, this process would lead to randomized trade picks. Now using Optimize() function and random PositionScore we can run thousands of such random picks to produce Monte Carlo randomization test:

step = Optimize( "step", 1, 1, 1000, 1 ); // 1000 backtests
// with random trade picks from the broad universe (make sure you run it on large watch lists)
PositionScore = mtRandom();

Randomization test has one big disadvantage: can not be used in many cases. When system does not produce enough signals each bar there is not much (if any) to choose from. Also, more importantly, MC randomization makes false assumption that all "trading opportunities" (signals) are equal. In many cases they are not. Pretty often our trading system has specific, deterministic way to pick trades from many oppotunities by some sort of ranking/scoring. When system is using a score (rank) as a core component of the system (rotational systems do that) - if you replace analytic score of with random number you are just testing white noise not the system.
 
View attachment 114677

Adding - Volatility Upper & Lower Bands
Using the upper band & incorporating volatility as an additional entry condition has the benefit of lowering stock turns & reducing false entries. The lower band assists in holding better trades a little longer. My "time delay - momentum exit" has been eliminated. Using the upper & lower band as confirmation of volatility at the individual level has pleasing results when applied to the CAM Strategy, worthy for others to investigate as I have. Using volatility bands for entry & exits is impressive.
..
Skate.


Some gold here and I hope more people were paying attention to this along with @ducati916 often referencing a noticeable relationship between the ASX and the VIX.

On my system there's a significant difference in testing on a modified WTT system when using the VIX as part of the index filter.

Stasis.
 
Top