Modify code to get synthetic data that trends smoothly from bull to bear market cycles
问题 I have this class that generates synthetic looking (stock) data and it works fine. However, I want to modify it so that NewPrice generates smooth trending data for say n-bars . I know that if I reduce the volatility, I get smoother prices. However, not sure how to guarantee that the data goes into alternating persistant trend either up/down. A sine wave looking thing, but with stock looking prices, i.e, no negative prices. Price = Trend + Previous Price + Random Component I am missing the