Article / 28 September 2016 at 13:00 GMT

How can traders use simulation models?

Hypothesis Testing
United Kingdom
  • Back-testing is an art worth mastering
  • Data sets must be examined for relevance
  • Algorithmic models can be of use to traders

By fxtime*

To a statistician, "curve to fit theorem'' is a horror story. 

In essence, a theory of our own making eventually shows perfect results only to become a nightmare as we realise that our optimum result – which we have carefully crafted and researched – suffers from a flaw. We may not know of the flaw immediately, and we may believe in the data we see before us wholeheartedly, but there is always a flaw

The Liberty Bell in Philadelphia, USA
Look closely. Photo: iStock 

No matter how precisely we measure our data, we may inadvertently be using it incorrectly as we (say) back-test timings for price breakouts and then discover changes in time zones have occurred without our noticing (e.g. changes from GMT to summer-adjusted hours or national holiday data has skewed our theorems and tests).

Similarly we may see trade price ticket spreads stretch alarmingly at certain times of the day that give a totally different real world result from our testing.

Another issue is the sheer size of our sample. One year of data really only shows the current underlying trend. As we await the Trump/Clinton vote, for instance, we see a market responding with a slight skew to the national vote (this is typical), especially as we near the actual voting date. But our backtesting systems would not record this influence and will only record the hard data; they will also be oblivious to the market's political skew.

I have seen 30-year data sets that take trade theories to another extreme; again, we have to question their relevance as the world has changed over that period of time. Trading techniques, trading speed, and the sheer interconnectedness of world markets via the internet have all shifted things due to the mammoth change in market responsiveness and sensitivity to news events.

As such we need a real-time measure that isn't so slow that we amass irrelevant values but is still applicable to the ''here and now''.

In India, the substantial internet technology education that exists there is such that they can research theorems (however odd) easily because of the high number of skilled IT students in the country. One such project related to algorithms for statistical modelling. The objective was, bizarrely, to build a means for a computer to assess a material and consequently make a statue of an elephant via algorithms only

Initially, the sheer amount of data required crashed the computer systems. Typically, every nuance of the elephant's shape, scale and proportion, as plotted in relation to a three-dimensional image, was beyond the computers memory ability. 

Elephant
It's more complicated than you might think. Photo: iStock

Back-testing a market can be much the same and just as frustrating... too many years of data produces only an average outcome and we need to be better than average with our trade structures.

So how did India overcome the back-testing algorithm for the construction of an elephant from stone, wood, or any other choice of material? In hindsight the answer is easy and uses far less information than we would think: they used the most basic Bayes theorem and reversed it. The code is irrelevant here, but basically they cut away what was clearly not an ''elephant'' and rapidly achieved their required result!

This is where we need to excel in trading. We need to use enough data to know what isn't relevant to the trade's opening and execution.

Axioms of choice A, B and the mote C are simplistic algorithms that are arranged along classic trader actions:

Action A = You open a trade and go long.
Action B = You open a trade and go short
Action C = You do nothing.

All three actions are independent trading decisions and all have equal value and weighting. But action C also tells us that you are not risking anything and will not earn/lose anything. In probability terms, the results will always be 0% returns whereas actions A+B will have a higher percentile.... even if it's only a 1% success rate, it has a higher chance than action C. 

So should we ignore Action C?

Axioms of choice as described above are the core of the programming but have astonishing outcomes. We need to pay particular attention to what we programme, otherwise a series of unforeseen circumstances can arise. 

Politicians, for instance, are forever resigning due to the axiom choice whereby they enact a policy only to see unexpected outcomes. Banks are no different, but perhaps the most shocking example can be found in an axiom that ran what was regarded as the perfect corporate trade model for a T-shirt company.

What happened was that the firm discovered its computer, when linked to a dictionary, could produce a printed product on demand whereby the company never stocked the printed shirt and could advertise the product for any size or colour T-shirt and printed to whatever text they advertised freely on Amazon. Thus they faced no stock control issues as they would only produce and sell an ordered item and their magic computer would simplyprint the shirt. 

In the UK, there was a popular period when the phrase ''keep calm and....'' was printed on T shirts and the like. The T-shirt company in question, then, used its axiom choice program to merge the dictionary's many verbs to the ''Keep Calm and'' phrase believing they would earn a fortune. Ultimately, of course, the Action C (the mote) hit hard... some verbs were totally inapropriate, offensivem and unforeseen. No matter how you look at Axioms, there must be (for want of a better description) a damage control preset. 

Keep calm
Without damage control, you will hardly be able to remain calm... Photo: iStock 

Runaway trades can and will destroy accounts just as the T-shirt company (ironically called "Solid Gold Bomb") destroyed its own viability and reputation.

Autonomy founder Mike Lynch utilises axioms in his Artificial Intelligence programming business which specialises in working through the three axioms (ironically) for due diligence. Corporate takeovers – whether hostile or mutual – require immense number of hours for manual due diligence and the computer can work through millions of data reference points to make an axiom showing the three potential outcomes and areas to research further. 

It does not do this by cross-referencing everything but instead by considering, as in the elephant example, what isn't there... it searches for a completed audit trail and highlights areas that haven't been agreed upon etc.

We need to look at markets in our usual trading style(s) to accrue revenue. Likewise, we need to run our trading in a professional manner in which we endlessly review and develop real-time strategies, but Action C is the area we need to really consider.

We all know when markets move, but when scalping do we consider how much of the trading day remains before entering a trade?

When you open a trade, ask yourself if there is the requisite volume and volatility for your trade to perform in the time frame you expect. If there isn't, then ask if that is what you want. Chance and Action C are one and the same thing...

chart

Create your own charts with SaxoTraderGO click here to learn more

Source: Saxo Bank

— Edited by Michael McKenna

*fxtime is an alias
28 September
Michael O'Neill Michael O'Neill
Great article,fxtime.
28 September
Market Predator Market Predator
Hello fxtime! Nice theory :) What about real testing of market data? Do you use e.g. Metatrader, Multicharts or other technologies to back-test Market data? Or as you described above: too infos for your trading style? So far as I understand your style, you prefer value Trading: to stay ideally in std-dev, or is this wrong?
28 September
fxtime fxtime
I use python testing which backtests for bid and ask prices for any predetermined time zone and for per second price and spread also it accommodates for leap years, public holidays, weekends, time zone adjustments for summer and gmt time frames in addition I rely on Genesis for back test on STAN/R/JAGS statistical modelling software which includes null hypothesis to test the veracity of data.
28 September
fxtime fxtime
Std dev is a bed rock overview of markets but if you look at the posted algo I gave I also use pure stats and no charting at all and rely more on ratios.
28 September
fxtime fxtime
TF I am impressed you included the ''Solid Gold Bomb'' link...I wasn't sure if you would censor that !!
28 September
Market Predator Market Predator
@fxtime: thanks for your feedback!
28 September
fxtime fxtime
Another axiom...the usdcad looked beautifully strong but a basic contra trade for the reasoning on the chart. Easy money if you trade as a synthetic option to reduce margin and enhance break even otherwise drawdowns can be severe on a cfd. If using the latter then trade very small. Trade lasts one week max. I will post detailed info later on these but suffice to say the chart should give a reasonable overview. Each market has its own parameter whether it is a fx pairing (major) or Indices.
28 September
fxtime fxtime
Make sure you aim to maximise profit obviously LOL.
Have a good evening everyone.
28 September
Market Predator Market Predator
Thank you!
29 September
fxtime fxtime
Axioms are results of prior actions...normally we see the ''C'' choice occur like the linked article for Solid Gold Bomb in the article above due to management policy for cost cutting too severely or taking a decision/action that removes the core integrity of their product which dramatically affects their market value(s). These days any internet based business must be cautious not to make their very own Solid Gold Bomb effect.
Hewlett Packards take-over of Autonomy was a disaster because its due diligence was severely flawed yet ironically the very founder of Autonomy was establishing an axiom system to make due diligence faster and more accurate but this one section was stripped out of Hewlett Packards take-over!! That imho was a serious error and is akin to Kodak inventing digital photography and then totally ignoring it and tried to expand chemical film technology.
Perhaps we may yet see another Kodak moment with electric cars...time will tell :-)
29 September
zefy zefy
USDCAD example looks very interesting. I will start my homework based on that :).
29 September
zefy zefy
Thanks for very educative lesson again. I find both theory and example very intriguing.
29 September
kom75 kom75
Quick look at SPX chart and last 3 weeks were very interesting. Another great, simple stuff I like:)
29 September
fxtime fxtime
LOL...I wondered if you would check those Kom and i assume FTSE, USDCAD and ofcourse DAX?
29 September
kom75 kom75
Yeah, ftse yesterday was 74.5 points on my chart so didn't play
29 September
fxtime fxtime
Never be tempted to adjust the values....74.5 as you rightly say doesn't qualify.
29 September
fxtime fxtime
kom I have just got back to my trade desk and checked yesterdays data. FTSE100 cash Closed 9pm BST last night at 6897.79 but the prior day close was 6817.19 giving a net difference of 80.6pts so the trade does qualify targeting 6857.79.....I can match your levels if I use the open to close price however. Sorry for any confusion.
29 September
kom75 kom75
My mistake. I forgot you start an hour earlier:)
29 September
fxtime fxtime
Hmmm the market has fallen from 6925 down to 6870 we might get the full expected drop early in the time frame expected :-)
29 September
kom75 kom75
Fxtime, thanks for remind me closing time. I sold uk100 at 6937, so now in profit :)
29 September
fxtime fxtime
Update ftse100 has completed the trade structure as we dropped down to 6851.00 region :-)
29 September
fxtime fxtime
LOL all my one touch and straightforward trades covered and well done Kom....an easy and very profitable scalp for us both.....reckon we have each earned a wine now LOL.
29 September
kom75 kom75
Although I lived in France I never became convinced to wine. Vice versa to beer LOL
29 September
fxtime fxtime
Alas I am a coeliac so beer = poison sadly ......but wine to me is nectar :-) Enjoy your hard earned beer mate :-)
29 September
kom75 kom75
Have your wine too:)
04 October
fxtime fxtime
The FTSE 100 has extended beyond 75pts intraday from the prior day close so fwiw I have just opened a short at 7100 looking for a mean reversion by this time next week :-)
04 October
fxtime fxtime
Trade worked.
The cfd basic trade made +50 albeit at a low stake percentage.
One touch binary worked beautifully likewise a simple OTM short call to open one week expiry which covered with the bonus of time value too !! NOTE the option trade is a higher risk even though a short OTM call to open which makes a synthetic PUT really with lower margin requirement BUT it was a one way trade.
Relevant articles for you

Disclaimer

The Saxo Bank Group entities each provide execution-only service and access to Tradingfloor.com permitting a person to view and/or use content available on or via the website is not intended to and does not change or expand on this. Such access and use are at all times subject to (i) The Terms of Use; (ii) Full Disclaimer; (iii) The Risk Warning; (iv) the Rules of Engagement and (v) Notices applying to Tradingfloor.com and/or its content in addition (where relevant) to the terms governing the use of hyperlinks on the website of a member of the Saxo Bank Group by which access to Tradingfloor.com is gained. Such content is therefore provided as no more than information. In particular no advice is intended to be provided or to be relied on as provided nor endorsed by any Saxo Bank Group entity; nor is it to be construed as solicitation or an incentive provided to subscribe for or sell or purchase any financial instrument. All trading or investments you make must be pursuant to your own unprompted and informed self-directed decision. As such no Saxo Bank Group entity will have or be liable for any losses that you may sustain as a result of any investment decision made in reliance on information which is available on Tradingfloor.com or as a result of the use of the Tradingfloor.com. Orders given and trades effected are deemed intended to be given or effected for the account of the customer with the Saxo Bank Group entity operating in the jurisdiction in which the customer resides and/or with whom the customer opened and maintains his/her trading account. When trading through Tradingfloor.com your contracting Saxo Bank Group entity will be the counterparty to any trading entered into by you. Tradingfloor.com does not contain (and should not be construed as containing) financial, investment, tax or trading advice or advice of any sort offered, recommended or endorsed by Saxo Bank Group and should not be construed as a record of ourtrading prices, or as an offer, incentive or solicitation for the subscription, sale or purchase in any financial instrument. To the extent that any content is construed as investment research, you must note and accept that the content was not intended to and has not been prepared in accordance with legal requirements designed to promote the independence of investment research and as such, would be considered as a marketing communication under relevant laws. Please read our disclaimers:
- Notification on Non-Independent Invetment Research
- Full disclaimer

Check your inbox for a mail from us to fully activate your profile. No mail? Have us re-send your verification mail