Repeat lot size of deleted panding order
-
hi
please help with my EA, I have made an EA that place pending order. I want the EA to delete previous pending order if it is not activated, when conditions changes to suit another order E.G EA place pending order with 0.01 lot size when 5MA passes 20 MA. if it is not activate and the condition has changed to 20MA passes 5MA. Delete the previous pending order and place the new order with the same lot size. but if the pending order is activate . the next pending order lot size must increase the lot size. e.g sell pending order 1 with lot 0.01 , not activated delete and place buy pending order with the same lot of 0.01. if one of this is activated the next order must increase the lot size. please help -
@lali
Hello,Part 1: Place a delete pending orders before the pending order itself. I believe this is what you need from what I understood.

Part 2: Place a variable in the volume field and with each trade add to that variable. 2 things to keep in mind though which are the block numbers be in order, and that you will need to place block 11 somewhere in your strategy where you want it to reset the lot back to 0.01

-
Thank you for reply. please help with this part. I want lot size to repeat e.g if the pending order was 0.06 and is not activated the next order must be still 0.06 until it is activated. the deleted pending order will have different lotsize but i always want the next pending to be the same lot as the deleted pending lot size.
thanks -
@lali You will need another variable to store that lot size value, but you will need to distinguish that tha trade was not activated.
-
Hi, will you please assist me with the blocks on how to distinguish if trade was not activated.
Thanks -
@lali Can you please share the link to your project?
-
Hi.
https://fxdreema.com/shared/qL1ATdk5
my EA -
@lali Ok. So what you want is to store only the lot size of the last closed trade. Correct? Not the last deleted pending order but the last open trade. Am I right?
-
I want the last deleted order, not the last open trade.
thanks -
@lali That is interesting. A deleted trade is not a closed one. This means it cannot be scanned via 'For each closed trade'. You should stroe the information before the pendng order is deleted and stroed into variables. When a new pending order is deleted those values should be reinitialized.
-
how do I do that, please asist
thanks -
@lali This is one way to do it. You create a variable and then use this structure on the 'on trade' tab (not on the 'on tick' tab):

Please notice you will have to specify what you need, buys, sells or both.
Then that variable can be used normally on any buy/sell now blocks.
-
https://fxdreema.com/shared/C2MgLtrGb
HI
will you please look at my EA. Things that is doing correct it to repeat the deleted pending order lot size,. things that is doing wrong is , if the order is not deleted is activated it is still using the current lot size for the next pending order . I want it to increase lot size when placing the next pending order if last pending order was not deleted. if orders are activated they should be increasing no repeat of lot size in active trade. E.G trade 1 is 0.01 trade 2 is 0.02 trade 3 is 0.04. there should never be 2 trade with the same lot size. my EA is giving me 2 trade with same lot size after a trade is activate. e.g. trade 1= 0.01 it is activated then trade 2 is again 0.01 pending but surprisingly trade 3 is increasing the lot size to 0.03 please look at my EA .
Thanks -
@lali Do you mean a martingale? If so you will need a completely different structure to determine lot size. Is this martingalse supposed to be active no matter if the pending order is activated or not?
-
yes, The difference is this one increase lot size when 5 moving avarage crossing 20 not when it hit Tp or St loss. It using pending orders it pending order is activated, the next pending order will be bigger. please assist with the correct structure.
Thanks