and I see in your updated code that you have completely ignored him.
When I see good advice get ignored, it makes me less inclined to waste my time helping that person as I will expect any advice that I give will also be ignored.
and I see in your updated code that you have completely ignored him.
When I see good advice get ignored, it makes me less inclined to waste my time helping that person as I will expect any advice that I give will also be ignored.
sorry for that then
I am terribly sorry
To tell the truth, I did not understand what he mean but terribly sorry all
static datetime barTime=0;
bool newBar=false;
datetime thisBarTime=Time[0];
if(barTime!=thisBarTime)
{
barTime=thisBarTime;
newBar=true;
}
if(newBar)
{
//Code to be executed only on a new bar here
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Your issue lies in the following line:
You call CheckForOpen every tick, your time_waiting resets upon each call. Maybe you should add a while-loop to wait for the time to pass.
Since you are using TimeLocal in your code, which uses the current computer time, I think you will not be able to backtest the code correctly.
it doesn't work too
updated code
No one reply here pffffffffffffffff
You have had a number of replies!
Nobody is obligated to help you.
I saw William's reply concerning
{if(Volume[0]>1) return;and I see in your updated code that you have completely ignored him.
When I see good advice get ignored, it makes me less inclined to waste my time helping that person as I will expect any advice that I give will also be ignored.
You have had a number of replies!
Nobody is obligated to help you.
I saw William's reply concerning
and I see in your updated code that you have completely ignored him.
When I see good advice get ignored, it makes me less inclined to waste my time helping that person as I will expect any advice that I give will also be ignored.
sorry for that then
I am terribly sorry
To tell the truth, I did not understand what he mean but terribly sorry all
Checking for a new bar is very simple
static datetime barTime=0; bool newBar=false; datetime thisBarTime=Time[0]; if(barTime!=thisBarTime) { barTime=thisBarTime; newBar=true; } if(newBar) { //Code to be executed only on a new bar here }