Boingo Bollinger Strategy
Author: swuzy
Creation Date: 8/12/2010 1:37 AM
profile picture

swuzy

#1
Sometime ago, I put together a relatively simple Bollinger script in WL4 that I called "Boingo". I had been planning to release it to WL4 community, but it has been so long since I last used it, that I have forgotten most of its various features and logic tweaks. I've used the WL Translator to convert it, but it is rather hard to read thereafter.

Boingo in WL4 and WLT, at times, achieved reasonably interesting results (but nothing spectacular) on various watch lists and time frames.

I would really appreciate it if someone can translate it to WL5. Thanks.

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Hi Seth, thanks for your contribution to the community. Since you've been here for quite a long time, I wonder is there a problem for you to convert to the C# syntax? If so, please follow these links with suggestions:

How do I start with C# ?I'm a Wealth-Lab 3/4 user, how to learn C# ?

An equivalent WealthScript function can't be found. Are there WealthScript methods changed or no more valid in WL5?

I'm a firm believer in teaching how to fish vs. giving it, and in the light of decommissioning WLP4, it would benefit you if you start learning C# by manually translating a very simple, wizard-generated script like the 'Boingo'. Should you have questions along the way, please ask them here.
profile picture

swuzy

#3
You are right of course in your intentions. Thank you. And I am being lazy. Well, I have picked up a copy of "C# 2008 for Dummies" and have been struggling to read a few pages now and then for two years or so now, and still mired in the nowhere of dislexia crossed eyes and instant narco sleep induced by its text. What do you call someone who is a lesser Dummy? A Clueless Coder?

I figured out the original logic for my very simple Boingo exercise in WL4 which reasonably often, generates modest gains. Of course it does well on the IBD 100, but it also does reasonably well on the WL100, and without a huge amount of trading transactions.

Sorry, in putting it into WL5 version, I took the lazy shortcut and used WL5's wizard. I am sure it can be easily improved and made more consistent.

For what it is modestly worth, I'd like to share the exercise with other hard working but frustrated perpetual newbies.

So the WL5 strategy rules wizard generated the following code:

CODE:
Please log in to see this code.




profile picture

Eugene

#4
Exporting code produced by the wizard and comparing it to original WL4 code is one helpful technique.

Here's your code optimized by hand.

1. Although the description mentions "Exit on fixed pct trailing stop (4) or price crosses below lower BB or price crosses below upper BB", the way it's programmed the strategy would exit on trailing stop if, not or, price crosses below a BB. This has been fixed.

2. Note that it's strongly suggested to correct the start of the trading loop when an unstable indicator like EMA is being used (check out the WealthScript Guide, Indicators > Stability of Indicators). So for this particular strategy, you need to load no less than 333 bars of data.

CODE:
Please log in to see this code.
profile picture

swuzy

#5
Well, this is somewhat embarrassing as Eugene's "corrected strategy" does not seem to perform as well as the incorrectly implemented script above Eugene's nice work.

Of course I may have incorrectly remembered the proper logic or the WL4 original, or whatever.

I went back to Boingo and tweaked it some more, and included (1) a priority module for selecting Alerts based on ROC; (2) an external comparative reference to the S&P 500 "Market" so as to (a) sell if Market Macd is down and stock drops in value; (b) sell if Market Stochastic is down and stock drops in value. While (a) and (b) can all be simplified into a single code line, I wanted the feed back of separate Sell Names as to what triggered the sell. And of course (3) sell if either (d) the upper or (e) the lower Bollinger band is crossed under, again with separate Exit Names.

It now appears to perform better. I did take out most of the plotting lines so it might run faster or require less memory. So here is the updated version of Boingo for WealthLab friends. If you come across any errata or potential improvements, please let me know or share with everyone.

Cheers.
Swuzy

CODE:
Please log in to see this code.
profile picture

swuzy

#6
This is to note that I have corrected the code above as to a small surplusage errata.
profile picture

Eugene

#7
QUOTE:
Well, this is somewhat embarrassing as Eugene's "corrected strategy" does not seem to perform as well as the incorrectly implemented script above Eugene's nice work.

Actually, I just made sure the code is in line with the rules but if the strategy is performing better when its trailing exit is triggered only after one of the two BB cross under events, then it's not just a mistake but a find that deserves further research.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).