function [Call, Put] = fwdstartCallPut(T, S, M, r, sigma, N)
% Octave/Matlab function to price forward start Call and Put options
% using the Cox-Ross-Rubinstein (CRR) binomial pricing model.
% Inspired by the WikiPedia example code at
% https://en.wikipedia.org/wiki/Binomial_options_pricing_model
%
% Inputs:
% T = expiration time
% S = stock price
% M = time that determines the strike price
% r = risk-free yield
% sigma = volatility; must be >0
% N = height of the binomial tree; must have 01
down = 1/up; % down factor, must be <1
p0 = (R - down) / (up - down); % risk-neutral up probability
p1 = 1 - p0; % risk-neutral down probability
% NOTE: for p0,p1 to be in the interval (0,1), it must be that
% down