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

[amibroker] Trying to duplicate "Prem" with IB



PureBytes Links

Trading Reference Links

HI All,

Trying to do a homemade Premium using IB. Prem ($PREM.X, $PREM) is the
difference between futures and the spot index; the Tradestation symbol is
$esinx. Good source is www.indexarb.com. To plot the difference between two
symbols AB Support said to use the Foreign function but how to you plot a
bar graph with the result? 

The problem with my attempt (below) is sometimes on a bar chart the
open/close is above or below the high low bar for that time period!




SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}}            Hi %g,
Lo %g,  {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

H1=Foreign("SPX-CBOE-IND","H");
L1=Foreign("SPX-CBOE-IND","L");
O1=Foreign("SPX-CBOE-IND","O");
C1=Foreign("SPX-CBOE-IND","C");

H2=Foreign("ESU6-GLOBEX-FUT","H");
L2=Foreign("ESU6-GLOBEX-FUT","L");
O2=Foreign("ESU6-GLOBEX-FUT","O");
C2=Foreign("ESU6-GLOBEX-FUT","C");

H = H2 - H1;

L = L2 - L1;

O = O2 - O1;

C = C2 - C1;

PlotOHLC(O,H,L,C, "Program Buy Sell...   ", colorGreen,styleBar|styleThick);


Any help would be appreciated.



Jerry Gress
Stockton, Ca.