Check for open trades with same price
-
Hi there,
Could you please help on how to check if there are some open trades with same open price or within "X" distance and then close one trade to avoid duplicate open positions !Running EA in two TF chart...sometime the EA from both the TF chart open buy or sell position but with the same price. How to identify this and close one of the trade.
Thanks for your help.
KayGee -
@kvinvest You need to create a variable in which you store the open price of the first trade. Then you can use this block with that variable:

-
Thank U . Let me try this.
-
Could you please provide some sample blocks to understand how to store open price of a buy or sell trade in TF1 and then compare the same with another TF 2 for the same symbol ? Once any nearby trade is identified then close one of the trade !
Tried but couldn't follow the logic.Thanks
-
@kvinvest Can you please share your project?
-
@l-andorrà
Here attached the sample EA project. I created this to test how EA works and play around with the system.
When I put this in multiple TF chart for the same pair, sometime it creates buy in both the TF result in duplicate buy or sell trades.
Question is how to identify duplicate or within some distance either buy or sell open trades and close.
You mentioned about capturing the open price in a variable to identify. If I have multiple trades how to do it !https://fxdreema.com/shared/gMB4ZhOK
Thanks
-
@kvinvest You will get as many open trades as charts your EA is active on. Can I ask why are you using the same EA on more than one same chart? Why not simply opening two trades in that chart with one only EA?