Back in May of this year I posted about how I had intended to use Matrix Profile (MP) to somehow cluster the "initial balance" of Market Profile charts with a view to getting a heads up on immediately following price action. Since then, my thinking has evolved due to my learning about the paper "Matrix profile: Using Weakly Labeled Time Series to Predict Outcomes" and its companion website. This very much seems to accomplish the same end I had envisaged with my clustering of initial balances, so I am going to try and use this approach instead.
As a preliminary, I have decided to "weakly label" my time series data using the simple code loop shown below.
What this essentially does (for the long side) is ensure that price is higher at the end of y_values than at the beginning and there is a reward/risk opportunity of at least 3:1 for at least 1 trade during the period covered by the time range of y_values (either the London a.m. session or the combined New York a.m./London p.m. session) following a 7a.m. to 8.50a.m. (local time) formation of an opening Market profile/initial balance and the maximum adverse excursion occurs before the maximum favourable excursion. A typical chart on the long side looks like this.
for ii = 1 : numel( ix ) y_values = train_data( ix( ii ) + 1 : ix( ii ) + 19 , 1 ) ; london_session_ret = y_values( end ) - y_values( 1 ) ; [ max_y , max_ix ] = max( y_values ) ; max_long_ex = max_y - y_values( 1 ) ; [ min_y , min_ix ] = min( y_values ) ; max_short_ex = min_y - y_values( 1 ) ; if ( london_session_ret > 0 && ( max_long_ex / ( -1 * max_short_ex ) ) >= 3 && max_ix > min_ix ) labels( ix( ii ) - 11 : ix( ii ) , 1 ) = 1 ; elseif ( london_session_ret < 0 && ( max_short_ex / max_long_ex ) <= -3 && max_ix < min_ix ) labels( ix( ii ) - 11 : ix( ii ) , 1 ) = -1 ; endif endfor
It is easy to envisage trading this type of price action by fading moves that go outside the "value area" of a Market Profile chart.
More in due course.