How would I go about coding a strategy from MT5
You’re lucky in that these days you don’t need to know MQL5 that much, you can get away with a basic understanding. You can use ChatGPT to write most of it for you, although a word of caution with this, it will take a lot of back and forth and it gets it wrong a lot so you will need to understand where the errors are, but… you’ll learn a lot and you’ll have a custom built EA
I tried making an EA one time and I got really far until I encountered some error that made a function call for the high of the candle that a fractal formed on output the wrong data and that issue has existed since MT4
Try a demo of ProRealTime if you can find it, no coding required
Nice, I didn’t know they had a web version, even beta. I get it free through IG but if you click on the indicator icon top right, it should give you the option of creating a strategy, from there you can backtest, although not sure how much data they’ll give you.
I think backtesting is only available on the app version
Ah shame, it would make sense as the data is pretty expensive.
Expensive?
Why is it expensive
I’d recommend using ctrader instead. MT5 and 4 are inferior in every way.
You can manually backtest on there too. To automate it you can try a generator but probably need coding skills.
THANK YOU
I’ll try it out
I ran another backtest with even more interesting results
This one is different from the rest because I was basically trading against the trend but not really. In the other tests, I was trading on days where the daily candle colour corresponds with the trend.
So if the market is in a downtrend, I run the backtest on candle that are red (the market went down that day) but for this day, I traded on days that didn’t correspond to the trend so if the market was in a downtrend, instead of trading on white candles, I trade on green candles
Out of 31 trades, 20 were losses
If you were trading with an account of $700, you would have lost $415, but if you had all the losses at the beginning, you would have lost $1000
Interestingly, this backtest only spans over 3 green candles and in between them, there are 7 red candles
If you were able to make at least $100 on each of those days where the market went down (where there are red candles), you would have made $700
On the first green candle, there was actually a profit of $51. After the first green candle, there are 7 green candles, which bring the net profit up to $751.
Then there are the last two green candles, which have a combined loss of $506
Which brings the total net profit down to $245, which means the final account balance after 9 days is $945
So yeah, the strategy may be an unorthodox one with a very obvious weakness but when it works, it WORKS
Maybe, in the hands of someone more experienced than me, it could become something great
That sample size is still tiny. Has this got actual rules that you can write down, e.g do x when x happens? If so, I’ll put this into an EA over the weekend for you and backtest it properly if you’re happy to send me the details.
I’ll try to explain this as best I can.
I use 5 indicators, 9 SMA, 28 LWMA set to Typical Price, 200 EMA, Fractals and a Stochastic Oscillator using 16, 3, 3.
The first step determining the trend of the market. If the market is in an uptrend, the daily candle will close above the 9 SMA which is above the 28 LWMA which is above the 200 EMA
For a downtrend, I do the opposite
Once I have identified the trend, I will go to M1 and wait for the market to enter a downtrend (price is below the 200EMA)
Next, I wait for an up fractal to form and the main line of the stochastic oscillator is above the signal line and mark that level then I mark the next down fractal after it and mark that level (the way they are marked is important)
Next, if an up fractal forms below the level of the up fractal and the main line is above the signal line, you move the level for the up to the level of that candle. If a down fractal forms below the level of the previous down fractal what was marked and the stochastic oscillator us oversold, move the mark of the down fractal to that candle
Then you keep repeating this process over and over for as long as it keeps occuring
If price breaks above the level you marked for the up fractal, check the M2 timeframe, check the M10 timeframe and if the main line is above the the signal(even by .1), you enter the trade
In this case, price hit out SL which is set at the level of the down fractal with the spread added to it (for EUR/USD and GBP/USD, it’s usually 10)
When this happens, don’t delete the old zone until the conditions for zone formation are met.
If price crosses the level for the up fractal for the same zone, check if the main line is above the signal line for the M2 and if it is, check if the main line is above the signal line on M10
Wait for a new candle on the M10 to open before you enter the trade but if the M10 candle just opened (the time you checked corresponds with the interval of the M10 E.g. you check when the time was 12:00 or 12:10 or 12:30) you enter immediately
Usually when I do this, I open two trades. For one of them, I set the TP at an MA crossover and the other I set it at the difference between the close of the candle and level at the down fractal then subtract the spread from it (10) but you can use the price difference one then open it twice I guess
Any questions?
I have run another backtest and this one is the largest one yet
Starting on December 1, 2020, I ran this this test for 11 days (I accidentally skipped a few days because I took a break from backtesting after I had finished a day and then continued on a day that was 2 days ahead of it)
Out of 103 trades, 45 were losses
If you were trading with an account size of $700, you would have made triple of that in profit by the end of the ninth day
The most shocking part for me at least is that the strategy had a win rate greater than 50% because I thought that if I started stretching the amount of trades I take with this strategy, I would end up blowing the account.
The worst day was the 9th because for the first time, I saw price enter the zone, then break it so I said, "I should open more trades for more profit, " I did this 4 times, and they were all losses, so that day ended with a net loss of -$691.
I wanted to go as far back as 2010 but mt5 won’t let me cause of some weird chart restriction.
Could this strategy be the BOMB?
So, interesting observation.
I had a thought that maybe these weird zones I was using indicators to create may have some correlation to supply and demand.
So I found a setup, then went to the 10 minute timeframe to see if my theory was correct.
At the first arrow, it appears as if the zone is acting as a demand zone because price went to it and bounced back a little, then broke past the zone.
At the second arrow, the price appears to be exhibiting a “fakeout” (AKA fakey or false breakout), where it looks like price is going to break past the zone but ends up turning around instead.
At the third candle, we can observe what appears to be a proper supply zone, as price came into this zone but didn’t close in or below it after which the trend reversed.
At the fourth arrow, you can see that after price broke past the zone, it came back to it, and shockingly, it fell back with a bearish engulfing candle pattern and continued down for a few candles.
At the fifth and final arrow, after price had broken through the zone, it came back to it, and just like price entering a supply zone, it reversed and entered a heavy uptrend, which moved about 4900 points.
This zone appears to work all the way back to 2020
This may all be a coincidence since it goes against everything about supply and demand I’ve seen but maybe this is the new undiscovered way of drawing S&D zones
First successful trade with this strategy
I made 14 cents.
I’m so happy
I accidentally opened the trades on my demo account before realizing which means I could have made 25 cents instead
Just missed a setup
Would have been a potential 77 cent profit
Better luck next time