The reason why i use TimeToStr() is because i notice you can convert any time either to TIME_MINUTES, TIME_DATE or TIME_SECONDS (TIME_MINUTES convert the time to hours) if i had used TimeCurrent+3600, without #property strict it will just display series of numbers and with #property strict it will display the date, the hour, minutes and seconds thats what i don't want...i just want the time in hour thats why i use TimeToStr().r .
Nkechi Sonia Kanu: Hello Whroeder, i think i have done it base on your idea; but please don't be mad in case i didn't get it.
You got the time part right.
But, you are getting the oldest order(sym,mn) Not the lastest. You had correct code at #7 (initially zero, compare, remember newest.)
You should be able to read your code out loud and have it make sense. You would never write if( (2+2 == 4) == true) would
you? if(2+2 == 4) is sufficient. So Don't write if(bool == true),
just use if(bool) or if(!bool). Code becomes self
documenting when you use meaningful variable names, like bool isLongEnabled.
Long_Entry sounds like a trigger price or a ticket number and "if long entry" is
an incomplete sentence. "If it's been an hour" reads out loud correctly.
But, you are getting the oldest order(sym,mn) Not the lastest. You had correct code at #7 (initially zero, compare, remember newest.)
You should be able to read your code out loud and have it make sense. You would never write if( (2+2 == 4) == true) would
you? if(2+2 == 4) is sufficient. So Don't write if(bool == true),
just use if(bool) or if(!bool). Code becomes self
documenting when you use meaningful variable names, like bool isLongEnabled.
Long_Entry sounds like a trigger price or a ticket number and "if long entry" is
an incomplete sentence. "If it's been an hour" reads out loud correctly.
Thank You Whroeder1,
thank you so much.
when you say the newest order...i know your talking about for loop, that stuff always confuses me, i believe to get the newest order i should use this:
Nkechi Sonia Kanu: when you say the newest order...i know your talking about for loop, that stuff always confuses me, i believe to get the newest order i should use this:
It will be so rude of me not to thank you guys for helping out, though the problem isn't solved yet i have temporary abandon it, well for the time being, i hope somebody out there find a way to solve this problem.
Nkechi Sonia Kanu: It will be so rude of me not to thank you guys for helping out, though the problem isn't solved yet i have temporary abandon it, well for the time being, i hope somebody out there find a way to solve this problem.
However, this is still not going to solve your problem, because you are only looking at "closed" orders. You have to remember that there might also be orders that are still open.
So, here is the exercise for you. Show your attempt at how you would solve that part of the problem, and I will help you figure it out.
However, this is still not going to solve your problem, because you are only looking at "closed" orders. You have to remember that there might also be orders that are still open.
So, here is the exercise for you. Show your attempt at how you would solve that part of the problem, and I will help you figure it out.
I just tested it now and it WORKED, i just cant thank you enough, your indeed a fine programmer.
in other to solve the "opening and close other" stuff, should we be looking at the OrdersTotal() instead of the OrdersHistoryTotal()
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.
Displaying it is irrelevant. It's not doing what you think.
Stop thinking hours and start thinking time. bool ItsBeenAnHour = TimeCurrent() - LastOrderClosedTime > 3600;
Displaying it is irrelevant. It's not doing what you think.
Stop thinking hours and start thinking time. bool ItsBeenAnHour = TimeCurrent() - LastOrderClosedTime > 3600;
Hello Whroeder, i think i have done it base on your idea;
but please don't be mad in case i didn't get it.
Thank You Whroeder1,
Also i will try to use meaningful variable names along with simplicity in my coding.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 and MetaTrader 4 - MQL4 programming forum
Count how many lost orders from the last profit order - MQL4 and MetaTrader 4 - MQL4 programming forum
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 and MetaTrader 4 - MQL4 programming forum
Count how many lost orders from the last profit order - MQL4 and MetaTrader 4 - MQL4 programming forum
Please pardon my ignorance but are you saying i should use my code in #7 in my EA, that it is correct?
thanks for the links.
i believe once i read the links i should be good in history loop
I have finally done my best and its not working please find it in your heart to help me in what ever way a you can:
It will be so rude of me not to thank you guys for helping out, though the problem isn't solved yet i have temporary abandon it, well for the time being, i hope somebody out there find a way to solve this problem.
THANKS...
However, this is still not going to solve your problem, because you are only looking at "closed" orders. You have to remember that there might also be orders that are still open.
So, here is the exercise for you. Show your attempt at how you would solve that part of the problem, and I will help you figure it out.
However, this is still not going to solve your problem, because you are only looking at "closed" orders. You have to remember that there might also be orders that are still open.
So, here is the exercise for you. Show your attempt at how you would solve that part of the problem, and I will help you figure it out.
I just tested it now and it WORKED, i just cant thank you enough, your indeed a fine programmer.
in other to solve the "opening and close other" stuff, should we be looking at the OrdersTotal() instead of the OrdersHistoryTotal()
once again thank you.