managing trade- what code do you use.

 

Hi,

If i have a few trades on at the same time and I require changing the SL continuously (after every bar).

any advice on the code to use?

Thanks.

 
Design something that solves your problem . . . then code it.
 
do u need* a loop for it?
 
yuan83:
do u need* a loop for it?

What does it need to do ? figure out that first . . . then think about code later.

Probably, a for or while loop . . . they pretty much perform the same function.

 
yuan83:

Hi,

If i have a few trades on at the same time and I require changing the SL continuously (after every bar).

any advice on the code to use?

Thanks.


If it is for MetaTrader4 then we all advise you to program with mq4 coding. Succes
 
yuan83:
do u need* a loop for it?

move the SL at the start of every time frame
 
yuan83:

any advice on the code to use?

Use a few of these commands / functions ...

https://www.mql5.com/en/forum/122679

 
yuan83:

Hi,

If i have a few trades on at the same time and I require changing the SL continuously (after every bar).

any advice on the code to use?

Thanks.

Right after every bar ?

My replies/examples here ( https://www.mql5.com/en/forum/139556 ) may be useful for a start

Reason: