Initiating a trade in a shorter timeframe and at the same position as the detected position in the higher timeframe

 

Hi everyone,

How do I trade candles from a higher timeframe to a lower timeframe? I've researched on the forum, and I know that to switch timeframes, I should use ChartSetSymbolPeriod, but I'm really confused about what I want to do. For example, taking this example case (example.PNG attached)

Could someone please provide me with a simple example in MQL5 where it's reading candles on the H1 timeframe and when it detects the 3rd candle, it switches to the M15 timeframe and initiates the trade from that SAME POSITION as the 3rd candle on the H1 timeframe but in the M15 timeframe? Could someone please give me a simple example of this concept that I want to develop in the onTick method?

Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
  • www.mql5.com
ChartSetSymbolPeriod - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Files:
example.PNG  179 kb
 
  • 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.