trade.Buy help

 

Hi,


I use this line of code to open a buy in mt5.

trade.Buy(volumeSet,_Symbol,0,(candleOpen-slDifference),(candleOpen+tpDifference));


the issue I get is a new buy would overwrite the previous open position buy sl and tp. Is there a way to not have the overwriting?

Any help is much appreciated.

 
Fa Zakee :

Hi,


I use this line of code to open a buy in mt5.

trade.Buy(volumeSet,_Symbol,0,(candleOpen-slDifference),(candleOpen+tpDifference));


the issue I get is a new buy would overwrite the previous open position buy sl and tp. Is there a way to not have the overwriting?

Any help is much appreciated.

Read the help document, what are the differences between netting and hedged trading accounts:  Basic Principles - Trading Operations