Semionn: Greetings all, I have a question: is it possible to open a position at the close of a bar (working on 15-minute bars), if yes, how to implement it using mt4?
It is impossible to know if this is the last tick on this bar or not. It is better to open a position at the next bar opening.
Hi again, could you please tell me where there is a mistake in the following code ? I call the loop at the moment "deinit" The order deletes all but the last one. I think this line is most likely an error >> for (int i=1; i<=OrdersTotal(); i++) << However, logically everything seems to be correct... what did I miss ? Thanks in advance!
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.
Greetings all, I have a question: is it possible to open a position at the close of a bar (working on 15-minute bars), if yes, how to implement it using mt4?
It is impossible to know if this is the last tick on this bar or not. It is better to open a position at the next bar opening.
I need to calculate the volumes of all open by and sell positions
I try to do it, but it doesn't work(((
//+--2.1 determination of order quality
int vb=v,vs=v, io, ko=OrdersTotal();
for (io=0; io<ko; io++)
{if (OrderSelect(io, SELECT_BY_POS, MODE_TRADES))
if (OrderType()==OP_BUY) { vb=vb+OrderLots( ); // add buy volumes
}
if (OrderType()==OP_SELL ) { vs=vs+OrderLots( ) ; // add the sell volumes
}
}
Print("Orders buy ",Koob," by ",vb," lot," Sell orders = ",Koos," by ", vs," lot );
vb and vs sum of by and sell orders are always zeroed out for some reason
vb and vs the sum of by and sell volumes respectively are always zeroed out for some reason
Oh, Semyon Semyonych.
Thank you.
Guys help with the following question...
Is it possible to delete Global Variable (GlovalVariable) only if EA is deleted from chart ?
If yes, how ? Just by adding GlobalVariableDelete (name) to deinit, the variable is deleted when switching between Timeframes....
Guys help with the following question...
Is it possible to delete Global Variable (GlovalVariable) only if EA is deleted from chart ?
If yes, how ? Simply adding GlobalVariableDelete (name) to deinit deletes the variable when switching between Timeframes....
Analyse the reason for deinitialisation:
UninitializeReason()
Analyse the reason for deinitialisation:
UninitializeReason()
I call the loop at the moment "deinit"
The order deletes all but the last one.
I think this line is most likely an error >> for (int i=1; i<=OrdersTotal(); i++) <<
However, logically everything seems to be correct... what did I miss ?
Thanks in advance!
//-------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------