Mql5 EA coding - How to check previous two candles if bullish or bearish

 

Hello everyone.

Am new to MQL5, please can someone show me some mql5 code that can do the following:

  1. pick the first candle of the day, check if it's bullish or bearish. Let's call it candle A
  2. If candle A is bullish then check the previous two candles to it if they are both bearish. If yes, then open a buy pending order at the high of candle A and a sell pending order at low of candle A. 
  3. If candle A is bearish then check the previous two candles to it if they are both bullish . If yes, then open a buy pending order at the high of candle A and a sell pending order at low of candle A. 
  4. Check all candles until the close of day for this condition and execute a trade where candles meet the conditions as true. 
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.

  • Usually people who cannot code do not 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.
  • 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).
  • Finally, you also have the option to hire a programmer in the Freelance section.
 
yuddy7: please can someone help me with mql5 code that can do

Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
          No free help (2017)

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2018)

We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
          No free help (2017)

 
Like I said, I'm new to the entire mql 5 world. This is a training process I'm in. 
 
yuddy7 #:
Like I said, I'm new to the entire mql 5 world. This is a training process I'm in. 

Doesn’t look like a training process to me. First show your attempt and someone (if you are lucky), will answer

Reason: