Setting up a Bitcoin Breakout Trading Algorithm on FXCM’s Trading Station Platform

With FXCM recently adding the BTC/USD trading pair on their retail trading platform, we thought it would be useful to show how quick and easy it is to setup a fully automated trading algorithm on FXCM’s Trading Station using a Lua based strategy. This article will show how to setup a breakout strategy geared specifically towards trading Bitcoin.

Step 1. Download and Install FXCM’s Trading Station

If you have not used FXCM’s desktop trading platform before, it can be downloaded and installed for free from FXCM’s download page.

Step 2. Create a Free Demo Account

We strongly recommend thoroughly testing any trading algorithm in a demo environment before deciding to use it on a real-money account. Demo accounts can be setup for free on this signup page.

Once you receive your demo account credentials, launch Trading Station and log in using your new demo account username and password.

Step 3. Download and Install “Bitcoin Breakout Strategy.lua” from GitHub

Now that we have logged in to our Trading Station Demo account, we need to download the actual trading strategy file. To do this, we need to go to the strategy’s GitHub page here.

Next, right-click on the “Raw” button and select “Save Link as…”

I recommend saving this lua file on your computer’s desktop or somewhere that is easy for you to navigate to. Once the file is download, click and drag the file on top of the Trading Station platform and drop the file. Clicking ‘Install’ will install the strategy on to your platform.

Step 4. Run the Strategy Using Your Desired Options

The strategy can be run by clicking on Alerts and Trading Automation –> New Strategy or Alert… –> BITCOIN BREAKOUT STRATEGY

You can then select the options that you would like to use on your account.

Strategy Parameters/Options

Symbol – To trade Bitcoin, select ‘BTC/USD.’ This strategy will also function on any other symbol as well.

Time frame – Time frame is where you select the size of candle/bar you want the strategy to be based on. This is set to an hourly time frame, or ‘H1’ timeframe by default.

Channel Periods – Channel Periods is where you select how many candles/bars you wish to look back to calculate the price channel’s high and low. It is this channel’s high and low that will trigger a breakout trade if BTC/USD breaks above the high or breaks below the low.

Limit Multiplier – Limit Multiplier is where you select how far you want your limit order (take profit order) to be placed in relation to the opposing channel line. This particular strategy sets an effective stop loss at the channel low for buy trades and the channel high for sell trades. The default Limit Multiplier value of 1.5 would set a limit order at 1.5x the stop distance on every trade. For example, if a buy breakout occurs and the channel low is 50 pips away (meaning the effective stop loss is set 50 pips away), a Limit Multiplier value of 1.5 would set the limit order (take profit order) at 75 pips.

Allow strategy to trade – Select ‘Yes’ for the strategy to trade. Select ‘No’ to disable trading and only allow alerts.

Account to trade on – Select the account you want traded.

Trade Amount in Lots – Select the number of lots you want traded where 1 equals the smallest trade size available on your account for the particular symbol being traded. 1 for BTC/USD is 1/100th of a Bitcoin.

Show Alert – Select ‘Yes’ if you want to receive a popup window each time a trade/signal is generated.

Play Sound – Select ‘Yes’ if you want a sound to play each time a trade/signal is generated.

Recurrent Sound – Select ‘Yes’ if you want the sound alert to continually play each time a trade/signal occurs until you manually stop the sound from playing.

Sound File – Select the sound played for each trade/signal generated.

Send Email – Select ‘Yes’ if you want to receive an email alert each time a trade/signal is generated.

Email – Select the email address you would like to receive email alerts. Please note that you must first setup your Trading Station platform using the Email Configurator if you would like email alerts.

Step 5. Watch as This Breakout Algorithm Trades Bitcoin on Your Account

The rules of the strategy are very simple. When price breaks above the Highest High of the selected number of previous candles/bars, the algorithm buys (and closes any existing sell positions). When price breaks below the Lowest Low of the selected number of previous candles/bars, the algorithm sells (and closes any existing buy positions). Each trade has a limit order set at a distance equal to the difference between the open price and the opposing channel price multiplied by the parameter ‘Limit Multiplier.’

Buy Trade Example

Past performance is not indicative of future results.

Sell Trade Example

Past performance is not indicative of future results.

In Conclusion

Breakout strategies work well in high volatility environments, which is what Bitcoin often provides. FXCM’s Trading Station and the linked Lua strategy is an easy way to deploy an algorithmic approach to trading Bitcoin on your account. For more automated trading strategies for FXCM’s Trading Station, check out our Lua repository.


Risk Warning: The FXCM Group does not guarantee accuracy and will not accept liability for any loss or damage which arise directly or indirectly from use of or reliance on information contained within the webinars. The FXCM Group may provide general commentary which is not intended as investment advice and must not be construed as such. FX/CFD trading carries a risk of losses in excess of your deposited funds and may not be suitable for all investors. Please ensure that you fully understand the risks involved.