Opening positions with trading view commands

In this case, we use the CQ parameter, which is the closing quantity.

In your code, insert CQ=100%.

For example, {{strategy.market_position}} BTCUSDT Q=40% CQ=100% sl=0.35% tp=0.75% L=50 A=USDM