Hi!
I recently listened to a “Better System Trader” podcast about Market Phases, where the person interviewed talked about 6 different market phases. I coded these quickly and thought I would share it with you. Feel free to add in any other ideas or code snippets you use to define market phases to improve your algos.
To use this snippet, I add the “and $mp[x]” to my buy conditions and then optimize x between 1-6, to see if any market phases are bad for the particular system.
//Market Phases
// based off https://www.youtube.com/live/pXxmhZsqbzA?si=UbPSOTYNvrVpvc-v
Timeframe (1 day)
MA200 = average[200] (close)
MA50 = average[50] (close)
$mp[1] = close > MA50 and MA50 > MA200 and MA50[0] > MA50[1] and MA200[0] > MA200[1] //Bullish Phase
$mp[2] = close < MA50 and MA50 > MA200 // Warning Phase
$mp[3] = MA50[0] < MA50[1] and MA50 > MA200 and MA200[0] > MA200[1] //Distribution Phase
$mp[4] = MA50[0] < MA50[1] and MA200[0] < MA200[1] and MA50 < MA200 //Bearish Phase
$mp[5] = MA200[0] < MA200[1] and MA50[0] > MA50[1] and close > MA50 and close < MA200 //Recovery Phase
$mp[6] = close > MA50 and MA50[0] > MA50[1] and MA200[0] > MA200[1] //Accumulation Phase
Timeframe (default)
and $mp[x]
Link to above code added as Log392 here …
Snippet Link Library