Automated Algorthmic Trading COLLABO!

Hey Trading Community.

Been conjuring up a way to turn my dream into a reality by engineering an automated forex trading solution!!!

I am currently trading an algorithm on 1-5 minute charts based on mean reversion and basic price action principles (mostly that of Bob Volman). Have a few variations of the strategies but its no ‘walk in the park’ to fine tune them and have them run efficiently and effectively.

Happy to collaborate with anyone who has a similar mindset and looking to dive deeper both in theoretical and practical application. Or otherwise feel free to drop a comment on any pertinent info that you feel may help in my venture.

Cheers! & Happy Trading ! ^-^

Hi there. Been trying to do the same, know how to write EAs now but tricky coming up with a profitable strategy.
Convinced it’s all to do with entry and exit points:

  1. So you don’t miss trades
  2. Give all your profit back before closing.
  3. Let your trade run sufficiently to get a good profit.
  4. Setting your SL not too high or low.

I’m working with ZigZag and Forex zone hours, max/min of London, NY etc which gives a lot of false signals as it redraws, but huge gains when the move is confirmed.
Toying now with the idea of a small SL, so when signal is good, there will be a big win. Small risk, big return…but lots of small losses…
Happy to share ideas and help with code.

1 Like

Hey @wwg completely feel you on that. The tech part (although at times rather tedious) is often the easier part. I personally have not written an EA for MT4 but instead hosted a node js application on a cloud platform provider (Heroku).

Long version: Leveraging the APIs of the broker Oanda, I was able to have the program constantly stream price, trigger, and lock in trades relative to changes in price in line with my strategy (Limit orders for entry and stop orders for stop/loss). Also noteworthy is that I connected it to a DB (Postgres) to run my own analysis. The code is written in JS although a move to python is desirable for longer time analysis (one day aspirations of connecting it to a data science channel).

Short version: Built the base platform to host my strategy from scratch instead of using a prebuilt application provider (including backtester). This enables flexibility such as custom alerting. Honestly may have jump the gun doing this lol but I am all about customization.

My strategies are based on the price action principles outlined by that of Bob Volman. Namely the principle of support/resistance & .50/.00 whole numbers && the build up needed to break away in line with the dominant pressure. It may sound complex but its fairly straightforward conceptually. One thing to note is that the algo is based on high percentage accuracy but smaller wins (lower RR i.e. < 1.0).

Would be great to have a sidebar conversation soon and if you are in alignment see if we can meet somewhere in the middle on the technology (which is secondary IMO).

Thanks for the reply!

Interesting what you say about high win rate but lower returns. Where does your drawdown fit into that? You don’t want one bad loss to counter all those smaller wins.!
I read a book a while ago that suggested using the baseball stat idea where a player that hits a lot of home runs, also gets a lot of strike outs. But that player wins a lot of games, especially if other batters are already on base.
So a lot of small losses are ok, as long as the wins are big. Conversely, the player that get a lots of hits, but just to first base, isn’t as valuable.

I mentioned in another thread that risk management is a portion of their bot/algo people often avoid or overlook. I guess I should have said portfolio and risk management to be more clear about the topic.

Winning bots do as @wwg said, they aim small and win big. They also analyze the account & portfolio of open trades as a whole to determine position sizing and risk. The ones I’ve been working on focus on:

  • limiting number of trades per day/week
  • tracking number of sequential wins & losses (hot streak, take a break. cold streak, take a break)
  • risk tolerant position sizing
  • drawdown limitation
  • loss per day/week limits
  • gain per day/week limits

Don’t be afraid to code your bot to cut losses and shut down all trades & positions if it’s not working. The 1st step in making profits is reducing losses. The entry & exit rules shouldn’t be difficult or take up a lot of space in your code. The management end… well… :smile: I’m learning how to build a function library now to cover all that.

thanks for your inputs @wwg and @FauxLife .

I currently have written an algorithm w/ the following details

To be frank it is a high win rate (80+) but the losses really hurt the potential profits that the algorithm gains. The premise is that price revolves around Round Numbers and Support/Resistance Zones. Thus once it breaks the zone it often times retests the same boundary (provided you gives it some breathing room on continuation). In essence you let price carry over through the area of interest and give it roughly 10 pips or 25% entrancement level to enter into the trade taking profit at the S/R and round number level.

The SL is a bit arbitrary as it could be the adjacent support/resistance level at there (25% marker) or a hard pip stop (lets say 40 pips). as you see the RR ratio can easily be <.30RR but with a hgh number of trades I found that this generates roughly 10-15% per year per pair (only tested with major currency pairs).

I agree that limiting number of trades per week and streaks are super important and it pays to focus more on the loses. Even more so I’ve already included one that shuts off as soon as 1 loses.

As you can see the risk management is definitely part of the algo but not as detailed as I would like (news reports, sudden dramatic changes etc). This obv requires substantial back testing and code inclusion.

I am not sure how to contact either of you privately to discuss this in greater depth but here is my email atrinidad316 at gmail

Happy to continue to go over the algorithm and some of the code (secondary) but its premise is as stated above.

To simplify things and make the process faster, I’d suggest doing it in TradingView’s PineScript and run execution to MT4 or MT5 via TradingConnector.

1 Like

Thanks @tomwis will definitely take it into consideration !

Have you thought about coding EA that contains Martingale and Currency Correlation so that it can sustain itself? I have been testing one EA, it is very profitable in ranging market. Even with small deposit. I want to test it when the market trends.
200 USD is enough for ranging market.
2000 USD may be enough for trending market. Just testing it yet.

Trinidad, do you have any way of backtesting your custom system? I’ve always written EAs in MQL4, but I’m contemplating switching to my own custom Python (possibly Lambda) solution as my next project. Like yourself, interested in incorporating ML. Take a look at TensorFlow. I think that’s going to be my first approach. Good Luck!