The Holly grail of trading robots
Please leave your comment below. Critique is highly welcome while I code the system into an expert advisor let's discuss
Here's what I think... but take it with a grain of salt because you have to verify everything for yourself and come up with your own conclusions:
1) Understanding liquidity is important so you're on the right path. All markets exist to create liquidity and this is usually done by manipulating human emotions so if you can begin to understand how emotions are manipulated and how this has an impact on liquidity, you might become skilled at identifying profitable price action patterns that are common to all markets and know when they are worth trading.
2) There is no such thing as a holly grail robot. There can certainly be a benefit to building robots but I personally believe humans can do a better job since the markets are always a representation of human emotion which makes us better at understanding context. So you can try to build a robot and you might find success, but don't think there is a such a thing as a robot that will always have success in the market and be able to adapt to changing market conditions as well as you would be able to do it through your own analysis.
3) Personally, I think looking at liquidity is easier when part of a price action trading strategy based on a discretionary approach because it has a lot to do with human emotions and this is hard, if not impossible, to code in a robot. But that's just my opinion, so if you want to try to code a robot that can do it, I wish you good luck and great success!
Here's what I think... but take it with a grain of salt because you have to verify everything for yourself and come up with your own conclusions:
1) Understanding liquidity is important so you're on the right path. All markets exist to create liquidity and this is usually done by manipulating human emotions so if you can begin to understand how emotions are manipulated and how this has an impact on liquidity, you might become skilled at identifying profitable price action patterns that are common to all markets and know when they are worth trading.
2) There is no such thing as a holly grail robot. There can certainly be a benefit to building robots but I personally believe humans can do a better job since the markets are always a representation of human emotion which makes us better at understanding context. So you can try to build a robot and you might find success, but don't think there is a such a thing as a robot that will always have success in the market and be able to adapt to changing market conditions as well as you would be able to do it through your own analysis.
3) Personally, I think looking at liquidity is easier when part of a price action trading strategy based on a discretionary approach because it has a lot to do with human emotions and this is hard, if not impossible, to code in a robot. But that's just my opinion, so if you want to try to code a robot that can do it, I wish you good luck and great success!

- Free trading apps
- Free Forex VPS for 24 hours
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Here's the strategy
I'm not the best developer when it comes to mql5.
But I'll try my best to write good code for this
I'll make use of the zigzag indicator only
Case Study; Sell
assuming price is currently at point 0
1 verify if points 0 is a high or a low
2 Store the values of the last 10 zigzag points
3 define each high points in the array and the
lows points in the array
We need to store the price values of some points as it is
important for future use
* compare the lows (using price the y-axis) and get the lowest
price. Save the price into a double variable say lowestPricePoint
** Read the price value of point 0 and store that in a variable
say lastZeroPrice
Validating a sup or dem
4 using the highs only; check for the following;
* using the price (y-axis), If the next point following a
high point is less than the previous low point
if true in any case, 1<3 3<5 5<7 7<9
** assign the price value of the high in step to a
variable say (entryArray) In this example point 4,6 will be
stored in our variable
as we can see point 8 is technically a valid supply
so we introduce a new check; if there is a consecuative lows,
ie point 7>5 & 5>3 validate point 8 as a valid supply
so our new variable (entryArray will have 4,6,8 price) as values
5 Now we have a valid supply, check (using price y-axis) if point 0
is greater than the value stored in the variable stored in
step 4 ** entryArray
6 Using bar control, if a candle close below any of the prices in
our variable array in step 4** entryArray open a sell trade.
7 Modify the sl and tp of the trade as follows
first lets define a fixed variable say slBuffer (To accomodate spreads)
sl = lastZeroPrice + slBuffer
tp = lowestPricePoint
Risk Reward.
using this approach you can run into a situation where sl is > tp.
We dont want that.
Now we do a check before opening a trade.
Find the difference
* each price in entryArray - lastZeroPrice and the store
the value in a defined variable say slDifference
** lowestPricePoint - each price in entryArray store that in a
variable say tpDifference
*** slDifference and tpDifference should have the same index numers
Check for each index in the two arrays if
slDiffference > tpDiffernce. If the result if positive return a
boolean value of false else return true
using this check we can call it before opeing a trade in step 7
Now you should have this the yellow lines are the entries, aqua line TP for all positions, SL is all above point 0
Case Study Buy
the reverse of the sell
Please leave your comment below. Critique is highly welcome while I code the system into an expert advisor let's discuss