Australian (ASX) Stock Market Forum

Dump it Here

Skate's 260 Period Weekly Breakout Strategy

Hi Skate, thanks for posting the 260 Period Weekly Breakout Strategy.

Learning a lot from you and your system uploads - thanks. Upload both if possible please

I very much agree with @martyjames - there is a tremendous amount of learning that I am getting from your posted codes.

I have been using Amibroker for a bit of time but had become lazy running strategies that were derivatives of themselves, working "ok" until the "Black Swan" arrived. Your examples are opening my eyes to code structures. I particularly love how you have been able to put buy and sell prices on your chart - very neat!
 
BBO.jpg
Bollinger Band Background

Bollinger Bands are a technical indicator developed by John Bollinger. The indicator forms a channel around the price movement. The channels are based on standard deviations & a moving average. Bollinger bands can help you establish a trend's direction, spot potential reversals & importantly monitor volatility. All of this can help you make better trading decisions if you follow a few simple guidelines.

Bollinger Band Basics
Bollinger bands have three lines, an upper, middle & lower. The middle line is a moving average of prices. The parameters of the moving average are chosen by the Amibroker coder. There is "no magic moving average number", so it's important that the moving average (the middle line) aligns with the techniques & strategy being traded. The upper and lower bands are drawn on either side of the moving average. The distance between the upper and lower band is determined by standard deviations.

The differences between the strategies
1. Urban's Daily Bollinger Band Breakout Strategy = Bollinger Band "180 days Moving Average" of the (closing price) with (3.5) upper deviations & (0.5) lower deviations from the moving average
2. Skate's Bollinger Bands Weekly Strategy = Bollinger Band "100 weeks of Moving Average" of the ("HIGH price") with (2) upper deviations & (1) lower deviations from the moving average [PLUS] I use an additional condition.

An additional indicator
By using the (HIGH price) of the Highest High Value of the last 100 weeks add another indicator & "IMHO" validity to the signals. John Bollinger recommends using two or three other un-correlated indicators, instead of using the Bollinger Bands as a stand-alone trading system.

Skate.
 
Last edited:
LOGO - Amibroker Logo.jpg
An extract from Urban Jaekle's book (Trading Systems 2nd Edition)
"Every day, there are traders who make a fortune. It may seem that it seldom happens, but it does – as William Eckhardt, Ed Seykota, Jim Simons, and many others remind us. You can join them by using systems to manage your trading. This book explains how you can build a winning trading system. It is an insight into what a trader should know and do in order to achieve success in the markets, and it will show you why you don't need to be a rocket scientist to become successful. It shows how to adapt existing codes to the current market conditions, how to build a portfolio, and how to know when the moment has come to stop one system and use another one"

Urban's Daily Bollinger Band Daily Breakout Strategy
When I read comments from Urban Jaekle's book (Trading Systems 2nd Edition) I was doing cartwheels with excitement & couldn't wait to test Urban's Bollinger Bands Strategy using his methodology. Urban's Daily Bollinger Band Breakout Strategy is rather disappointing (but still has educational value) & is uploaded "as is". I've used the same format as my previous uploads for consistency with comments. It should be noted that the Bollinger band code supplied on his website is basic without being a trading strategy.

Bollinger Bands Weekly Breakout Strategy
Skate's version of a Bollinger Bands Weekly strategy will be uploaded after Urban's Daily Bollinger Band Daily Breakout Strategy has been digested.

Disclaimer
In my opinion Urban's Daily Bollinger Band Breakout Strategy shouldn't be traded - not even with "counterfeit money"

Skate.
 

Attachments

  • Urban's Bollinger Band Daily Breakout Strategy v1.afl
    7.7 KB · Views: 24
  • Urban's Bollinger Bands Daily Breakout Strategy v1.apx
    15.4 KB · Views: 14
Last edited:
LOGO - Amibroker Logo.jpg
Bollinger Band Breakout Strategy
Both strategies use the same money management settings but trade a different periodicity.
Portfolio Capital: $20,000 ($20k Initial Equity: User-definable parameter, accessible via "Exploration Parameter Settings" - changes are reflected immediately)
Positions in the Portfolio: 20
Variable Position Sizing: $1,000 (User-definable parameter, accessible via "Exploration Parameter Settings" - changes are reflected immediately)

Note
Variable Position Sizing allows for rebalancing & is included as an Exploration Parameter Settings for those wishing to use larger position sizing.

Exploration Analysis
The Exploration Analysis is used to generate the Buy & Sell Signals

The Exploration Analysis displays the pre-auction trading values
Quantity of shares to buy
Buy offer with a 3% premium
Total costing ($) value

Backtest results for "Urban's Bollinger Bands Daily Breakout Strategy"
Period: from 1st July 2019 to 18th June 2020 YTD (Today)

2019- 2020 Financial Year - Urban's Bollinger Bands Daily Strategy Capture.PNG




Backtest results for "Skate's Bollinger Bands Weekly Breakout Strategy"
Period: from 1st July 2019 to 18th June 2020 YTD (Today)

Skate's Bollinger Bands Weekly Strategy 2019-2020 YTD Capture.PNG

Skate.
 
View attachment 104926 Is cond1 correct? The comments don't seem to match the code or am i missing something

@Roller_1 well spotted.

My bad
In keeping with consistency of the (AFL) uploads I've used the same template as "Skate's 260 Period Weekly Breakout Strategy" & missed amending/correcting the comments.

Update Capture.PNG

There were other mistakes (comments only)
There were other mistakes using the same format & template but there shouldn't be any programming mistakes.

Thanks for the Eagle Eye
The corrected (AFL) & (APX) files have been corrected & upload for the "Urban's Bollinger Bands Daily Breakout Strategy v1"

Summary
The original files have also been replaced with the updated files & comments.

Skate.
 

Attachments

  • Urban's Bollinger Band Daily Breakout Strategy v1.afl
    7.7 KB · Views: 45
  • Urban's Bollinger Bands Daily Breakout Strategy v1.apx
    15.4 KB · Views: 25
Last edited:
Hi All,

Pardon the interruption. This post will break up the great technical analysis and trading strategy posts that have been happening lately.

Well, I did it! I've read the "Dump It Here" thread cover to cover! All 3,185 posts (and counting)! It only took me two weeks to do so (May 28, 2020 - June 10, 2020). Now there's two weekends plus a lot of nights I'll never get back ;). I've only now had time to post this follow up after reading the thread.

Reading the entire thread generated a lot of thoughts, including a few analogies, and I hope you'll indulge me as I share them with the group. The analogies are mine; you may, or may not, relate to them. I apologize in advance that this post may be a bit long.

I thought "Dump It Here" was an excellent thread, and I really appreciate Skate putting the thread together, and to all the contributors to the thread. It's nice that it still has legs after all this time (Dec 17, 2018 - present), and I hope it continues well into the future. The reality is if it weren't for Skate, this thread would not exist, nor will it likely continue to grow should he tire of updating it.

I've bookmarked over 100 posts in the thread, and at some point I'd like to go through all my bookmarks and collate the information in those posts into a single document for faster reference.

Some of the concepts in the thread are a bit repetitive, especially the earlier posts. This isn't a criticism at all, and in fact is likely consciously intentional. As repetition is often conducive to learning, the repetition may help drive home some important points. But it does make the thread longer to get through. It does take a commitment of time and patience to read (not skim) every post.

After I finished the thread, the first feeling I felt was "incomplete". Not that I expected a single thread to be a "complete" trading education, but that is nevertheless how I felt. I felt like it gets me 80% "there", but the "magic" 20% is missing. Don't get hung up on those percentages, they are just to illustrate a point. But after reading the thread, I felt like I learned so much, yet have so much more to go.

Which leads me to my first analogy. And these analogies really did pop into my head one night. I'm not making them up just for this post.

Analogy #1:
Let's say you have an 8 year old child (i.e. a "newbie") who would like to bake her (or his) first cake. So, as the parent (i.e. the "guru") you lay 5 ingredients out on the counter, a couple of utensils, and say "have at it, bake a cake". Now, your child has eaten many delicious cakes before (witnessed the end results of a good trading system). Perhaps she has even watched you bake a cake many times. But seeing you prepare, or eating the finished product, doesn't mean she can create it without a detailed recipe. You haven't included the two secret ingredients for the cake that make it delicious, you haven't said what temperature to use or how long to bake it, etc, etc. What are the chances that your child will bake a successful cake? Nil.

So, my first feeling after reading the thread was a lot like that child would feel. A feeling of "incomplete", as though I haven't been given all the information.

However, then I thought "what if my analogy is incorrect"? Don't get me wrong, it's correct for how I feel (felt), but is it correct about my expectation of this thread, or indeed of ASF in general?

A definition of "analogy" is "a form of reasoning in which one thing is inferred to be similar to another thing in a certain respect, on the basis of the known similarity between the things in other respects." (dictionary.com). If your analogy is not in fact similar to another thing, then it is just a story, but does not serve to support your inference to that other thing.

So, as I thought about this further, I thought of another (perhaps more accurate?) analogy.

Analogy #2:
Instead, say I'd just graduated high school, and had a burning desire to be a professional chef, specifically a pastry chef or pâtissier. So I'm still a "newbie", but with a higher intellect than an 8 year old child. And let's say I went to a very fancy restaurant, and tasted the BEST CAKE EVER (brilliant trading system). Man, this was the BEST cake I've ever had; I could eat it every day. I have this BURNING DESIRE to learn how to make that ONE PERFECT CAKE. So, I explain to my waiter, then the maitre d, that I'm an aspiring pastry chef, and with persistence convince them to let me meet their pastry chef after the restaurant closes. I beg Jacques the pastry chef to give me the cake recipe. Does he? Of course, he says no. Why? Well, it's his intellectual property, and the restaurant's. Also, he knows I might stop coming to the restaurant if I had the recipe. Finally, he knows I could one day be a competitor, having "stolen" his recipe.

But Jacques isn't completely heartless, and recommends me to Pierre's Culinary College, where I study for three years to become a culinary chef, specialising as a pastry chef. During that time, I bake hundreds of cakes. I make a ton of mistakes, burn many a cake, others taste horrible, but eventually I learn to be an pretty good pastry chef.

Now, with that experience behind me, I one day return to that restaurant, and again order that cake. It is just as delicious as always - the best cake I've ever had. But now, with my newfound experience, I have newfound discernment. I can taste the vanilla, a hint of coconut, definitely poppyseed, etc, etc. Now, I still don't have the recipe, but I am now MUCH more capable of going home, trying different things, and coming up with a recipe that is pretty darn close, if not even better, than the best cake I've ever tasted. I took those very good ideas embodied in the end result of that fantastic cake, and created my own recipe and made them my own. I can now bake a cake every bit as good as that cake from the restaurant.

This is the analogy I choose to believe, rather than the first one, as it puts me in a better mindset of what I believe I can learn from the "Dump It Here" thread, and indeed from ASF in general.

Another feeling I had after reading the "Dump It Here" thread was "jealousy". Why does Skate get mentorship from Captain Black, and I can't? Why does Skate get technical analysis help from Tech/a, but not me? Why does Skate get the "ducati-secret-VIX-formula-that-if-only-I-had-it-would-make-ALL-my-financial-dreams-come-true" secret formula? Of course, I have no idea of the history or relationship between Skate and those individuals, so who am I to say why Skate, and not me? But I was still jealous ;)

Which led me to my final analogy.

Analogy #3:
When you attend university, you start as an undergraduate. As an undergraduate, you attend classes in a group, sometimes in a classroom, sometimes in a large auditorium with hundreds of fellow students. You have a lot of homework (self-study), and frequent assessments (backtesting, paper trading, small positions to start). In fact, the majority of work as an undergraduate is (guided) self-study; you spend more time reading, doing homework, and perhaps labs with fellow students, than you do in class. You never, as a general rule, get individual mentorship, unless you pay for a tutor (purchase a system?). Although if you're that rare, persistent student who has a genuine passion to learn, stay after class, and "pester" the professor, you may get a bit of one-on-one tutorship (depending on the professor).

Fast forward to getting your PhD. A PhD candidate has a personal advisor, who helps him or her decide on his subject, and provides one-on-one mentorship throughout the research and preparation of his thesis (trading system), when it is finally defended to a panel of critical professors (the market) who decide its merit or not. (Apologies if this is not 100% correct, it is just to illustrate the analogy, I don't have a PhD.)

The point is, undergraduates haven't earned one-on-one mentorship. It's only when they've proven themselves through two degrees that they get that one-on-one mentorship to earn that most difficult and highest of degrees (and of course medical degrees).

This is just an analogy; it may or may not apply to what I can expect from ASF. Time will tell. To be honest, I don't know exactly what one needs to do to earn a mentor from ASF. Perhaps over time, and with persistence, a "virtual friendship", or at least "virtual respect", forms? Peter2 said in a post (not sure if here or in another thread) something along the lines that he was sick of wannabe investors, who beg for help, are given help, never to be heard from again (nor with a word of thanks) (a paraphrase from my recollection of Peter2's words). See "Help Vampire" below.

I did a title search on ASF for "mentor", and came across this thread: https://www.aussiestockforums.com/threads/mentor-for-newbie.35447/, and particularly this post: https://www.aussiestockforums.com/posts/1071322/.

This quote by Garpal Gumnut resonated with me: "It's a lonely interest, trading or investing."

These last two analogies work for me, and I believe put me in the right mindset for what I can expect from ASF, and what I need to do in my trading journey and education. I am still an "undergraduate", having merely read my first assignment ("Dump It Here"). I have a long, long road ahead of me in my self-education. I suspect it's a self-education that never ends, for as long as one keeps investing or trading.

It would be nice if I can at least get "What next?" advice from ASF but, again, time will tell. But I do believe that "if it's meant to be, it's up to me". There are no shortcuts on ASF that will instantly teach me what I need to be a successful investor or trader. Not even "Dump It Here" :D. But I do hope ASF will be an online community of like minded individuals, with many variations in skill set and experience. It's probably the typical "pyramid": the handful of gurus at the top that have a wealth of knowledge, experience, and success as investors and traders; the middle that are solid investors and traders, committed to investing and/or trading but still learning, still perfecting, still making mistakes; and the larger bottom of newbies or wannabes, that may or may not advance up the pyramid into the other two sections.

I do hope that ASF will be of benefit to me on my journey of self-education, and perhaps in the (distant?) future I can contribute back to the ASF community.

Finally, I'll do my best not to be a "Help Vampire" (this term is geared toward programmers but applies to ASF):
https://en.wiktionary.org/wiki/help_vampire (very short)
https://communitymgt.fandom.com/wiki/Help_Vampire (short) and
http://slash7.com/2006/12/22/vampires/ (longer but a bit funnier).

@Skate, thanks again for creating this thread and keeping it alive. I do have more questions, but I'll save those for further posts.
 
Hi @Skate,

I mentioned I have more questions in my above post. My first question is, would you be willing to tell us about your own trading education and journey, preferably in as much detail as you are comfortable in sharing?

I'm going on memory here, but I believe you said you studied for 3 years before making your first trade, having finished your first trading system while on a 6 month world cruise. You were retired before beginning your trading, so you could devote more time to learning than those working full time. You joined ASF on Dec 28, 2013, so rounding up to 2014, that means you were studying trading for roughly two years before joining ASF?

Why do I ask? Well, one approach to self-education is to try to emulate someone who you respect, and who has the success you would like to achieve. If I were to duplicate exactly what you have done, could I emulate your results?

(I heard a successful businessman once say "Never take advice in life from someone who is not where you want to be". He specifically said don't take financial advice from broke college/uni professors. I always liked that saying.)

I would love to know your motivation to start trading, the books you've read, the websites you've read/continue to read, the podcasts you listen to, the mistakes you've made, the tips and tricks you've learned with Amibroker, and other questions I'm too new to know to ask.

In summary, I'd love to know the DETAILS of your own trading education and journey. And if not the details, then perhaps at least the books, podcasts, websites, and other sources you've used for your own education.

Kind Regards...
 
And I thought of one more thing: a list of the posts in ASF that I should read and follow.

Assume I'm interested in technical analysis and trading.

(Yeah, this borders on "Help Vampire" - I could just spend hours searching ASF on various topics - but I'd still appreciate the leg up.)
 
I would recommend reading peter2's threads. But you may also want to think about if you are discretionary or purely mechanical? duc also has some great insights but both p2 and duc are discretionary. Skate is mechanical.

Thanks @Warr87. I'm already following @peter2, but I'm not sure what that gives me re: the forum software? I don't think it gives me an alert on all his posts. But I have seen his posts in this thread, and he seems like a super nice, really patient, super switched on guy. I'll have a search on his and @ducati916's posts and start reading/catching up.

Except right now I'm reading the Amibroker manual: https://www.amibroker.com/bin/UsersGuide.pdf. I'm up to page 300 so far lol. I do wish Dr. Tomasz Janeczko (https://www.amibroker.com/about.html) would invest in a tech writer where English is not his/her second language ;).

I'm a computer programmer, and my degree was in physics. I think my nature will be more suited to mechanical trading. I love coding; I've always thought I'd continue programming even in retirement, just for fun. Maybe contribute to some open source project. I just never thought it would be AFL ;):D

I think I will get more excited about perfecting a new strategy than P&E, P&L, etc. Once I learn what a strategy is!

But perhaps it's best to know a bit of both? Hopefully if I read enough books (or peter2 and ducati's posts) that will happen organically.
 
Last edited:
Well you may like to know that a number of quant shops specifically looked for those with training in computer programming and physics. Given that background you would likely have a better chance at understanding people like Ernie Chan. Amibroker is some great software but I'm not sure what your programming background is (C, C#, Java, R, Fortran, and Python are all used within the industry and Python is currently considered the go-to for Fintech). AB is versatile and will do what you want if you know how to use it.

I will shameless plug my own thread, but more so for the occasional list of authors I am reading. If you are like me then you will try to ingest as much (academic) information as you can.
 
@Linus van Pelt
I fully understand all analogies and went thru all these steps.
It is a lonely task and there is only so much you can learn and design on your own.
i have a similar background to yours sciences and math with programming so systemic trading is definitively well suited.
After the big thanks to Skate who initiated my travel, the notion of mentor is indeed critical and missing:
Location, background, so no mentor for me but i try to establish with some other valuable ASF members a loose network face to face meeting to initiate conversation and share common points then email etc so that you can share.code, concept and basically bounce ideas
It is really useful.not as good as a mentor but better than being alone in front of a white board at home.
Look at the advantages no mentor means you need to do everything on your own, you fully own the code and sadly its mistakes ..it will be a longer path, will cost you hard earned dollars but i do not have better options
Hope it helps..a bit
 
@Skate, thanks again for creating this thread and keeping it alive.

@Linus van Pelt, thank you for your assessment of the "Dump it here" thread, it was a great post.

I really appreciate your kind words
I'm the first to help others where I can, every post I make is done with that sole purpose of helping others. There is no smoke & mirrors with me, I'm frank & honest & at times a bit too open, but that's just me. With every post, I'm just repeating information I already know. I keep reading this forum to learn what I don't. There are a lot of smart people in our community & when they start to speak I'm smart enough to "prick me ears" & listen.

Years of study
I had 3 years of constant study before placing my first trade so I understand the frustration knowing the amount of time it takes to learn how to trade correctly let alone to make money at this game. It pays not to rush the learning process. The financial markets are cruel, unkind, dangerous & it's not a level playing field, one place where amateurs are generally fleeced brutally.
I don't have a PhD.
What does PhD stand for?
It's an acronym - Persistence, hard-work & Determination (PhD) I have never met a successful trader who didn't have these qualities & qualifications in spades.

Let's not complicate trading
Trading is easy, making money trading is the difficult part. Trading consistently & successfully is even harder, which is why the majority of people who try to make money from trading fail. When you realise nothing works perfectly, accepting "that sometimes it works & at other times it doesn't" you'll become more accepting of handling a few setbacks. I say just "go with the flow". If you have the ability to delay gratification, stifle impulsiveness & shake off the market’s inevitable setbacks, will make you a half-decent trader. For those looking for the perfect strategy, there isn’t one, so in the meantime, pick an idea, backtest it to death leaving nothing to chance.

I'm like a Dog with a bone
I'm a compulsive learner & have a passion to share knowledge. I'm compulsive about most things & I study & write every day. I've condensed 5 years of trading knowledge into this thread, I thought it would be helpful for others to read the "nitty-gritty" of trading in a lighthearted way explaining what it takes to be successful.

Let me give you an analogy to finish with
I don’t care how often you read a "Boeing 747 instruction manual" or even a "Helicopter instruction manual" I can guarantee you that in the end you will not be a good pilot. If you ever get off the ground there would be no guarantee the plane or helicopter would be safe under your control. Reading my thread is just the same, this thread is a stepping stone to advance learning.

Summary
After reading some of my posts, hopefully it's the catalyst to learn more than the basics.

Skate.
 
@Linus van Pelt
I fully understand all analogies and went thru all these steps.
It is a lonely task and there is only so much you can learn and design on your own.
i have a similar background to yours sciences and math with programming so systemic trading is definitively well suited.
After the big thanks to Skate who initiated my travel, the notion of mentor is indeed critical and missing:
Location, background, so no mentor for me but i try to establish with some other valuable ASF members a loose network face to face meeting to initiate conversation and share common points then email etc so that you can share.code, concept and basically bounce ideas
It is really useful.not as good as a mentor but better than being alone in front of a white board at home.
Look at the advantages no mentor means you need to do everything on your own, you fully own the code and sadly its mistakes ..it will be a longer path, will cost you hard earned dollars but i do not have better options
Hope it helps..a bit

Hi @qldfrog,

Thanks for all your contributions to this thread.

You triggered another question I had for Skate, but I guess I can ask it to the group in general.

Why the reluctance to share a trading system with the wider ASF? I'm used to open source software projects, where individuals and groups contribute their expertise for the greater good of the world (so to speak).

Now, I think I may know the reason, but correct me if I'm wrong. Besides "do your own bloody work", let's say Skate, or anyone, shared his active trading strategy(ies) with, I dunno, say 10 people privately. Or with the entire forum. If 10's, 100's, or 1000's of people were trading his exact system, they would be competing with him in the market. Depending on when their trades ended up in the market, they could drive up his buy price, or drive down his sell price.

Besides protecting the *exact* intellectual property, there would be some real, actual detriment to someone sharing his/her strategy with a large group.
 
Top