Prudent Risk Management + No Edge = Positive Expectancy??

Discussion in 'Risk Management' started by ironchef, Nov 14, 2023.

  1. ironchef

    ironchef

    Sometime back I wrote a VBA Excel program to generate a set of minute by minute stock price based on a Markov process, a GBM model. Then I programmed in several popular indicators like the standard ma, MACD... I created a series of mini Monte Carlo runs. The verdict:

    None worked with large sample sizes, i.e, none generated a consistent profit.

    I am still trying to figure out how to add PRM into the program, so, the jury is still out on this. However, I generated a few 1 min random price movement using GBM and manually "traded" using PRM and my scheme. Here is an example of one such 1-min chart. In this sim, long term drift is set to zero, so, pure random, no forcing function.

    upload_2023-11-18_7-20-27.png

    Surprise! This random stock price movement is very tradable and generated a profit! I tried several and they all generated a profit using PRM.

    I can't run a MC on this yet, so don't know if these are randomly profitable or real.

    Am I fooling myself?
     
    #41     Nov 18, 2023
  2. Jzwu2017

    Jzwu2017

    Most likely unless what you did is so special that no one has ever tried before. Remember so many smart people have been trying with all kinds of methods. Very rarely a “holy grail” hasn’t been attempted in the last.
     
    #42     Nov 18, 2023
  3. ironchef

    ironchef

    Of course. You expect otherwise?

    Don't expect an amateur retail, to come up with the theory of general relativity, or a unique way to make money day trading.
     
    #43     Nov 18, 2023
    Jzwu2017 likes this.
  4. tiddlywinks

    tiddlywinks


    If you can't define (and better, quantify) your PRM edge, even in simple terms... initial stop @ 1.5x the average 15m bar range, or-and-or-and- whatever, the results are random. You have no idea whether it is a system entry edge, some other unknown/undetermined edge, PRM edge, or some combination of edges. Plus, although not pertinent yet, mixing different setups and/or instruments, each has different non-PRM edge. A one-size-fits-all simplistic PRM edge like that mentioned may not even be appropriate due to being a non-acceptable risk itself for a given setup or instrument.

    Hopefully "I generated a few" means at least 1000.
    And what is GBM?
     
    #44     Nov 18, 2023
    ironchef likes this.
  5. SunTrader

    SunTrader

    GBM = geometric brownian motion
     
    #45     Nov 18, 2023
  6. tiddlywinks

    tiddlywinks

    Thanks @SunTrader

    "a few 1 min random price movement" takes a different shape now.
    Better than nothing for this discussion I suppose. It's a very difficult thing to generate truly random.
     
    #46     Nov 18, 2023
  7. SunTrader

    SunTrader

    I've never put much effort into testing other than forward and live, even though TradeStation has been my trading platform forevvvvvver. Crazy huh?
     
    #47     Nov 18, 2023
    toucan likes this.
  8. Zwaen

    Zwaen

    I was up late playing around with ChatGPT and it gave me this code (Python). Definitely not verified and probably not exact, but fun to tinker with. Generates quite a lot of 'crypto pump/dump graphs' ;)

    Figure 2023-11-18 225329.png Figure 2023-11-18 225404.png Figure 2023-11-18 230027.png

    Btw if you don't know how to do it in excel an ai-bot can help you quickly nowadays. Don't know what your parameters are, but perhaps a shifted kalman-filter can be a proxy?



    Code:
    # Geometric Brownian Motion

    import numpy as np
    import matplotlib.pyplot as plt

    def generate_stock_prices(S0, r, sigma, T, dt):
    num_steps = int(T / dt)
    t = np.linspace(0, T, num_steps)
    W = np.random.standard_normal(size=num_steps)
    W = np.cumsum(W) * np.sqrt(dt) # Brownian motion

    S = S0 * np.exp((r - 0.5 * sigma**2) * t + sigma * W)
    return t, S

    # Set parameters
    S0 = 100 # Initial stock price
    r = 0.05 # Drift
    sigma = 0.2 # Volatility
    T = 100 # Time in years
    dt = 1/252 # Daily time steps for 252 trading days in a year

    # Generate stock prices
    time, stock_prices = generate_stock_prices(S0, r, sigma, T, dt)

    # Plot the results
    plt.plot(time, stock_prices)
    plt.xlabel('Time (Years)')
    plt.ylabel('Stock Price')
    plt.title('Simulated Stock Prices using Geometric Brownian Motion')
    plt.show()
     
    #48     Nov 18, 2023
  9. tiddlywinks

    tiddlywinks

    Same. And of that, LIVE is best, as forward testing is just a $10 word for sim.
     
    #49     Nov 18, 2023
    zghorner likes this.
  10. SunTrader

    SunTrader

    Yup sorry had a case of double-speak meant live/forward (cash at risk) testing. Not forward paper testing buy here sell there uh huh ready for my Lambo by end of the week. :)
     
    #50     Nov 18, 2023