//if you have the same database provider for Futures and Stocks all you have
to do is:

 1. Have all the symbols Of interest in the same database (I Have no
futures, so demonstrate it with Forex AND stocks}

 2. Make a new indicator.afl for each symbol that you want in a separate
pane

///////////////Examples

///////////////Example1 (both symbols in 1 pane)//////////////////

Create an indicator Example1.afl)

Plot(Foreign("EUR.USD-IDEALPRO-CASH","Close"),"EUR.USD",1,styleOwnScale|5); 

Plot(Foreign("DIA","Close"),"DIA",1,styleOwnScale|5); 

 

///////////////Example2 (1 symbol each in its own pane)///////////////

Example21.afl

Plot(Foreign("EUR.USD-IDEALPRO-CASH","Close"),"EUR.USD",1,5); 

Example22.afl

Plot(Foreign("DIA","Close"),"DIA",1,5); 

 

////////////////Example3 (Rel Performance in 1 pane)///////////////////

Ticker1=  "EUR.USD-IDEALPRO-CASH";

price1 = Foreign( ticker1, "C");

Ticker2=  "DIA";

price2 = Foreign( ticker2, "C");

Plot( price1 ,"\n"+ StrMid( ticker1,4,3)+StrMid(ticker1,0,3),
colorBlack,styleOwnScale|5);

Plot( price2 ,"\n"+ Ticker2, colorBlue,styleOwnScale|5);

 

///////////////Example4//////////////////////

// A little bit more fluff, but basically the same: Instead pf stepping thru
each tickerlist in 1 pane, 

//one can of course assign each tickerlist to an individual tickerlist.afl

DrawList = ParamList("TickerList1|TickerList2","1|2|3|4");

_N( TickerList1 = ParamStr("EUR",
"DIA,EUR.CAD-IDEALPRO-CASH,EUR.CHF-IDEALPRO-CASH,EUR.JPY-IDEALPRO-CASH,EUR.U
SD-IDEALPRO-CASH,EUR.GBP-IDEALPRO-CASH,EUR.AUD-IDEALPRO-CASH") ); 

_N( TickerList2 = ParamStr("Tickers2",
"QQQQ,USD.CHF-IDEALPRO-CASH,USD.JPY-IDEALPRO-CASH,USD.CAD-IDEALPRO-CASH") );


_N( TickerList3 = ParamStr("Tickers3",
"SPY,GBP.USD-IDEALPRO-CASH,GBP.JPY-IDEALPRO-CASH,GBP.CHF-IDEALPRO-CASH,GBP.A
UD-IDEALPRO-CASH") );

_N( TickerList4 = ParamStr("Tickers4",
"MSFT,AUD.JPY-IDEALPRO-CASH,AUD.NZD-IDEALPRO-CASH,AUD.USD-IDEALPRO-CASH,AUD.
CHF-IDEALPRO-CASH") ); 

 

//TickerList = IIf(DrawList==1,TickerList1,TickerList2); 

if(DrawList=="1")TickerList=TickerList1; 

if(DrawList=="2")TickerList=TickerList2; 

if(DrawList=="3")TickerList=TickerList3;

if(DrawList=="4")TickerList=TickerList4;    

 

NumBars = 40; 

fvb = Status("firstvisiblebar"); 

//Plot( 100 * ( C - C[ fvb ] ) / C[ fvb ], Name(), colorBlue ); 

for( i = 0; ( symbol = StrExtract( TickerList, i ) ) != ""; i++ ) 

{ 

 fc = Foreign( symbol, "C" ); 

  if( ! IsNull( fc[ 0 ] ) ) 

  { 

//use either following

Plot( 100 * ( fc - fc[ fvb ] )/ fc[ fvb ],"\n"+symbol,colorGreen+ ( (2*i) %
15 ),styleLine ); 

//or to shorten display; shows only 3 letters for stocks

//     symbol2 = "\n"+ StrMid( symbol ,4,3)+StrMid(symbol ,0,3); 

//     Plot( 100 * ( fc - fc[ fvb ] )/ fc[ fvb ],symbol2,colorGreen+ ( (2*i)
% 15 ),styleLine ); 

  } 

} 

PlotGrid( 0, colorYellow ); 

_N( Title = "Rel.Str-FX-Loop - Rel. Perf. [%]: {{VALUES}}" );  

  

 

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf
Of reinsley
Sent: Wednesday, February 11, 2009 2:04 PM
To: [email protected]
Subject: [amibroker] display an index and a future in two panes, same chart.

 

Hello,

I would like to display one foreign index, SPX, under my future
contract in the same chart, same time unit. The future in a pane, the
foreign index in another pane, both panes in a chart.

Of course the time scales are in sync.

Does it exist a trick to do it ?

Thank you for the help.

Best regards



<<image001.jpg>>

<<image002.jpg>>

Reply via email to