Chasm

Project Year:

2017

Keywords:

automated trading
calgo
bot
· 2017 ·

When I was still freelancing, I had a client asking me if I could build some online trading bots for him. I had absolutely zero experience in the development of these types of tools and, to be honest, about trading in general. However after some meetings it turned out that what he wanted to do was relatively simple: he already had his own trading strategy and he just wanted a bot to do the work.

After some research we agreed that the best platform for running these bots was going to be cTrader automate (formerly known as cAlgo). This required me to code in C# (not exactly my main programming language) but I accepted the challenge. After some months of development, improvements and backtesting, we had our fully working bot.

In the meantime I became more and more interested in the topic, so I started reading some articles about trading strategies and one in particular got my attention: it was about Gap trading strategies, and it looked like a very promising approach.

So, after reading the article over and over again (to make sure that I really got it) I decided to build my own trading bot, called Chasm.

Chasm screenshot

The bot is checking for the closing price of previous day and comparing it with the opening price of current day. If opening price is bigger than yesterday's close then we will have a GAP UP. Otherwise, if today's opening price is lower than yesterday's close, then we will have a GAP DOWN. If none of these scenarios are happening, the BOT will stay on standby for the current day.

If the BOT detects a GAP it will behave according to the configuration:

GAP UP + Long

One hour after the market's opening time, it will open a LONG position and set a take profit calculated on the value of the Diff Ticks parameter, added to the max price reached today.

GAP UP + Short

One hour after the market's opening time, it will open a SHORT position and set a take profit calculated on the value of the Diff Ticks parameter, subtracted from the min price reached today.

GAP DOWN + Long

One hour after the market's opening time, it will open a LONG position and set a take profit calculated on the value of the Diff Ticks parameter, applied to the min price reached today.

GAP DOWN + Short

One hour after the market's opening time, it will open a SHORT position and set a take profit calculated on the value of the Diff Ticks parameter, subtracted from the min price reached today.

Stop loss is always calculated using the value of LONG Trailing Stop or SHORT Trailing Stop (%) parameters, depending on the actual scenario.

The n. of contracts is defined in the "N.Contracts" parameter.

Antonio Cosentino © 2021 - 2023 · All rights reserved