- Checking Support & Resistance Levels
- Does anyone have a support and resistance EA?
- Euro Rat
There are functions in MQL4/MQL5 that can identify the highest or lowest price in a candle, and so you code it in a way that you can search the highs and lows in the last X candles - thus identifying your last support/resistance.
I was wondering if there was a way the ea can plot support and resistance by itself and trade it base off of candlestick pattern. But mostly wanted to know about how to code a Ea that plots support and resistance.
There are functions in MQL4/MQL5 that can identify the highest or lowest price in a candle, and so you code it in a way that you can search the highs and lows in the last X candles - thus identifying your last support/resistance.
Look at this Youtube tutorial for an example
My logic in my code right now is this
Step1. Scan for 100 candlesstick or more from the past
Step2. Collect and store the date of all 100 to find out the high of each candlestick(Still dont know how i would do that,)
Step3. Go through all the candlestick high data and find the one that are near each other
Step4. Plot HLine
I got step one, Im having trouble understanding how i would store the values, probably most likely in a array(Just dont know how to store the data into array). Now the second problem im having is how would i code it where i would be able to find which candlestick high are close to each other in order to plot the HLine.
My logic in my code right now is this
Step1. Scan for 100 candlesstick or more from the past
Step2. Collect and store the date of all 100 to find out the high of each candlestick(Still dont know how i would do that,)
Step3. Go through all the candlestick high data and find the one that are near each other
Step4. Plot HLine
I got step one, Im having trouble understanding how i would store the values, probably most likely in a array(Just dont know how to store the data into array). Now the second problem im having is how would i code it where i would be able to find which candlestick high are close to each other in order to plot the HLine.
I was wondering if there was a way the ea can plot support and resistance by itself and trade it base off of candlestick pattern. But mostly wanted to know about how to code a Ea that plots support and resistance.
1st: (if you already know how to plot objects onto the chart).
Use:
iHighest for resistance levels. (function returns the highest candle out of a specified amount of bars)
iLowest for support levels. (function returns the lowest candle out of a specified amount of bars)
2nd:(if you don't posses the knowledge on how to plot objects onto the chart)
Use:
This page from Mql4 Book on "Graphical Objects" because it teaches you how to plot objects onto the "sub-window" or "main-chart".
However, in order to properly know-how to plot objects, you must already possess clear knowledge on how arrays work. Refer to this pages from Mql4 book: (Arrays)
and mql4 documentation (Array Functions).
Important: As a New Coder, I've come to realize that trying to learn how to code by copying others code, requesting code, or simply seeking out answers from the Forum, is not
a rewarding approach to learning coding. In contrary, I've learned tons of accurate coding information from simply reading the Mql4 documentation and Mql4 book respectively.
These sources are extremely valuable in teaching one how to be self-reliant, but in the instant any concept found within these referenced, appear unclear or vague, this is when I feel clarity should be sought from others in the forum who possess deeper insight.
(In my opinion). Best regards.
- docs.mql4.com
1st: (if you already know how to plot objects onto the chart).
Use:
iHighest for resistance levels. (function returns the highest candle out of a specified amount of bars)
iLowest for support levels. (function returns the lowest candle out of a specified amount of bars)
2nd:(if you don't posses the knowledge on how to plot objects onto the chart)
Use:
This page from Mql4 Book on "Graphical Objects" because it teaches you how to plot objects onto the "sub-window" or "main-chart".
However, in order to properly know-how to plot objects, you must already possess clear knowledge on how arrays work. Refer to this pages from Mql4 book: (Arrays)
and mql4 documentation (Array Functions).
Important: As a New Coder, I've come to realize that trying to learn how to code by copying others code, requesting code, or simply seeking out answers from the Forum, is not
a rewarding approach to learning coding. In contrary, I've learned tons of accurate coding information from simply reading the Mql4 documentation and Mql4 book respectively.
These sources are extremely valuable in teaching one how to be self-reliant, but in the instant any concept found within these referenced, appear unclear or vague, this is when I feel clarity should be sought from others in the forum who possess deeper insight.
(In my opinion). Best regards.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use