Discussion of article "Exploring Seasonal Patterns of Financial Time Series with Boxplot"

 

New article Exploring Seasonal Patterns of Financial Time Series with Boxplot has been published:

In this article we will view seasonal characteristics of financial time series using Boxplot diagrams. Each separate boxplot (or box-and-whiskey diagram) provides a good visualization of how values are distributed along the dataset. Boxplots should not be confused with the candlestick charts, although they can be visually similar.

Prices have a shift in the average value over time and form trends, therefore the statistical analysis is not applicable to such raw series. Percentage price changes (price increments) are usually used in econometrics to ensure they all lie in the same value range. The percentage changes can be received using the pd.DataFrame(rates['close'].pct_change(1)) method.

We need average monthly price ranges. Let us arrange the table so as to receive the average values of monthly increments by years and display them on the boxplot diagram.


Fig. 1. Average price increment ranges by month, over 10 years.

Author: Maxim Dmitrievsky

 
Hello dear Maxim
Thanks for the useful codes.
I wrote a Python code. Can I run it in Meta Tester Strategy?
 
My number one article in mql5 community!! Much love Maxim..Keep up the quality articles
 
I tried getting the hourly data from mt5 in vain. Yet I am easily able to get Daily, weekly and monthly data? Any rason why Maxim? 
 
Julius Mwangi:
I tried getting the hourly data from mt5 in vain. Yet I am easily able to get Daily, weekly and monthly data? Any rason why Maxim? 

Hi, I think some changes in MT5 python api, so need to change code. Later Ill fix it.

 

Hi Maxim,

I run code:


rates = pd.DataFrame(mt5.copy_rates_range("EURUSD", mt5.TIMEFRAME_D1, datetime(2010, 1, 1), datetime(2020, 1, 1)), 

                     columns=['time', 'open', 'low', 'high', 'close', 'tick_volume', 'spread', 'real_volume'])

and the time I get is sth like '1262563200' which does not make sense, How can this be fixed plz?

Thx!

 
fudongyang:

Hi Maxim,

I run code:


rates = pd.DataFrame(mt5.copy_rates_range("EURUSD", mt5.TIMEFRAME_D1, datetime(2010, 1, 1), datetime(2020, 1, 1)), 

                     columns=['time', 'open', 'low', 'high', 'close', 'tick_volume', 'spread', 'real_volume'])

and the time I get is sth like '1262563200' which does not make sense, How can this be fixed plz?

Thx!

Hi, try this 

 rates.index = pd.to_datetime(rates.index, unit='s')
 

Very good!


Thank you.