File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
examples/scratch_pad/issues Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import pandas as pd
2
+ import mplfinance as mpf
3
+
4
+ print ('\n mpf.__version__=' ,mpf .__version__ ,'\n ' )
5
+
6
+ filename = '../../data/SP500_NOV2019_IDay.csv'
7
+
8
+ intraday = pd .read_csv (filename ,index_col = 0 ,parse_dates = True )
9
+ intraday = intraday .drop ('Volume' ,axis = 1 ) # Volume is zero anyway for this intraday data set
10
+ intraday .index .name = 'Date'
11
+ intraday .shape
12
+ intraday .head (3 )
13
+ intraday .tail (3 )
14
+
15
+ iday = intraday .loc ['2019-11-06 15:00' :'2019-11-06 16:00' ,:]
16
+
17
+ print ('len(iday)=' ,len (iday ))
18
+
19
+ mpf .plot (iday ,type = 'renko' ,renko_params = dict (brick_size = 0.1 ))
20
+ mpf .plot (iday ,type = 'candle' )
21
+
22
+ filename = '../../data/SP500_NOV2019_Hist.csv'
23
+ df = pd .read_csv (filename ,index_col = 0 ,parse_dates = True )
24
+ df .index .name = 'Date'
25
+ df .shape
26
+ df .head (3 )
27
+ df .tail (3 )
28
+
29
+ print ('len(df)=' ,len (df ))
30
+
31
+ mpf .plot (df ,type = 'candle' )
You can’t perform that action at this time.
0 commit comments