Yedelkin: Not quite. For for statement, you need to specify the type of variable i. To select a position - first use PositionGetSymbol(i), then - look through the properties of the selected position.
Thank you. Right?
int TotalBullPositions()
{
int Counter=0;
for(int i = 0; i < PositionsTotal(); i++)
{
if(PositionSelect(Symbol()))
{
if(PositionGetInteger(POSITION_MAGIC)==Magic && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
Counter++;}}
return(Counter);
}
the compiler will most likely generate a warning. It can be fixed by explicitly casting the PositionGetInteger(POSITION_TYPE) to the required enum type.
This line
for(int i = 0; i < PositionsTotal(); i++)
some programmers prefer to run in descending order instead of ascending one.
Addendum. Why did you change the correct line to if(PositionSelect(Symbol()))?
Yes, that's roughly the pattern. This line right here.
the compiler will most likely generate a warning message. It can be treated by explicitly casting the PositionGetInteger(POSITION_TYPE) to the required enum type.
This line
some people prefer to run in descending rather than ascending order.
Addendum. Why did you change the correct line to if(PositionSelect(Symbol()))?
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.
Not quite. For for statement, you need to specify the type of variable i. To select a position - first use PositionGetSymbol(i), then - look through the properties of the selected position.
Thank you. Right?
Thank you. Right?
Yeah, that's pretty much the pattern. This line right here.
the compiler will most likely generate a warning. It can be fixed by explicitly casting the PositionGetInteger(POSITION_TYPE) to the required enum type.
This line
some programmers prefer to run in descending order instead of ascending one.
Addendum. Why did you change the correct line to if(PositionSelect(Symbol()))?
Yes, that's roughly the pattern. This line right here.
the compiler will most likely generate a warning message. It can be treated by explicitly casting the PositionGetInteger(POSITION_TYPE) to the required enum type.
This line
some people prefer to run in descending rather than ascending order.
Addendum. Why did you change the correct line to if(PositionSelect(Symbol()))?
Thank you very much.
Changed to:
Or I'll change it to this one:
I'll check which option works.
Thank you.
Or I'll switch to this one:
I'll see which one works.
Now I have to take the signals from the indicator:
Doing this and it's not working.
Are you checking for invalidity of the handwheel?
Do you check for invalidity of the handl?
Yes, you already have a similar check, elsewhere:
If INVALID_HANDLE, print an error
Yes you already have a similar check, elsewhere:
If there is an INVALID_HANDLE, print an error
I'm completely exhausted. Doesn't open properly.
Doesn't read the indicator signals correctly.
Please help. Where is the error?