Your first suggestion, for the main order, works perfectly. It is indeed what I needed there. Thank you.
For the legs, it doesn't work as intended. I'm trying to flip the stoploss and target prices upside down depending on whether the main order is long or short. If the main order is long, the stoploss should be -0.06 below the entry price. This is currently the case ✔. If the main order is short, then the stoploss should move around to the other side and be +0.06 above the entry price. This is currently not the case ❌. How to program this?
Currently, the stoploss is always below the entry price regardless of whether I'm buying or shorting a stock. It should flip above in case I'm shorting.
The limit and stop prices I decided are designed to make me risk $5 per trade. Basically, if I buy 83 stocks and if my trade fails, I will only lose 83 * $0.06. If you do the math, I will only lose $4.98. As for my target limit order, it is set to +33. I know it's too far to trigger. I'm doing this just so a target limit order exists in the machine. I can later adjust its price on the fly depending on where the market will have gone.