qtpylib icon indicating copy to clipboard operation
qtpylib copied to clipboard

[BUG] on_bar() event always produces a bar where O=H=L=C always (all ohlc values are same)

Open viveksethu opened this issue 5 years ago • 3 comments

I just ran the strategy example with on_bar event, just to print the bar. It always produces each of OHLC value same for every bar

Pandas(Index=Timestamp('2019-05-30 06:22:00+0000', tz='UTC'), asset_class='STK', close=2150.4, high=2150.4, low=2150.4, open=2150.4, symbol='TCS', symbol_group='TCS', volume=5, signal=nan) Pandas(Index=Timestamp('2019-05-30 06:23:00+0000', tz='UTC'), asset_class='STK', close=2134.55, high=2134.55, low=2134.55, open=2134.55, symbol='TCS', symbol_group='TCS', volume=772, signal=nan)

viveksethu avatar May 31 '19 08:05 viveksethu

Hello, I get the same bug. It should be 1 Min bars , right ?

150 | 2020-05-08 12:28:00 | 2 | 9174.5 | 9174.5 | 9174.5 | 9174.5 | 2 151 | 2020-05-08 12:28:00 | 1 | 2902.5 | 2902.5 | 2902.5 | 2902.5 | 20 148 | 2020-05-08 12:27:00 | 1 | 2904 | 2904 | 2904 | 2904 | 4 149 | 2020-05-08 12:27:00 | 2 | 9180.5 | 9180.5 | 9180.5 | 9180.5 | 1 146 | 2020-05-08 12:26:00 | 1 | 2904.25 | 2904.25 | 2904.25 | 2904.25 | 11 147 | 2020-05-08 12:26:00 | 2 | 9179.5 | 9179.5 | 9179.5 | 9179.5 | 1 144 | 2020-05-08 12:25:00 | 2 | 9179.25 | 9179.25 | 9179.25 | 9179.25 | 1

Any ideas on how to correct that ?

sirhc78 avatar May 08 '20 12:05 sirhc78

Do we have to downgrade pandas from 1.0.3 to 0.25 or 0.22 ?

sirhc78 avatar May 10 '20 19:05 sirhc78

I got the same error today when i was trying to run it. Screen Shot 2020-05-21 at 8 16 38 PM

shanmukhsista avatar May 22 '20 03:05 shanmukhsista