MT4 Script to Locate Highs and Lows on the Price Chart

Novice traders usually have a lot of problems locating the proper price highs and lows or peaks and valleys on the price chart to plot the support and resistance lines. They usually choose the wrong and weak highs and lows to plot the support and resistance lines, and so the lines they plot are mainly invalid.

This is a common problem among novice traders. Even experienced traders sometimes make mistakes in locating the proper highs and lows. It takes some time to train the brain and eyes to see the real and main highs and lows. Most of the time novice traders think that they have located a strong high and low, but they are wrong.

There are a few solutions for this problem when you are new to chart analysis. There are some tools that can help you to see the highs and lows properly. One of the easy to access tools is the ZigZag indicator. It is one of the default MetaTrader indicators.

To add the ZigZag indicator to your charts, just (1) open a price chart, and then (2) press Ctrl+N to open the Navigator, (3) open the indicators dropdown menu, (4) scrolls down and (5) drag and drop ZigZag to the chart:

ZigZag default settings is 12 which is a little fast. It means it locates the small and weak highs and lows which can cause you to make mistake in plotting the lines. You can use the larger settings like 24 or 36 to make the indicator locate the bigger and stronger highs and lows. Then you can connect the highs and lows with trend lines and have the support and resistance lines on your charts:

The other tool you can use is the scripts or indicators that mark the highs and lows on the price charts. You can download a sample of such a script here on LuckScout. Please note that this tool is a script that has to be installed in the scripts folder. It is not an indicator or Expert Advisor (robot).

1. Click Here to download the script file.

2. Run your MT4 platform.

3. Click on “File” menu at the top left of your MT4 platform.

4. Click on “Open Data Folder”.

5. Open the “MQL4” folder.

6. Open the “Scripts” folder.

7. Copy and paste the Highs_Lows.ex4 file you just downloaded to the “Scripts” folder.

8. Restart the MT4 platform.

9. Press Ctrl+N to open the navigator. Open the “Scripts” dropdown.

10. Double click on Highs_Lows:

11. Choose the “Common” tab and check the “Allow live trading” and “Allow DLL imports” on the opened dialogue box:

12. Click on the “Inputs” tab. As you see, the script default settings is 24. If you click on the OK button, the script marks the highs and lows with blue and red objects:

You can change the script settings to a larger number like 48 and so it will mark the stronger highs and lows. This helps you to locate stronger support and resistance lines on the chart, and so the trade setups will be stronger too. You can easily plot the support and resistance lines using the object this script places on the charts. Look how you could locate one of the strongest support lines, and so, one of the strongest support breakouts in the history of EUR/USD by using the Highs_Lows script:

This is how you can also locate the chart patterns using the Highs_Lows script:

Before you apply the script on a chart with a different settings, first you have to delete all the objects already placed on the chart by this script. The reason is that the script doesn’t remove the objects it has already placed on the chart and when you apply it on the chart again with a different settings, the new objects will be added to the previous ones and this makes you confused.

To remove the objects from the chart, you have to right click on the chart, click on “Objects List”. Then click on one of the objects and press Ctrl+A to select all objects. Click on the “Delete” button at the right and all the objects will be deleted.

To learn how to use this script, you can apply on different currency pairs charts and plot the lines. Share you charts here and ask for the others’ opinion about the support and resistance lines you locate.

Before You Read the Rest of This Article:
Submit your email to receive our eBook for FREE.
This eBook shows you the shortest way to achieve Success and Financial Freedom:

How Do You Like the Highs_Lows Script?

Thank you for voting
You have already voted on this poll!
Please select an option!

Published by

LuckScout Team

"Whether you think you can, or you think you cannot, you are right." - Henry Ford


  1. Hi

    I had no problem loading this tool – there is only a problem with the ‘traditional MACD’ – no need for reply, just letting you know – I am not really concerned about it because I am not using it.

    1. Hi Peter,

      I just installed it on my platform from the scratch. It works for me. May I see a screenshot from your platform Navigator area to see where the indicator is placed?

  2. Loaded fine. Can I ask what happens if all objects are not removed first?

    As I would have to remember where some historical trend lines where if I deleted them.


    1. If you run the script with 24 settings, and then run on the same chart with a different settings, then the previous objects will not be removed and the new objects will be added to them.

  3. Sorry to bother this morning but I do not understand: “Please note that …”

    Does this mean that in order to use the Zig Zag script all other scripts and indicators need to be removed?


  4. Hi
    you wrote: “To remove the objects from the chart, you have to right click on the chart, click on “Objects List”. Then click on one of the objects and press Ctrl+A to select all objects. Click on the “Delete” button at the right and all the objects will be deleted.”

    Another way is simply control B control A delete

  5. Hi & Co. — Thanks so much for the Highs & Lows script. It works very well and I don’t see anything about Zig-zag which improves on the script (maybe I’m missing something).

    At full screen you, of course, see a nice message “Learn mare about trading” — just want to mention that if you have multiple small windows open (I have 24), this message get repeated in each one of them and occupies a considerably higher %-age of real estate than a full-screen view of a particular currency paid.

    The efforts to educate that you make are so appreciated. Not only has this helped me learn … it’s also been very helpful in terms of improved results trading stocks.

    1. Pottorff

      Hi – to simply & quickly identify your comments – it may be easier to have your name listed fully – so if any other posts – we can differentiate.

    1. No. It places the objects right when you run it. It doesn’t move them after that. Of course if you apply it to the same chart while the script settings is changed, it will place the objects differently. But it doesn’t repaint.

  6. Hey,

    I am a little confused, only because I’ve seen you say in other articles that we shouldn’t use support/resistance lines.

    Is the is idea not to just use candlesticks and BB’s only??

    Thanks kindly,


    1. Hi Ben,

      I personally don’t use support/resistance lines to enter the market. However, I plot them on the charts to be aware of the market reactions in advance. A too strong candlestick signal that forms above a strong support levels is more reliable.

  7. Sir,
    Thank you for giving High low script and guiding us. When we run the script in the chart it shows the High and lows. After that as days past if any highs and lows formed in the chart it would be helpful if the Script automatically inserts the high/low mark in the chart. So that we do not want to manually Run the script once more to find if any High/low has been formed newly.

  8. Benedict

    Ctrl L – just adds or hides volume on my chart

    ctrl B A on keys and delete (using mouse)- only deletes all the objects on the chart – this includes the values printed on the chart by indicators – however the indicators quickly reappear.

    Indicators must deleted from the edit menu – right click – click INDICATORS – select INDICATOR and then DELETE.

  9. This is a good indicator for locating S&R trendlines …. but I am used to using Fractals… as it helps me to find the strong horizontal S&R lines as well Trendlines … I will try this indicator to see if it works better than what I am used to using …. Thank you for this contribution…!!

  10. Please and the LuckScout team, can we make this script an expert advisor so it can plot highs and lows automatically please please. It is very useful but it will perform better if automated, this is my humble request. Thank you.

  11. Or if I can get the mq4(source) file, I can a pay a programmer to develop it and then share it with the community free.

  12. I have contacted the programmer, he asked if the indicator repaints?I believe a non repainting EA works better right?

    1. If he wants to create an EA from this script, he has to do it in the way that when the new candlestick opens, it restarts the EA and the EA marks the highs and lows like what the script is doing now. It is not the matter of repainting with this script.

    1. Hey and Caleb,

      Was wondering if the EA is already shared with the community? Didn’t seem to find it anywhere on the website.

      Or probably because I am too new to this excellent page. Haha. Appreciate if you could hit us up with the EA.

      Many thanks in advance.

  13. Hi luckscout , caled 1 share an improve high_low indicator …. Can you please share a link of hints_lows indicator ( which was script before)

Leave a Reply

Your email address will not be published. Required fields are marked *