higher timeframe candle data to open orders on lower timeframe of the same symbol

 

I would like to use the H4 high or low of the current candle to open a buy or sell order on the M5.  Is this possible?

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
Trade Orders in DOM - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
James McBryde: Is this possible?

Perhaps you should read the manual. Timeseries and Indicators Access. What is the second argument?
   How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

 
William Roeder:

Perhaps you should read the manual. Timeseries and Indicators Access. What is the second argument?
   How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

Thanks William Roeder.  The sun is still shining over here.
 
James McBryde: I would like to use the H4 high or low of the current candle to open a buy or sell order on the M5.  Is this possible?

Yes, obviously!

  • For manual trading, search the CodeBase (or Market) for indicators displaying H4 Pivot Points.
  • For MQL coding, you can use for example the iHigh() or iLow() functions with PERIOD_H4, but there are other ways to accomplish the same goal, so follow up on the links provided by William's post.
 
Thank you Fernando for your reply to my post but I didn't explain it correctly.
Fresh new candle on H4 and as soon as the Close[0] go below Open[0] . A sell order is open on the M5. Is this possible in MQL4 or MQL5


Fernando Carreiro:

Yes, obviously!

  • For manual trading, search the CodeBase (or Market) for indicators displaying H4 Pivot Points.
  • For MQL coding, you can use for example the iHigh() or iLow() functions with PERIOD_H4, but there are other ways to accomplish the same goal, so follow up on the links provided by William's post.
 
James McBryde: Thank you Fernando for your reply to my post but I didn't explain it correctly. Fresh new candle on H4 and as soon as the Close[0] go below Open[0] . A sell order is open on the M5. Is this possible in MQL4 or MQL5

Lets clear a few things up first.

  1. Orders are not associated with any time frame. It does not matter what time-frame is active on the chart, be it H4 or M5 or any other. They are just orders that generate deals that generate positions. If you have more than one chart open on different time-frames but all on the same symbol, then any orders or positions will appear on all of those charts at the same time.
  2. So if you are looking to place an order when the "close" of the current H4 bar falls below the "open" of the current H4 bar, then you can place the order on any chart irrespective of time-frame of that chart.
Reason: