Trying and failing to delete trades due to distance
-
In this project every time a sell is created a pending buy is placed, this is then deleted if within a set distance of the already running buy trade, once this is working I will use as a condition to prevent placing trade. Without the (check distance--delete pending) the EA works as expected, but some trades are generated too close, with this condition all buy pending's are deleted straight away, regardless of the pips from existing trade.
Any help would be much appreciated.
-
@jstap Certainly a copmplex project. At first glance I didn't see any wrong logic. However, I see all trades and pending orders are working with the same group. Maybe creating different groups for the pending orders you'd be able to filtering them better.
-
HI l'andorra, thanks for the reply, I have tried to add different groups but hundreds of trades are added so EA stops working.
I even made a simple version which you can see in the link, but it also generated hundreds of trades.
test project
If I am doing something wrong with this then advice is appreciated and maybe I can get it working. -
@jstap Are you sure your simplified version is opening hundrers if trades? It just opens one to me and a pending order is programmed.
-
@l-andorrà Interesting, I will ty again now, it is possible I had too much happening with my computer and it caused the problem.
-
@l-andorrà So you learn new every day, so they say, well today I did.
It turns out that having too much happening with my computer caused the group problems.
Thank you, I think I can now get all working
-
@l-andorrà So I jumped the gun in blaming my computer, this was not the problem, I found the problem though.
If your 1st block (No trade in this case) has an empty group number, and you 2nd and 3rd block (buy and pending sell, in this case) have a group number.
Then the EA will generate multiple trades, if all 3 blocks have the same number then it works as expected. -
@jstap Good to know! I selected group 0 by defalut when I tested it. Didn't kow that! Thank you for sharing!

-
@l-andorrà No problem:)
-
@jstap Something else I figured out, if the top block is comma separated e.g 1,2, then the connected trees can contain both group 1 & 2 providing it doesn't conflict.
-
@jstap That one I knew.
