How to automate a trading strategy

Hi,
I’ve develloped a scaping strategy based on news events that seems to work when I backtested it manually for the last 10 years. The problem is that the market needs to be entered extremely quickly while taking into consideration the last candlestick closing price after the annoucement of the news, way quicker than a human could. To solve this problem, I thought about automating my strategy, so that the trade would be placed almost instantaneously. I wondered what options I had. Should I simply learn to code? If so, what language should I focus on? Should I use an AI that does the coding for me? What AI would you recommend? Should I buy a already existing bot and adapt it to my needs? I am new to this, and your help would be greaty appreciated. Thanks!

1 Like

You can use python to code your strategy. It’s an easy coding language to learn.
I suggest the TA-Lib + the Metatrader 5 Python Libraries.
TA-Lib can be used to compute indicators such as SMA , ATR etc …
metatrader 5 library can be used to get data, execute orders etc …
You can use chatgpt to get started with it. If you have any problem, you can post them here and i’ll try to help :slight_smile:

1 Like

Sorry, I am not judging but base on this sentence, I would assume that you’re trying to look for entry after the news being released a few minutes later? I understand that you have backtested for 10 years. But, have you really sit and think for a bit if you’re looking for entry at that time, the spread is getting widen that time and might not be a good idea to look for entry as there is a high chance that you get a slippage, very high chance. I would say that it is not doable unless you’re one of the large player who can move the market.

Sorry again. But, I think this is something to think about. When backtesting, you must put into consideration of what actually happened during it was live. And again, which I always say in the forum that I am not a fan of backtesting. To me, forward testing is the way to go.

Anyway, I wish you good luck in automating your trading strategy. Cheers.

Thank you both for your quick answers. As a matter of fact, I’ve kinda forgot about slippage, and did not really take it into consideration. From your experience, how bad can slippage actually be? The strategy in question clears around 25 pips per trade in average, so I tought I could afford to loose a few pips due to slippage issues. Do you think bad slippage could actually eat up all this profit, and lead to a negative average trade value? For the spreads, I tought of using a broker wich uses fixed spreads, to avoid spreads that widen up like crazy. I remember that requotes can also occur, wich could be another problem. Do you think the edge that I found could still be profitable after slippage and requotes? Thanks for your precious advice.

Slippage around news events can certainly be both huge and unpredictable.

But the main problem with “trading the news” is that your stop-loss may not be honored by the broker. :open_mouth:

I’m biased. I don’t trade the news.

I don’t know anyone who still does, though I know plenty of people who used to!

My experience is that absolutely everyone sooner or later has an absolutely “unforeseeable” accident from doing this and changes their mind about it.

And the fact that it’s the commonest single cause of account-loss really is just factual.

2 Likes