Hello,
Has anyone encountered the problem with negative values in Interactive Brokers real-time feed for CFDs at the end of the session? I am sure IBKR want to signal the session is closed but it resets the y-axis and I can't see the plot (see picture) until the -1 values get flushed out the following morning.
I have tried referencing the previous bar (see code below) but the problem persists.
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", IIf(O > 0, O, Ref(O,-1)), IIf(H > 0, H, Ref(H,-1)), IIf(L > 0, L, Ref(L,-1)),IIf(C > 0, C, Ref(C,-1)), SelectedValue( ROC( IIf(C > 0, C, Ref(C,-1)), 1 ) ) ));
P = ParamField("Price field",-1);
Plot(IIf(C > 0, C, Ref(C,-1)), "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
PlotVAPOverlay( Param("lines",300,10,1000,1), Param("width",10,1,99,1), ParamColor("color", colorDarkBlue), Param("style",0,0,7,1) );
_SECTION_END();
It happens at all time intervals but if I scroll the x-axis to exclude the last bar the chart is ok. Also, plots in IBKR's TWS are ok. I am using Amibroker version 6.40.0 Build: Aug 24
I appreciate help on this matter.
Thank you.-