[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 602
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
Please advise where to look to see how the condition "If the last take profit deal was > 0 then...." is coded.
i.e. accounting for trades already closed (automatically) .
https://www.mql5.com/ru/forum/131859
https://www.mql5.com/ru/forum/131859/page4#434230
Function isCloseLastPosByTake().
This function returns a flag to close the last position by Takei. Flag is raised - True - TakeProfit has triggered. Flag lowered - False - position was closed due to another reason. A more accurate selection of positions to be considered is specified using external parameters:
https://www.mql5.com/ru/forum/131859
https://www.mql5.com/ru/forum/131859/page4#434230
The isCloseLastPosByTake() function.
This function returns a flag to close the last position by Take Profit. Flag is up - True - TakeProfit has triggered. Flag lowered - False - position was closed due to another reason. A more accurate selection of positions to be considered is specified using external parameters:
Thanks, I came across KIM's Libraries myself...(Comrade Kim apparently like MARX of the forex world - wrote CAPITAL...and we all quote it now (i.e. insert it into our EAs)) .... there are "flags" of recent trades in different variations...
except I have never used # includ-....
can you explain in a nutshell?
at the top I write # includ (file name mqh)
But in the code? just where do I put the function ?
GetTypeLastClosePos ();
and then what ?
WHAT of this will return the type of position to me ?
OrderType() ?
i.e. then if(OrderType() ==TRUE ) do this and that... right?
Thanks, I myself came across KIM's Libraries ... (Comrade KIM probably wrote CAPITAL like MARKS of the Forex world ... and we all quote it now (i.e., insert it into our Expert Advisors) ...) there are "flags" of recent trades in different variations...
except I've never used # includ-....
can you explain in a nutshell?
at the top I write # include (file name mqh)
But in the code? just where do I put the function ?
GetTypeLastClosePos ();
and then what ?
WHAT of this will return the type of position to me ?
OrderType() ?
i.e. then if(OrderType() ==TRUE ) do this and that... right?
The functions should be inserted after return(0);
The GetTypeLastClosePos() function will return 0 if there was a buy, and 1 if there was a sell, or -1 if there was nothing in the history.
The function must be inserted after return(0);
The GetTypeLastClosePos() function will return 0 if there was a buy and 1 if there was a sell, or -1 if there is nothing in the history.
Got it, thanks.
And yet, if the function is in a #include file, then how should it be handled?
Got it, thanks.
and yet, if the function is in a #include file, then how do you dispose of it?
how do you understand #include?
Like in the doc or in your own way?
I need the owl to put a pending order exactly on the opening of a candle on D1.
I have written a function:
The compiler frowns:
Everyone has brackets. This is strange. If this function is commented out, the code compiles without errors. What may be wrong?
Am I correct in writing the function to open only at opening price of a daily candle?
hoz:
Everyone's brackets are there, it's strange.
and maybe don't say the word "weird" when it comes to the compiler. Of course, it's hard to see the log in your own eye :)
And did I actually write the correct function to open only at the opening price of the day's candle?
The developers had nothing to do with it. :__
Instead of ( Hour()>=10 || Hour()<20 ) you should have made it simple Hour()>=10 && Hour()<20
and everything worked
The question is not that it worked, but that if the help is written correctly, it should not work.