IB plugin, last candle at price of -1 causing y-axis mess

I'm using the InteractiveBrokers(r) data Plug-in provided to download minute data of indexes in IB.

I have version Build 10.12.2r, Aug 9, 2022 4:00:37 PM of TWS

This works as I am able to download and stream realtime data with TWS open. However, it's annoying that the last candle shows my local time and has a price of -1 where the rest of it will be between 6-7000 ( SPI 200 CFD ) which completely skews my graph.

Is there a known fix or workaround for this?
Thank you


This is the chart with the x-axis showing the period before the last candle, it's just that last piece of data which is invalid for some reason.


This is my plugin setting:



@mordax, please, see this past topic that offers a workaround to this problem.


Thank you for the link, this is pointing me in the right direction it feels, however, try out the accepted solution only partially solves the problem. It has removed the offending data point, however, I still can't get the y-axis to range from 6900 to 7100. I've tried to drag it and double click to reset it, it still goes back to 0 - 7000 which I think is because it's acting on the underlying data and not on the plot price.


Actually, the previous post with a simpler solution did work for me. Thank again beppe!

For anyone else, it was this:

O = IIf(C > 0, O, Ref(O,-1));
H = IIf(C > 0, H, Ref(H,-1));
L = IIf(C > 0, L, Ref(L,-1));
C = IIf(C > 0, C, Ref(C,-1));
1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.