0

How could we round strategy position size to 0 or 1 or 2 precision? Eg: Strategy is setting with Properties (Order size: 100% if equity) place order B1 165.967 , but I want to round it to 165 and send it when signal alert immediately.

enter image description here I have tried with:

strategy(title='MyStrategy', overlay=true, default_qty_value =100, default_qty_type = strategy.percent_of_equity, initial_capital=1000)
...
strategy.entry('BuyUP', strategy.long, comment = str.tostring(strategy.position_size), alert_message = alMessage)

But it always returns the previous position size instead of this long entry.

Is there any setting or properties for this strategy order size decimal? I have check layout and properties but found nothing yet.

Tien Tran
  • 36
  • 4

0 Answers0