Yes, I was referring to Pauls results in your post: https://www.prorealcode.com/topic/machine-learning-in-proorder/page/4/#post-121408
and why the screenshot showed exactly the same result although one system has machine learning (ML)?
Be great if you could come up with a System where it clearly makes a big difference? A single variable System may be good?
My approach has always been to have as few variables as possible, too much chance of curve fitting otherwise. That’s why I like things like the Pivot Support / Resistance Zone indicator that Robertogozzo has coded: https://www.prorealcode.com/prorealtime-indicators/pivot-support-resistance-zones/
Through much back testing on the Dow I can see that funnily enough low values for the setting “Lookback” (eg, one to four) worked well, so it’s really the PivotBar variable that needs some ML applied to it!
(I also noticed that values for the PivotBar of around 30 to 40 worked well). Once I got an intuition about the settings you can get some interesting results (slightly biased / curve fitted because I used the same date ranges). Eg:
Dow Jones | 10 Mins | £133.6k | GainLoss 8.7 | WinLoss 68% | DDown 20.5% | 13/06/2019–08/04/2020
Settings:
3.8 spread
PivotBar = 40
Lookback = 1
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
Support, ignored = CALL "Pivot Support/Resistance Zones"[40, 1] //PivotBar, Lookback
c1 = (close = Support)
Pivot Support/Resistance Zones
IF c1 THEN
BUY 10 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
ignored, ignored, ignored, Dev, ignored, ignored = CALL "Kase Dev Stop Lisse+SAR+4.5/6"
c2 = (close = Dev)
IF c2 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
ignored, Resistance = CALL "Pivot Support/Resistance Zones"[40, 1]
c3 = (close = Resistance)
IF c3 THEN
SELLSHORT 10 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
ignored, ignored, ignored, Dev, ignored, ignored = CALL "Kase Dev Stop Lisse+SAR+4.5/6"
c4 = (close = Dev)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
My other thought was that instead of applying ML to a basic RSI, why not see if it can be applied to a superior indicator like John Ehler’s Universal Oscillator? (I’m going to compare to see if that is as good as his improved Stochastic Oscillator which has a roofing filter). Specifically apply ML to the bandedge setting (which is like a sensitivity period setting), because I would often get great results, sometimes for years and then boom! Inevitable losses would appear because it needed a different bandedge setting to be profitable as the markets had changed. Now if bandedge could “self optimise” that’d be pretty interesting to see.
Without optimisation and the right market regime/dates you can get some good results, this has more Universal Oscillator exits to — pls see image #2: (this test done in Mch 2017)
Ehler’s Univ Osc £/$ | 1 Hr | £18.5k | 185% | win95% | gain/loss7.9 | DDown22.5% | 03/08/2015–31/12/2015
Settings”
Spread 3.3
Bandedge =25
But it only works going forward for the next 6 months in time if the bandedge is upped to 100 and it also runs with a 100 tick trailing stop (pls see 3rd image which I just ran a test to produce). I’m hoping ML will mitigate the need for a stop too, although DDown is 51%.
I’d be happy to publish back test results between the generic RSI and the Universal Oscillator on a range of assets if you can perhaps code it or help me code it? It looks like Juanj’s code can be applied in the top part of the code but I’d need help getting the condbuy / condsell set up right. (I also noticed the RSI system was going long if the Close was < 70 when it would probably be better to have it crossing over say, 20%). The Ehler’s indicators like his Stochastic Oscillator with the roofing filter, are predictive not reactionary.
// Definition of code parameters
DEFPARAM CumulateOrders = True // Cumulating positions deactivated
//Note: Bandedge: 50 and crosses of 0.5 and -0.5 is good on daily indices.
//Bandedge: 24 and crosses of 0.1 and -0.1 work, depending on asset class.
//Bandedge Setting:
//Univ Osc Bandedge = 25
// Conditions to enter long positions
indicator1, ignored = CALL "Ehler's Univ Osc SuperSmoother"[100]
c1 = (indicator1 CROSSES OVER -0.8)
IF c1 THEN
BUY 10 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
indicator2, ignored = CALL "Ehler's Univ Osc SuperSmoother"[100]
c2 = (indicator2 CROSSES UNDER 0.0)
IF c2 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator3, ignored = CALL "Ehler's Univ Osc SuperSmoother"[100]
c3 = (indicator3 CROSSES UNDER 0.8)
IF c3 THEN
SELLSHORT 10 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
indicator4, ignored = CALL "Ehler's Univ Osc SuperSmoother"[100]
c4 = (indicator4 CROSSES OVER -0.0)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
//Set stop trailing 100
I think it’d be interesting seeing how these two deceptively simple but effective systems could work with ML, what do you think @GraHal?
Cheers!