Topics in Stochastic Portfolio Theory: Pathwise Generation of Trading Strategies, and Portfolio Theory in Open Markets