tpo_project icon indicating copy to clipboard operation
tpo_project copied to clipboard

Change for Indian markets IB range as 9:15 to 10:15

Open baluinfo86 opened this issue 4 years ago • 3 comments

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

baluinfo86 avatar Aug 09 '20 01:08 baluinfo86

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'

beinghorizontal avatar Aug 09 '20 02:08 beinghorizontal

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 image

datetime:first image

baluinfo86 avatar Aug 09 '20 10:08 baluinfo86

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'})

baluinfo86 avatar Aug 09 '20 20:08 baluinfo86