Hey,
I want to create an algorithm that buys shares in a company if the stock is trading below a value defined as intrinsic value plus accrued dividends (accrued dividends will be defined as divided prorated for the portion of the quarter that has passed). On the other side, the algorithm should sell the stock in the portfolio if the shares are trading above intrinsic value plus accrued dividend. Can anyone help me with the code?