Created with Raphaël 2.2.0
Random Trading Algorithm
Initialize: N, T, C, delta, L_max, Total_Payoff
For _ in range(N):
R = generate_random_trading_signals(T)
For t in range(1, T + 1):
if R[t] == 1
Initialize P and L
P.append(C[t])
Define p_ow and p_sl
For t_star in range(t, T + 1):
if C[t_star] >= p_ow and L <= L_max
P.append(C[t_star])
L += 1
if C[t_star] <= p_sl or t_star == T
P_cover = C[t_star]
payoff = np.sum(P - P_cover)
total_payoff.append(payoff)
yes
no
yes
no
yes
no