Coding challenges

Hey all,

Recently I took the decision to learn MQL5 in order to transition to Algo trading (obviously), my knowledge is very basic right now but I feel I have enough knowledge to have a go at coding some strategies.

I would greatly appreciate if anyone can offer up simple strategies for me to put into MQL5 and ill get to work. When I feel it is complete enough I’ll post them here :slight_smile:

Hi @KianMcGrath
You can always prepare yourself building blocks for your strategies, if there are no volunteers with strategies :slight_smile:
ie. create function to calculate position size, create functions to identify candlestick patterns, create function to identify crossovers (MA, oscillators etc.), create function to trail stop in various ways (MA, fixed, ATR, low from N candles etc.), create function to breakeven, create function to close all long/short trades, create function to calculate unrealized Gain/Loss - usually strategies consist of similar elements - you have your money management, entry signal, trade management and exits. Having ready to use blocks will make your life easier, because if you go automated trading route, you will code A LOT of different strategies :slight_smile:

Hope this helps.

1 Like

It is obvious to say that if a trader knows how to code, he can do quite good in the market. Automated trading has become quite popular among the traders who can’t sit in front of their systems throughout the day. For such traders, automated trading gives an option to code their systems in accordance with their trading requirements and goals.

1 Like

Try looking at some basic trading strategies and work with them. This will help you get a trial of how they will work with you. You can look at price action, range trading, trend trading, etc.

Don’t know if this is helpful or not, but the conditions I’m triggering EUR/USD H1 trades on currently are:

Long
Current price is higher than highest highs of last 2 periods AND
Lows of last 2 periods are not lower than highs of the two periods before them AND
Price is above the first upper standard deviation Bollinger band AND
Price is above 100 period MA AND
ADX is greater than 20 AND
Second standard upper deviation Bollinger band is at least 30 pips away from first OR has widened by at least 12 pips since period open

Short
Current price is lower than lowest lows of last 2 periods AND
Highs of last 2 periods are not higher than lows of the two periods before them AND
Price is below the first lower standard deviation Bollinger band AND
Price is lower than 100 period MA AND
ADX is greater than 20 AND
Second standard lower deviation Bollinger band is at least 40 pips away from first OR has widened by at least 12 pips since period open

I’ll make lot size based on a percentage of my account balance, so it straps up as it wins. Tier 1 take profit is price plus the distance between the first and second Bollinger bands. Stop is usually the opposite direction’s 2nd standard deviation Bollinger band, but I’m playing with making that a fixed, smaller size on trades with very wide bands.

Obviously there’s the whole open order/exit management part, and other things like the fact that this only trades between certain hours (8-19 on my market servers). You don’t have to do this exactly, but maybe gives you some ideas to play with. Cheers and welcome to the jungle!