[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: to display in the pane the Change (%) of IB TWS



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "reinsley" <reinsley@xxx> 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
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/