how to change the stops of a group of trades to the level of stops further away from the group of orders
-
hello everyone to finish mine ea i needed to solve this problem, the robot is based on pending orders that will open at the same levels as the previous orders but with volatility and spread the orders will not open at the same level and therefore stops will not to be on the same level, how can I make when another order is opened the stops adjust to the level of the stops further away from the group of orders?
-
@alexandre_diogo Do you mean all trades should use the same SL level? Then you should store that value of that SL price into a variable and use it in all new pending orders.
-
@l-andorrà yes, sell orders are supposed to close in profit at the same level as the stop loss of buy orders and taking into account the farthest stop, adjust tp and sl to that stop level whenever a pending order is activated
-
@l-andorrà but I want to regulate all the sell gain limits with the buy loss limits based on the furthest order, be it a sell tp or a buy sl, I didn't want to define a specific value
-

-
@alexandre_diogo I see different dotted lines in your screemshot. Are all of them SL levels. Are thay supposed to be just one and not many as per the image? On the other hand, I see many trades can be open at the same time. Are all of them supposed to share the exact same SL level?
-
@l-andorrà hi, the green lines that you see are the buy ordens in the top and sell orders in the bottom, the pink lines in the top are the sl of sell ordens and the tp of buy orders, the pink lines on the bottom are the sl of buy orders an the tp of the sell orders, they are not all opening at the same time, when we have an active buy order we have a pending sell order and vice versa, what I want is to readjust the tp and sl levels to the farthest level whenever a pending order is activated
-
@l-andorrà and yes they should all have the same level but with the volatility and spread it doesn't happen which leads me not to have the sls and tps at the same level so my idea is to just readjust the stops to the same level further away from the group of orders
-
@alexandre_diogo Well, that makes it mor difficult. You can catch the first SL level into a variable this way:

Than you can use that same value for the TP level of all sells. Same for the sells TP and SL but in the opposite order.
-
@l-andorrà ok i have to learn a little more about the variables but i will use this method, thanks for the tip

-
@alexandre_diogo You're welcome.