Guys, HELP!!! Please help with the correct volume calculation code for:

if there are no positions:

for a BUYSTOP order

for a SELLSTOP order

if profit > 0

if the position is BUY:

for a BUYSTOP order

for a SELLSTOP order

if the position is SELL:

for a BUYSTOP order

for a SELLSTOP order

if the profit < 0

if the position is BUY:

for a BUYSTOP order

for a SELLSTOP order

if the position is SELL:

for a BUYSTOP order

for a SELLSTOP order

## bebishev

this is when you need to roll over

## simplexnet

What is it?

## bebishev

I wrote – “correct calculation”, not ” correct volume” ))))

Just sometimes the broker returns an error related to the volume, I put “lot-1” – everything works. But it’s clumsy. (((

Therefore, I wrote to the forum so that knowledgeable people could help (((

## simplexnet

What is meant by “correct volume”?