tpo_project
tpo_project copied to clipboard
Change for Indian markets IB range as 9:15 to 10:15
Hi, i wanted to thank you for your wonderful project which enabled us to test MP concept programmatic.
I am trying to test in Indian market , could see that first 30 mins starts from 9:15 and IB will be 9:15 to 10:15 , right now I could see code is taking 9:00 to 9:30 as first A period & IB as 9:00 to 10:00 , so is there any way we can customize this to look A period from 9:15 & take from that .. Like 9:15 to 9:45 - A Period,9:45 to 10:15 - B Period
Thanks. Yes, I changed in new version which I just uploaded.
It can be done easily. In the main file for static TPO. Around line number 47 there is a resample method.
dfresample = dfresample.resample(str(freq)+'min').agg({'symbol': 'last', 'datetime': 'first', 'Open': 'first', 'High': 'max', 'Low': 'min', 'Close': 'last', 'Volume': 'sum', 'rf': 'sum'})
change 'datetime': 'first' to 'datetime': 'last'
Thanks for the new version, but still after changing the datetime: first to datetime:last, only legend is getting changed from 9:16 to 9:29, but chart is taking first time period as 9:16 to 9:30. Attaching screenshot.
A period should be 9:16 to 9:45 B period should be 9:46 to 10:15
datetime:last
datetime:first
Hi - able to figure out , below code fixed the issue. Thanks dfresample = dfresample.resample(str(freq)+'min',base=16).agg({'symbol': 'last', 'datetime': 'last', 'Open': 'first', 'High': 'max', 'Low': 'min', 'Close': 'last', 'Volume': 'sum', 'rf': 'sum'})