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

[amibroker] USD Index



PureBytes Links

Trading Reference Links

My_USD_Index.

No data for USDSEK, subsitute another e.g. AUDUSD.

// set foreign values for selected currency pairs...

SetForeign("EURUSD");
Euro = C; 
SetForeign("GBPUSD");
Cable = C;
SetForeign("USDCHF");
Swissie = C;
SetForeign("AUDUSD");
Aussie = C;
SetForeign("USDJPY");
Yen =C;
SetForeign("USDCAD");
Canadian = C;
//SetForeign("USDSEK"); // use this instead of AUDUSD  data.
//Swedish = C; // use this instead of AUDUSD 

RestorePriceArrays();

k = Constant = 50.14348112;

// weightings

W_euro = 0.576;
W_cable = 0.119;
W_Yen = 0.136;
W_swissie = 0.036;
W_Canadian = 0.091;
W_Aussie = 0.042;
//W_sek = 0.042;// use this instead of AUDUSD 

// weighted values

euroV = euro^-W_euro;
CableV = Cable^-W_cable;
YenV = Yen^W_Yen;
SwissieV = swissie^W_swissie;
CanadianV =Canadian^W_Canadian;
AussieV = Aussie^-W_Aussie;
//sekV = Swedish^W_sek; // use this instead of AUDUSD


USD_INDEX = k * euroV * CableV * YenV * SwissieV * CanadianV * AussieV;

// set parameters...
p = Param("MA time period", 30, 10, 120, 1);

Plot(usd_index,"USD_INDEX ",colorBlue,1 | styleThick);
Plot( EMA( USD_index,p), " ema_30__USD_INDEX ", colorRed, 1);


Title = "USD INDEX  _{{INTERVAL}}_  {{DATE}}";
GraphXSpace = 5 ;


// interpretations...
printf("euro  =  " + WriteVal(euro,1.4));
printf("\nCable  =  " + WriteVal(Cable,1.4));
printf("\nSwissie  =  " + WriteVal(Swissie,1.4));
printf("\nAussie  =  " + WriteVal(Aussie,1.4));
printf("\nCanadian  =  " + WriteVal(Canadian,1.4));
printf("\nYen  =  " + WriteVal(Yen,1.4));
//printf("Swedish  =  " + WriteVal(Swedish,1.4));

printf("\n");
printf("\nValues");
printf("\neuroV = " + WriteVal(euroV, 1.6));
printf("\nCableV = " + WriteVal(CableV, 1.6));
printf("\nYenV = " + WriteVal(YenV, 1.6));
printf("\nSwissieV = " + WriteVal(SwissieV, 1.6));
printf("\nCanadianV = " + WriteVal(CanadianV, 1.6));
printf("\nAussiev = " + WriteVal(AussieV, 1.6));

printf("\n");
printf("\nUSD Index =  " + WriteVal(USD_Index, 1.4));

Seems OK so far, works for diffferent time frames.
Mirrors the USD(daily) on netdania.

ChrisB

 			
---------------------------------
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006