Extending Sharescope with ShareScript
I have now finished the book ‘Trading in the Zone’ and feel refreshed and ready to start trading again. I will review that book in a different post as it truly deserves an entire post of its own.
This post is about making sure you have an edge that actually works. I wanted to make sure the ‘edge’ that I have which I learned at Traders University and refined using the book ‘The spread betting hand book’ by Malcolm Prior really worked.
The idea of an edge as described in ‘Trading in the Zone’ is a methodology that clearly describes entry and exit points that over many trades gives a more favourable outcome than a random result. We accept that any given trade has a purely random outcome but that over a given number of trades there will be a bias towards to particular outcome. Knowing this and using it when executing trades is what gives you an edge over the market.
The real question is how do you know the edge works. One way is to retrace that edge back in time as though you had been trading for say two years and see how much money you would have made (or lost) using that edge. I have done this manually with the TU methodology and found that
a) It takes awhile to complete for a large number of trades
b) There is no quick way to see what happens if you changed a few parameters to your edge, to see if you could refine it as you learn more about technical analysis
I decided I would spend a month or so, putting together a spreadsheet with some formulas defined that would allow me to manually go through the FTSE350 to prove or disprove and to refine the edge I have.
Thankfully, before I started, I decided to see if there were any ways I could write a script to automate some of the calculations. Being a computer programmer, this sort of thing comes easily to me and would save a lot of time.
I found out that sharescope has a scripting language called sharescript. At first I thought it would be in some bespoke language and have a large learning curve but to my delight I found it is based upon JavaScript. This is a language any web programmer will know and one I have used for years. There is a basic well documented library of methods that extend the language to allow you to query the data held in sharescope.
There is a rich body of supporting material and I very quickly (about 2 hours) put together a script that works out the current trades that fit the edge I have. This script is much better than the filters given by TU and will save hours of time. The filters given by TU are quite basic and still show many shares that do not fit their own criteria for the edge. By writing the script more accurately I can now show only the exact shares which fit the edge and are worth trading.
What is more important however, is the next step which is to write a script which tests the edge with historical data across the whole FTSE 350. I can test the edge and vary the parameters that create the edge extremely quickly and rerun the script. In this way, I can refine the edge based on historical data, see which shares it works for, and change the script as market conditions change so that the edge is always up to date.
Without sharescipt this would take months or even be impossible.
I am very excited about this, as it will really allow me to define a professional edge. As far as I know, no one at TU has done this and this could push me well ahead of the game as far as what they are doing. Not that, that really matters, but it is nice to know as all of the people I have spoken to from the course seem to have lost money.
October 27, 2008 at 1:23 pm
You mention you’ve used ShareScript – are you willing to share these scripts?
I’ve just subscribed to ShareScope and having used Chris Manning’s techniques in the past and recently heard about TU’s filters, I’m interested in using ShareScope to refine my picks.
October 29, 2008 at 11:54 am
I will send you my script to your email address with explanation of what it does.
February 23, 2009 at 12:26 am
Hi Simon/Andy. I’ve recently purchased sharescope as well. And have attended the TU intro course. It was well structured and informative, but i’m reluctant to commit to the paid course as some people don’t seemt to be making money after attending. I’m also reading Trading in the Zone.
I too would love to try your script/) out provide some feedback. I’ve programmed javascript as a webdev but haven’t looked at sharescript proper yet, and wouldn’t know which parameters to use in any case. Can you share?
Cheers,
Sunil