Hi. I have a strategy running in a portfolio that for each asset, in the end of each day, it adjust a hedge position. It checks if the PositionType of "position" and "hedge position" are different and, if it is, it closes the old hedge position and opens a new hedge position. However the number of shares should be different for the position and hedge position. I'm trying the following:
CODE:
Please log in to see this code.
hedgeBars is the Bars object of the hedge asset, hedgePos is the Position object of the hedge position, pos is the Position object of the position and lote is the share size of pos.
However when running it, both position and hedge position are getting the same number of shares. Someone could help me?