Tracking the last bull/bear candle
- Collecting Statistic : Hourly Candles
- Multi Timeframe Indicators
- Need Help to make this indicator works
- Usually people who can't code don't receive free help on this forum.
- If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
- To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
- If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
- Finally, you also have the option to hire a programmer in the Freelance section.
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
input ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // EA Timeframe double Close = iClose(_Symbol,TimeFrame,1); double Open = iOpen(_Symbol,TimeFrame,1); if(Close >Open) { // BUY SIGNAL } if(Open<Close) { // SELL SIGNAL }
I think this will do the job.
- Usually people who can't code don't receive free help on this forum.
- If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
- To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
- If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
- Finally, you also have the option to hire a programmer in the Freelance section.
Hello,anyone who knows how to track the last bull/bear candle? I kindly ask for your help.
i see you have something similar like Engulf. these codes are freely available on codebase which you can modify and help yourself
No it wont do the job. check the op's requirement he mentions last candle.
something like this may work.
input ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // EA Timeframe double last_Close = iClose(_Symbol,TimeFrame,2); double last_Open = iOpen(_Symbol,TimeFrame,2); double cur_Close = iClose(_Symbol,TimeFrame,1); double cur_Open = iOpen(_Symbol,TimeFrame,1); if(last_Close < last_Open /* if prev candle is bear*/&& cur_Close > cur_Open /* if current candle is bull*/&& cur_Close > last_Open /* if a closing is detected above bear candle */ ) { // BUY SIGNAL } //vice versa for sell
Additionally as per screenshot of Op, it looks like he wants to have a closing of bull above bear but its not the last candle. In this case he may have to store the info of candles in array and look for closing for n candles and break the loop or empty the array when a close is above bear found.
- www.mql5.com