Setting leverage seperately for longs and shorts

So, I would like to use different leverage for opening longs and opening shorts, and let the optimization engine decide the best setting to use for each.

How can this be done?

Thank you.

First question is: what do you trade? Stocks OR Futures? The answer depends on it.

Neither, cryptocurrency. But my strategy code runs in Futures Mode.

I solved this by using

SetOption("FuturesMode", True );
leverage = 1.75;
MarginDeposit = -100/leverage;      
LPS = 1;  
SPS = optimize("SPS",1,0,1,0.1);      
maxsymbols = 3;  
PS = IIf(Buy,LPS,SPS);      
SetPositionSize(PS*100/maxsymbols,spsPercentOfEquity);    ```