i've been doing some coding lately, and decided to try to develop a naive backtesting strategy on NQ.
- calculate standard deviation of NQ on day i
- calculate median of first 30 minutes of NQ day (i+1)
- add and subtract standard deviation above to median
- if NQ goes above (below) this threshold, we sell (buy).
- exit at the median
other notes,
- i use close of minute data only
- if there is an open position at day's end, it executes at the last print of the day
-i use a minimum of 20 for the standard deviation
using the first standard deviation and exiting at the median produced poor results. using the second standard deviation and exiting at the first standard deviation produced OK results.
some results over the last month (could have used more data, but i did this on the fly and didn't want to stay too long after the 3pm CDT equity close)
Total PnL 38.66
Max Daily Win 20.00
Max Daily Loss -17.00
Avg Daily Win 11.56
Avg Daily Loss -9.56
Num Days Win 5.00
Num Days Loss 2.00
Total Trading Days 7.00
Winning Percent 0.71
Expectation 1.84
The following data is per trade,
NumBuys 4.000000
NumSells 3.000000
numWins 5.000000
numLoss 2.000000
winPct 0.714000
avgWin 11.557447
avgLoss -9.562500
maxWin 20.000000
maxLoss -17.000000
Exp 5.523177
- calculate standard deviation of NQ on day i
- calculate median of first 30 minutes of NQ day (i+1)
- add and subtract standard deviation above to median
- if NQ goes above (below) this threshold, we sell (buy).
- exit at the median
other notes,
- i use close of minute data only
- if there is an open position at day's end, it executes at the last print of the day
-i use a minimum of 20 for the standard deviation
using the first standard deviation and exiting at the median produced poor results. using the second standard deviation and exiting at the first standard deviation produced OK results.
some results over the last month (could have used more data, but i did this on the fly and didn't want to stay too long after the 3pm CDT equity close)
Total PnL 38.66
Max Daily Win 20.00
Max Daily Loss -17.00
Avg Daily Win 11.56
Avg Daily Loss -9.56
Num Days Win 5.00
Num Days Loss 2.00
Total Trading Days 7.00
Winning Percent 0.71
Expectation 1.84
The following data is per trade,
NumBuys 4.000000
NumSells 3.000000
numWins 5.000000
numLoss 2.000000
winPct 0.714000
avgWin 11.557447
avgLoss -9.562500
maxWin 20.000000
maxLoss -17.000000
Exp 5.523177