i have a question about reading Bid value inside script, which is run with infinite loop. When i run this script:
int start()
{
while(true)
{
Print("Bid:",Bid);
Sleep(10000);
}
return(0);
}
it takes Bid value from the moment when script was started, and isnt refreshing it.
When i use:
int start()
{
while(true)
{
Print("Bid:",MarketInfo(Symbol(),MODE_BID));
Sleep(10000);
}
return(0);
}
it takes current Bid value in every loop pass, so it works ok, but i need to have the first example working .
My goal is to run script as EA on offline chart with nonstandard time frame, and i think when i'll be able to get current Bid value in every loop pass i will be able to do this. Script which is run like this, also reads indicators value only on the moment when script is started, and also doesnt refresh them inside loop.
Does anyone has an idea how to circumvent this, and make script reading current values every time inside loop? I'm struggling with this for some time....
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.
hi
i have a question about reading Bid value inside script, which is run with infinite loop. When i run this script:
it takes Bid value from the moment when script was started, and isnt refreshing it.
When i use:
it takes current Bid value in every loop pass, so it works ok, but i need to have the first example working .
My goal is to run script as EA on offline chart with nonstandard time frame, and i think when i'll be able to get current Bid value in every loop pass i will be able to do this. Script which is run like this, also reads indicators value only on the moment when script is started, and also doesnt refresh them inside loop.
Does anyone has an idea how to circumvent this, and make script reading current values every time inside loop? I'm struggling with this for some time....
regards
oromek