How to search for candle patterns on lower timeframes contained within a single candle in MQL5? - page 2

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You asked me why I chose the candle on H1. I haven’t been able to figure out coding this. I manually picked it out from looking at the charts. I realised that when the upper wick is sizeable then the it is more likely that the conditions are satisfied.
Read the help again:
Forum on trading, automated trading systems and testing trading strategies
How to search for candle patterns on lower timeframes contained within a single candle in MQL5?
Vladimir Karputov, 2021.01.13 06:51
You need to work with the CopyRates function (apply the third form - request from time to time).
Use the opening time of candles on a higher timeframe as the start and end time.
Here it will be like this: 'timeframe' is the timeframe on which you will search for the pattern (for example, it will be PERIOD_M15). 'start_time' and 'stop_time' - opening time of candles from the PERIOD_H1 timeframe
as you can see, to get OHLC data you need parameters 'start_time' and 'stop_time'.
Why did you choose this particular candlestick on the H1 timeframe:
Read the help again:
as you can see, to get OHLC data you need parameters 'start_time' and 'stop_time'.
To be honest with you, I am having difficulty understanding how to set the CopyRates for my problem. I am definitely looking at searching the charts for the index 1 candle when it closes every hour to see if it satisfies my condition
Clear.
We work on H1 and only at the moment of the birth of a new bar. On H1 candlestick # 1 is bullish, on M30 and on M20 candlestick # 1 is bearish. The code:
put a breakpoint here:
and the result is:
Clear.
We work on H1 and only at the moment of the birth of a new bar. On H1 candlestick # 1 is bullish, on M30 and on M20 candlestick # 1 is bearish. The code:
put a breakpoint here:
and the result is:
Clear.
We work on H1 and only at the moment of the birth of a new bar. On H1 candlestick # 1 is bullish, on M30 and on M20 candlestick # 1 is bearish. The code:
put a breakpoint here:
and the result is:
Thanks once again. I have been trying to figure out how to extend this so that it does not only show the last but one bar that satisfies the condition but it also shows previous bars for the past 3 days that satisfied the condition. I will mark previous regions with a rectangle on the chart. How will I go about making these changes?