Coded Trading Strategy 1 – Human Trader 0

This afternoon I got a first-hand experience of how beneficial it can be to incorporate computer code in my trading routines, even if it leads only to partial automation.  This came about by a trading signal that my code generated whilst I had completely missed it when looking at the chart with my own set of eyes at the end of a long day.

During the second half of 2017, I taught myself some EasyLanguage code, a language that can be used for programming trading strategies on applications such as TradeStation or MultiCharts.

This led to me attempting to code some strategies which quickly ran to several hundred lines of code – I figured the more complicated, the better, right?  Well, thankfully in the last few weeks I managed to write some simple code to help trade a strategy manually and with some discretion, although hopefully at some point I will be able to fully automate it and let it trade by itself.

In any case, what I wanted to share, is that the code is starting to pay a lot more benefits than I had expected.  I have tested the code carefully and most of the time it sees setups when I would like it to see a setup.

Am starting to get into a routine whereby I scan 20-30 charts every four hours to check for setups, and then I cross-check that against the code that is running on my TradeStation platform.

Today was an instance where I did that at 5pm in the afternoon, by which time I was trying to juggle several things and was starting to get tired from a long day of work.  After I cross-checked the 4H chart for Cable (the GBPUSD exchange rate) I was surprised to see TradeStation give me a short-signal.  I had manually looked at the Cable chart and had noted the volatility it had experienced during the day – and even though I spent a couple of minutes looking at it, I had not realised that the chart was actually meeting my 5-point setup criteria.   I had to do a double-take and then quickly realised that the code was giving me the signal that I had instructed it to do.

The code was doing a better job of quickly analyzing the chart in the way I had told it to, and was not being worn down by trying to multi-task or by tiredness.

As a picture is often more meaningful, here’s what I looked on my MT4 charts – and didn’t see a setup.

Cable May22 MT4

And then I looked over to the TradeStation chart, in which my own code is running, and had a short-signal at the start of the new 4-hour candle.  Note the area marked as ‘A’ below shows on/off signals for each of the 5 components of the setup.  The chart also shows the current price, by which time the trade is, this time round, nicely in profit:

Cable May22 TS

Having confidence in the tested code, I promptly executed a short trade.  An hour and a half later the trade is nicely in profit – though that’s not the main point of this story – the trade may well end up as a loser – I expect 50% of my trades to be losing trades – the main point of it is that I benefited from having spent time writing the code and then incorporating that code in the setup-scanning process.

This reminds me of the stories of the importance of having check-lists – such as for pilots under pressure, or doctors in the surgery room – trading is not life-threatening as in those situations – but it definitely pays to have check-lists, and even better if it has been automated!

Thought this might be a good experience to share with the trading community.



This entry was posted in Financial Markets 101, Trend-Following Strategy. Bookmark the permalink.

5 Responses to Coded Trading Strategy 1 – Human Trader 0

  1. Qoyyuum says:

    In the area marked as ‘A’, is that a custom indicator?

    Liked by 1 person

  2. Vinchenzo C says:

    Very nice.
    I’m looking to learn some code language and attempt some automation myself this year.

    Liked by 1 person

  3. Pingback: Newsflash: +10R trading week | Trick or Trade

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.