For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
self.buy() usage to short one stock while go long in another stock
-
I am trying to replicate the code given on this page. According to this when have to long a spread, I have to just call self.buy(). But I have to buy x amount of 1 stock while short beta*x amount of another stock. Where do I put that logic in self.buy()? It doesn't even calculate beta which is required for this type of algorithm to work.
-
@zuj you should self.buy to long a stock and use self.sell to short another stock