Not the best code but it works. The display in the interpretation
window is ok.
But the "IIf (TimeNum() >= 151000" condition does not work properly,
both values are displayed in the pane. I want just one.
Best regards
TimeFrameSet( inDaily ); // switch to 1 day frame
yesterdayclose=Ref(C,-1);// for the loaded issue
yesterdaycloseSPX=GetRTDataForeign("prev", "SPH9-GLOBEX-FUT-USD");
yesterdaycloseSPXind=GetRTDataForeign("prev", "SPX-CBOE-IND");
TimeFrameRestore(); // restore time frame to original
pcntchangeSPX = ((GetRTDataForeign("last",
"SPH9-GLOBEX-FUT-USD")/yesterdaycloseSPX)-1)*100;
pcntchangeSPXind = ((GetRTDataForeign("last",
"SPX-CBOE-IND")/yesterdaycloseSPXind)-1)*100;
"% ChangeFUT = " + WriteVal( pcntchangeSPX ) + " %";
"% ChangeIND = " + WriteVal( pcntchangeSPXind ) + " %";
IIf (TimeNum() >= 151000, Plot(pcntchangeSPXind ,"%
SPXind",7,5|styleNoLine|styleOwnScale ),
Plot(pcntchangeSPXind ,"% SPX",6,5|styleNoLine|styleOwnScale ));
Plot(Foreign("FCEG9-MONEP-FUT-EUR","Close"),"FCE",2,5|styleOwnScale);
Plot(Foreign("SPH9-GLOBEX-FUT-USD","Close"),"SPX",1,5|styleOwnScale);
Plot(Foreign("SPX-CBOE-IND","Close"),"SPXind",6,5|styleOwnScale);
GraphXSpace = 5;
--- In [email protected], "reinsley" <reins...@...> wrote:
>
> Hi,
>
> How to display in the pane the Change (%) value that appears in the IB
> TWS, for a specific future contract ?
>
> Thank you for the help
>
> Best regards
>