I just want to implement a line within my chart that starts from time point 0 to time point T and whose y-coordinates can be manipulated, which in my case is represented by D.
I tried to implement a function called Threshold
but I am still struggling with it. Can anybody of you help me out?
My code so far:
Manipulate[
SeedRandom[seed]; Column[{test2[μ_, σ_, S_, P_, T_] := Table[RandomFunction[
GeometricBrownianMotionProcess[μ, σ, S], {0, T, 0.05}]["Path"], {P}];
meanPaths = Mean[test2[μ, σ, S, P, T][[All]]];
threshold[t_, T_] := Line[{{0, t}, {T, t}}];
ListLogPlot[{meanPaths,Flatten[test2[μ, σ, S, P, T], 1], threshold},
Joined -> True, AxesLabel -> {"Time", "St"},
PlotLabel -> Style["Forecasted Stock Price\n (Brownian Motion)", Bold],
PlotRange -> {{0, T}, {0, 700}},
PlotStyle -> {Directive[{Thick, Red}], Directive[{Thin, Gray}]},
GridLines -> {{}, {t}},
ImageSize -> 500]}],
{{S, 100, "Initial Stock Value"}, 100, 500, 0.05, Appearance -> "Labeled"},
{{μ, 0.01, "Drift μ"}, 0.01, 1, 0.05, Appearance -> "Labeled"},
{{σ, 0.01, "Standard Deviation σ"}, 0.01, 1, 0.05, Appearance -> "Labeled"},
{{P, 1, "Paths"}, 1, 100, 1, Appearance -> "Labeled"},
{{T, 1, "Time"}, 1, 250, 1, Appearance -> "Labeled"},
{{t, 100, "thresh"}, 95, 105, Appearance -> "Labeled"},
{{seed, 77777, "New Random Case"}, 10000, 999999, 1},
Button["Set Initial Values",
{S = 100, μ = 0.01, σ = 0.01, T = 1, P = 1, t = 100},
ImageSize -> 150],
ControlPlacement -> Left]