Discussing the article: "Mastering Market Dynamics: Creating a Support and Resistance Strategy Expert Advisor (EA)"
Great article, thank you for your work.
I would like to clarify the use of the term "break"
Conventionally, when something is broken, it no longer works. In the case of trading, if a support level is broken, it's possible for its role to change to resistance, or could become invalid depending on the price action as price continues downward
When I think of price "breaking" a level, it means to cross it, either from low to high in the case of a potential long, or from high to low, in the case of a potential short.
From your use of the term "break", I'm assuming you mean "bounce". In regards to your blueprint, I believe the term "bounce" is more apropos. For example, if price is above a support level, moves down toward it and breaks it, I imagine price continuing downward, past the support level. In that instance, I would prefer going short, because the break of support can be a good signal to do so. On the other hand, if price does indeed bounce off a support level, I imagine price coming down to the support level from above, meeting it in some relative way, then resuming its upward path.
This strategy looks very interesting. Regarding the code, what is the entry criteria? And how are the stop loss and take profit levels calculated? Thanks.
if (open1 > close1 && open1 < ResistancePriceLevel && high1 > ResistancePriceLevel && Bid < ResistancePriceLevel){ Print("$$$$$$$$$$$$ SELL NOW SIGNAL!"); obj_Trade.Sell(0.01,_Symbol,Bid,Bid+350*5*_Point,Bid-350*_Point);
if (open1 < close1 && open1 > SupportPriceLevel && low1 < SupportPriceLevel && Ask > SupportPriceLevel){ Print("$$$$$$$$$$$$ BUY NOW SIGNAL!"); obj_Trade.Buy(0.01,_Symbol,Ask,Ask-350*5*_Point,Ask+350*_Point);
Great article, thank you for your work.
I would like to clarify the use of the term "break"
Conventionally, when something is broken, it no longer works. In the case of trading, if a support level is broken, it's possible for its role to change to resistance, or could become invalid depending on the price action as price continues downward
When I think of price "breaking" a level, it means to cross it, either from low to high in the case of a potential long, or from high to low, in the case of a potential short.
From your use of the term "break", I'm assuming you mean "bounce". In regards to your blueprint, I believe the term "bounce" is more apropos. For example, if price is above a support level, moves down toward it and breaks it, I imagine price continuing downward, past the support level. In that instance, I would prefer going short, because the break of support can be a good signal to do so. On the other hand, if price does indeed bounce off a support level, I imagine price coming down to the support level from above, meeting it in some relative way, then resuming its upward path.
Sure. Thanks.
Please clear up a confusion regarding the use of `pricesHighest` and `pricesLowest`
Are these meant to hold the highest highs and the lowest lows, OR, the lowest highs and the highest lows?
Thanks in advance.
A caution regarding the use of ArraySort with arrays that have been modified using ArraySetAsSeries:
If an array is modified via ArraySetAsSeries, ArraySort will sort the array in DESCENDING order!!
To get ASCENDING order, pass the array to ArrayReverse. From there, one can get the first 10 elements easily:
ArrayRemove(myArray, 10, WHOLE_ARRAY);
Thanks and happy coding.
A caution regarding the use of ArraySort with arrays that have been modified using ArraySetAsSeries:
If an array is modified via ArraySetAsSeries, ArraySort will sort the array in DESCENDING order!!
To get ASCENDING order, pass the array to ArrayReverse. From there, one can get the first 10 elements easily:
Thanks and happy coding.
I can't edit my original post, so replying here. I will try to clarify.
The original intention was to get the lowest n number of prices from a series. After setting the array 'as series' with ArraySetAsSeries and using ArraySort, the array of prices were in descending order. I was expecting them in ascending order, according to the ArraySort docs. So I put the sorted array through ArrayReverse to put the prices in ascending order. Then I use ArrayRemove to remove everything but the first n items. (in the case of my example, n = 10).
Anything still amiss?
Thanks for the feedback
A caution regarding the use of ArraySort with arrays that have been modified using ArraySetAsSeries:
If an array is modified via ArraySetAsSeries, ArraySort will sort the array in DESCENDING order!!
To get ASCENDING order, pass the array to ArrayReverse. From there, one can get the first 10 elements easily:
If you already use ArraySetAsSeries for changing logical direction of the array, there is no need to use ArrayReverse - much more efficient and logical way is to call ArraySetAsSeries again reverting the direction flag.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Check out the new article: Mastering Market Dynamics: Creating a Support and Resistance Strategy Expert Advisor (EA).
A comprehensive guide to developing an automated trading algorithm based on the Support and Resistance strategy. Detailed information on all aspects of creating an expert advisor in MQL5 and testing it in MetaTrader 5 – from analyzing price range behaviors to risk management.
The description of the Support and Resistance strategy revolves around its application in trading scenarios. Support levels typically indicate a lower boundary that the price struggles to break through, suggesting a concentration of demand, while resistance levels represent an upper boundary indicative of a concentration of supply. Buyers typically enter the market at support levels, and prices are likely to rise, therefore it is a good time for traders to think about buying or going long. On the other hand, sellers enter the mix at resistance levels, and prices may drop, allowing traders to sell or go short. Here is a visualization of what we mean.
Market entry is always dynamic and depends on one's taste and preference, though there are two basic ways of trading the levels. Some traders prefer to trade the bounce by buying when the price falls towards support levels and selling when the price rises towards resistance levels. Conversely, other traders prefer to trade the break by buying when the price breaks up through resistance levels and selling when the price breaks down through support levels. Hence, one can either Fade the Break or Trade the Break.
Author: Allan Munene Mutiiria