kennyhubbard:
Remove the above line. Volume[] is unreliable.
Remove the above line. Volume[] is unreliable.
still cannot, in early stage it suppose to have "Waiting for new bar". but, it alert when EA attach "New bar just Exist" when EA bee attach. pls help. yaiks..
We did this already in your other thread. Read the rest of the post and my point that Volume[] is unreliable along with code to solve it...
https://www.mql5.com/en/forum/128117
V
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
My code :
//| my_bar_change.mq4 |
//| Copyright © 2010, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
bool b_Check_New_Bar=false;
b_Check_New_Bar = Function_New_Bar(); // Function call
if (b_Check_New_Bar==false){
Alert("Waiting for new bar");
}else{
Alert("New bar just Exist.");
}
//----
return(0);
}
//+------------------------------------------------------------------+
bool Function_New_Bar(){
if(Volume[0]>1) return(false);
static datetime f_New_Time = 0;
bool f_New_Bar = false;
if (f_New_Time!= Time[0])
{
f_New_Time = Time[0];
f_New_Bar = true;
Alert(Time[0]);
}
return(f_New_Bar);
}