New Candle Open Price

 
Hello everyone. Please help me figure out the best approach to calculating the open price of every new candle. Thank you in advance.
 
  1. Wait for a new candle.

    For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.

    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              New candle - MQL4 programming forum

  2. Remember Bid or iOpen(…, 0). There is no "calculating."
 
William Roeder:
  1. Wait for a new candle.
  2. Remember Bid or iOpen(…, 0). There is no "calculating."
MQL5 please
 
Nelson Wanyama:
Hello everyone. Please help me figure out the best approach to calculating the open price of every new candle. Thank you in advance.

Example: Birth of new bar (  ).

How to start with MQL5
How to start with MQL5
  • 2019.08.18
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
 

Welcome to MQL5.

Try this and I guess you will get the answer.

#include<TradeAlgorithms.mqh>
CIsNewBar newbar;
void OnStart()
{
if(newbar.IsNewBar(NULL,0))
     {
        Print(iOpen(NULL,0,0));
     }
}
 
jaffer wilson:

Welcome to MQL5.

Try this and I guess you will get the answer.

Thank you
 
Vladimir Karputov:

Example: Birth of new bar (  ).

Thank you. Let me try these options
 
Nelson Wanyama: MQL5 please
Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help
          urgent help.

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

 
William Roeder:
Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help
          urgent help.

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

I'm a programmer, and allI needed were pointers. Please!
Reason: