"Check Age" for Pending Order based on Candle Time
-
Hi!
I want to check the age of a pending order and delete it after X candles for the Y time frame.
The block just allow to use it as time format.
And under the same subject : How set the expiration of a pending order after X candles?
these are just two different ways to do the same thing. But for some brokers, I believe that we must use "check age" block instead "expiration" .
-
You can try this, but willhave to adapt it to your project. I don't know how many other conditions should be taken into account.
-
Hi, @l-andorrà !
Thanks for your reply!
This is an interesting way to control the number of candle and I'm not aware about the "variables" and "constants" as you used in the blocks:

How you guys call it? I'll search in the forum for more details.
-
@eklonsousa Counting the bars is very useful trick, but it gets messy if you have multiple orders.
To get x candles expiration instead of x time expiration, I would just convert the desired bars to a time value , all the requirements are there.
https://docs.mql4.com/chart_operations/periodwindowClosed market will be a problem, though.
-
@roar Hmm.. You are right.
I'm testing my EA with the "Candle Expiration" method (I've used some similar as @l-andorrà posted) and I'm getting different and worse results.
But there is some markets as brazillian stock market that do not allow the use of "time expiration" . I'm not sure how they manage pending orders, but the "candle expiration" method can solve it.
I'll keep testing.
Thanks for your reply!
-
@eklonsousa Okay, thats interesting... Can you check the order age later on, with the pink block?

-
@roar I've found this way, but I didn't tested yet as it works like the traditional expiration time from pending order.
I'll test it and compare. Let's see how it will behave...