bool Fun_New_Bar() { static datetime New_Time=0; bool New_Bar=false; if(New_Time!=Time[0]) { New_Time=Time[0]; New_Bar=true; } return(New_Bar); } .... if (tr>sd&&Fun_New_Bar()&&buy==0) ...
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
pls can someone tell me the code for new bar? Actually i know of this:
void Fun_New_Bar()
{
static datetime New_Time=0;
New_Bar=false;
if(New_Time!=Time[0])
{
New_Time=Time[0];
New_Bar=true;
}
}
But my problem is that i dont know if it is correct or not, and if it is correct, how am i going to refer to it ?
is it going to be in this form?
if (tr>sd&&New_Bar=true&&buy==0)
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point, TP,"F",0,0,Red);
}
THANKS