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

Re: [amibroker] Basic Chart overlay



PureBytes Links

Trading Reference Links


Hi,

Joris M.schuller gave me a copious answer in February 2009...

Best regards



both symbols in one pane

//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.USD-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.AUD-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}}" ); 


Richard a écrit :
>  
> 
> I've never been able to overlay a stock or stocks or Index on a basic 
> Amibroker chart (price only for the overlay). I'm sure there must be 
> simple way … it's just knowing how.
> Am example of what I'd like to see is at:
> http://finance.yahoo.com/q/bc?t=1y&s=HOT&l=on&z=m&q=l&c=BEE&c= 
> <http://finance.yahoo.com/q/bc?t=1y&s=HOT&l=on&z=m&q=l&c=BEE&c=>^IXIC
> 
> I'm sure one of you experts like Herman, Barry, Terry etc. has the 
> answer. Thanks
> 
> Dick H.
> 
> 



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

**** 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/