Coin flip study

Discussion in 'Strategy Building' started by digitalnomad, Oct 17, 2019.

  1. If you have the historical minute level OHLC bars, you can aggregate them into pseudo-daysession bars (starting at 10:30 and ending at 15:45). Then you only need one pass through the pseudo-bars. A "coin-flip" simulation is unnecessary as it would, given enough "flips," converge on a daily basis to:

    if both H minus O and O minus L are larger than 0.5*ATR, then you lose ATR on the day;

    if neither is larger, no trade and you lose/make 0;

    if one of H-O or O-L is larger than 0.5*ATR then your P/L on the day is: C - O - 0.5*ATR.

    Sum the daily P/L and divide by 2.
     
    #21     Oct 19, 2019
  2. Kevin. That’s pretty clever. Maybe someone with the skills, and interest, can code it up and post some simulation results. Thanks
     
    #22     Oct 19, 2019
  3. The coin flips will not converge since it's a random sequence. The overall performance depends on the correlation between the random coin flip sequence and the daily price movements of the index. The only way to determine expected performance is to do a statistical analysis. You will never get an exact answer.....all you can do is come up with average performance and some measure of variation from this average (standard deviation).

    I simulated a simplified version of this strategy -- I have daily OHLC data readily available for SPX (ES proxy) and NDX (NQ proxy) going back > 30 years. I used the daily open price as the trade opening price (i.e. buy to open or sell to open) and the daily closing price as the trade closing price (i.e. sell to close or buy to close). Using the low or high of the day I was able to check for prices beyond 0.5 * ATR and close the trade at the stop loss price. I ran the simulation over 10,000 iterations and recorded the performance. There is a lot of variation in overall performance.....on average the strategy is profitable (the average CAGR for SPX was about 10.4%, the average CAGR for NDX was about 13.6%). I would never trade this strategy though -- the maximum drawdowns are steep.

    Note that these results are preliminary and haven't been extensively tested but are definitely a good starting point for further analysis.
     
    #23     Oct 20, 2019
  4. I’m no rocket surgeon, but I figured the convergence would be invalidated by the random coin flip sequence as well. If you want to dig further, PM me for the OHLC minute data on continuous NQ contracts. I believe I can get at least 10 years. Another option is just to run multiple 100+ trade simulations on 6 months of tick data.
     
    #24     Oct 20, 2019
  5. ironchef

    ironchef

    #25     Oct 22, 2019
  6. ironchef

    ironchef

    Can you kindly explain this? i.e., how to determine if stop loss will be triggered in a
    backtest?
     
    #26     Oct 22, 2019
  7. https://www.qmatix.com/
     
    #27     Oct 22, 2019
  8. Using a long trade as an example, the buy price will be the open price for the day. For an actual trade we would set a stop loss equal to this price minus 0.5*ATR. For the backtest we know the low of the day. If the low of the day is lower than the stop loss price then we know that the sell price will be the stop loss price. If the low of the day is above the stop loss then the sell price is the closing price for the day. It's the reverse situation for a short trade (using the high instead of the low).
     
    #28     Oct 22, 2019
    ElectricSavant and ironchef like this.
  9. ironchef

    ironchef

    Thanks. Make sense.
     
    #29     Oct 26, 2019
  10. By breaking it down logically like this...it begs for data other than a coin flip to measure increased odds of being correct...

     
    #30     Oct 26, 2019