Hey guys,
How do you sell half in a shorting position? These are my lines of code, but the second line seems to be actually using my profits to buy half of what I can buy as opposed to exiting half of my shorting position and taking that profit.
self.MarketOrder(self.symbol.Symbol, -(shares_to_buy)) # Enters here.
self.MarketOrder(self.symbol.Symbol, (held_stocks // 2)) # Supposed to sell half on targets instead of buying.
What am I doing wrong?
Best,
Jesse
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!