Spike in global fear and anxiety levels; JPY surges 5% against USD; risk off selling sends NZD & AUD lower

By Ian Dobbs*:

Last week’s dream run by the NZD/USD and AUD/USD appear to be a distant memory this week after another spike in global fear and anxiety levels overnight.

Financial market jitters have been a constant theme so far in 2016. These jitters have been elevated by fears over a China slowdown and deteriorating emerging markets, many of which have budgets which are heavily dependent on a recovering oil price.

Concerns in the credit markets over energy related loans spread to the financial credit sector overnight after rumours circulated that a large German bank would be unable to meet payments on some of its riskiest debt securities.

The uncertainty has increased the appeal of key safe haven government bonds whilst in Europe a further deterioration has been seen in the peripheral spreads of deeply indebted countries versus German bunds.

As is typically the case during such periods the JPY has also been a large beneficiary of the safety flow and has surged over 5% against the USD since the start of last week.

Major Announcements last week:

  • China NBS Manufacturing PMI, 49.4 vs. 49.6 exp. (Jan.)
  • US ISM Manufacturing PMI 48.2, vs 48.0 exp (Jan.)
  • Australia, RBA cash rate 2.0% as exp.
  • EU Unemployment rate 10.4 % vs. 10.5% exp. (Dec.)
  • NZ GDT dairy price index, -7.4%.
  • NZ Q4 Unemployment rate, 5.3% vs. 6.1% exp.
  • China Caixin Services PMI, 52.4 vs. 50.5 exp. (Jan.)
  • US ISM Non-manufacturing PMI, 53.5 vs. 55.1 exp. (Jan.)
  • UK BoE cash rate, 0.5% as exp.
  • AU Retail Sales, 0.0% vs. 0.5% exp. (Dec.)
  • US Unemployment rate, 4.9% vs. 5.0% exp. (Jan.)
  • US Non-farm payrolls, 151k vs. 190k exp. (Jan.)
  • US Average hourly earnings, 0.5% vs. 0.3% exp. (Jan.)
  • Canada Employment, -5.7k vs. 5.5k exp. (Jan.)

NZD/USD

The New Zealand dollar has relinquished much of last week’s gains seen against the USD in trade since late Friday. This has occurred on the back of the sharp spike in risk aversion as the markets grapple with elevated concerns over global and emerging market growth and the recent deterioration in credit markets. Sentiment from last week’s bullish NZ Q4 employment report and RBNZ Governor comments will take a back seat to such global forces this week, especially in light of the low impact data due for release. We now favour selling near last week’s highs, although expect decent demand near .6550 after last week’s local events.

DIRECT FX Current level Support Resistance Last wk range
NZD / USD 0.6613 0.6550 0.6750 0.6463 – 0.6745

NZD/AUD (AUD/NZD)

The New Zealand dollar continues to trade on a firm footing against the Australian dollar in trade this week. This comes on the back of last week’s surge after the latest NZ employment data and comments from RBNZ Governor Wheeler. Softer than expected Australian retail sales data on Friday failed to make much impact and for now the NZ dollar momentum higher appears to have abated. Data this week is unlikely to make much impact, although a speech by the RBA Governor on Friday should be noted. We favour selling NZ dollars (buying AUD) near last week’s highs(lows) this week.

DIRECT FX Current level Support Resistance Last wk range
NZD / AUD 0.9361 0.9265 0.9385 0.9169 – 0.9388
AUD / NZD 1.0682 1.0655 1.0793 1.0652 – 1.0906

NZD/GBP (GBP/NZD)

The New Zealand dollar has remained largely range-bound against the U.K. pound since our last report. This comes after a lack of data from both regions, where declines in the NZD over the last 24 hours have largely matched those of the GBP. We continue to favour more of the same this week given the low-impact data calendar out of both countries, although a further deterioration in risk sentiment may put the NZD under additional pressure.  Support beyond .4550 (resistance 2.1978) lies around .4480 (2.2321) initially.

DIRECT FX Current level Support Resistance Last wk range
NZD / GBP 0.4586 0.4550 0.4650 0.4489 – 0.4630
GBP / NZD 2.1808 2.1505 2.1980 2.1596 – 2.2276

 NZD/CAD

The New Zealand dollar swung within a ~1.25c range against the Canadian dollar since our last report, although presently sits only marginally lower in current trade. Both the NZD and CAD have slid since Friday, the NZD on the back of significant ‘risk off’ flow and the CAD on another bout of oil price weakness. The data calendar from both regions is light this week so these themes look set to continue to drive moves in this cross. We lack any strong bias at present on the next major move from here, although the weak oil price and bullish NZD events last week perhaps favour a drift higher.

DIRECT FX Current level Support Resistance Last wk range
NZD / CAD 0.9216 0.9140 0.9275 0.9074 – 0.9265

NZD/EURO (EURO/NZD)

The New Zealand dollar has slipped against the EUR since our last report. This comes on the back of the risk aversion selling in the NZD and safety buying in the EUR that has occurred as a result the heightened financial market uncertainty in recent days. Global growth and credit fears will continue to remain at the forefront of investor thinking in this environment and this has us favouring selling NZD rallies in this cross while this sentiment dominates. Minor resistance ahead of .6050 (1.6529 support) has now formed around .5965 (1.6764 support).

DIRECT FX Current level Support Resistance Last wk range
NZD / EUR 0.5910 0.5880 0.6050 0.5897 – 0.6055
EUR / NZD 1.6921 1.6530 1.7010 1.6516 – 1.6957

NZD/YEN

The New Zealand dollar has again fallen sharply against the Yen in recent trade on the back of a re-emergence in the theme of risk off selling (in the NZD) and safe-haven demand (JPY). This has come about as global share markets turned sharply negative since our last report. This theme has been a regular one so far in 2016 as global and emerging market growth fears have dominated. These were joined overnight by a spike in credit market concerns, especially in the financial sector. We expect a heavy tone to dominate until markets undergo a sustained period of calm, a likelihood that unfortunately looks remote at present.

DIRECT FX Current level Support Resistance Last wk range
NZD / YEN 76.42 75.70 77.60 76.21 – 79.21

AUD/USD

The Australian dollar has fallen sharply against the USD since our last report quickly erasing most of last week’s gains. This comes on the back of the heavy selling seen in the ‘risk’ currencies that has occurred after the sharp falls observed in global equities in the last two sessions. These declines have not been helped by a sharp rise in credit market concerns overnight. These issues look set to dominate again this week as they have so far in 2016 and will surely weigh on the enthusiasm of rallies in the foreseeable future. Speeches by the U.S. Fed chair (Thursday) and the RBA Governor (Friday) are the key events this week.

DIRECT FX Current level Support Resistance Last wk range
AUD / USD 0.7062 0.7050 0.7250 0.7008 – 0.7241

AUD/GBP (GBP/AUD)                            

The Australian dollar has fallen against the U.K. pound in recent trade, although sits well off its lows seen since our last report. The declines come on the back of heavy selling seen in the AUD/USD exchange rate, these declines have outweighed those of the GBP/USD- although have moderated somewhat in recent trade. ‘Risk’ concerns have hit the AUD more so than the GBP, this is typically the case during periods of heightened market turmoil such as those seen since Friday. We marginally favour lower levels in this environment although making calls in such flighty markets is extremely difficult.

DIRECT FX Current level Support Resistance Last wk range
AUD / GBP 0.4898 0.4850 0.4950 0.4864 – 0.4962
GBP / AUD 2.0417 2.0200 2.0620 2.0152 – 2.0558

AUD/EURO (EURO/AUD)

The Australian dollar has continued to fall heavily against the Euro this week and now sits some 3% below its opening levels this month. This comes on the back of the strong recent showing seen in the Euro which has benefitted from ‘safety’ flow during the recent period of elevated financial market uncertainty. The AUD is typically very vulnerable during periods where market risk appetite is reduced, such as those experienced in recent days. We favour lower Australian dollar levels ahead.

DIRECT FX Current level Support Resistance Last wk range
AUD / EUR 0.6313 0.6220 0.6400 0.6313 – 0.6539
EUR / AUD 1.5840 1.5625 1.6080 1.5294 – 1.5840

AUD/YEN

The Australian dollar has continued to rise sharply against the Japanese Yen since our last report and took another sharp boost after the unexpected easing by the BOJ on Friday. This move has bolstered demand for risk assets (AUD+), and at the same time saw a sharp reduction in JPY longs (USD shorts) as traders moved to cover speculative positioning that was extended ahead of the announcement. The RBA cash rate decision this afternoon poses the first risk to this cross. Friday will also be important with the release of Australian retail sales and the RBA statement on monetary policy. We favour higher levels given the presently opposing sentiment displayed towards the JPY and AUD.

DIRECT FX Current level Support Resistance Last wk range
AUD / YEN 81.61 79.20 83.50 81.61 – 86.13

AUD/CAD

The Australian dollar continues to edge lower against the Canadian dollar in trade this week. This is a continuation of the theme seen so far in 2016 and comes on the back of the sharp reversal in fortunes of the USD/CAD exchange rate seen since Jan 20. Another fall in the oil price this week, whilst denting the CAD fortunes, has been balanced by large falls in the AUD/USD since our report on Friday. This occurred amidst the heavy declines seen in global equities. Elevated global growth and credit market concerns will continue to dominate the ‘risk sensitive’ AUD flow this week, the CAD meanwhile will continue to be heavily influenced by oil market developments. We favour selling rallies in this cross.

DIRECT FX Current level Support Resistance Last wk range
AUD / CAD 0.9845 0.9720 0.9915 0.9795 – 0.9952

————————————————————————————————————————-

To subscribe to our free daily Currency Rate Sheet and News email, enter your email address here.

Email:  

————————————————————————————————————————–

Market commentary:

Last week’s dream run by the NZD/USD and AUD/USD appear to be a distant memory this week after another spike in global fear and anxiety levels overnight. Financial market jitters have been a constant theme so far in 2016. These jitters have been elevated by fears over a China slowdown and deteriorating emerging markets, many of which have budgets which are heavily dependent on a recovering oil price. Concerns in the credit markets over energy related loans spread to the financial credit sector overnight after rumours circulated that a large German bank would be unable to meet payments on some of its riskiest debt securities. The uncertainty has increased the appeal of key safe haven government bonds whilst in Europe a further deterioration has been seen in the peripheral spreads of deeply indebted countries versus German bunds. As is typically the case during such periods the JPY has also been a large beneficiary of the safety flow and has surged over 5% against the USD since the start of last week.

Australia

After a strong performance during the week the AUD surrendered much of its gains in late trade on Friday post the release of the latest U.S. employment report. The report was mixed, although the miss in payrolls growth garnered much of the market’s attention. This led to decent declines in the U.S. equity bourses, a lead which was mimicked by other offshore exchanges in opening trade this week. Trade in the AUD was mixed on Friday prior to the data, this despite a miss in the latest Australian retail sales data. The simultaneous release of the RBA statement on monetary policy created little fuss after the RBA made no material changes to its GDP or inflation forecasts. It also noted solid employment growth and reasonable prospects for continued growth in the economy. The bank highlighted the part played by a falling Australian dollar in helping rebalance the economy and repeated that the low levels of inflation may provide scope for easier monetary policy if required. Earlier in the week the RBA left the cash rate unchanged at 2 % as expected. Other data releases included better than expected building approvals numbers and a rise in the NAB business confidence series. Of interest this week will be business confidence (today) and consumer sentiment (tomorrow) numbers. The low impact nature of the calendar will however mean offshore events and risk sentiment will again be the primary drivers.

New Zealand

The NZD has begun the week on a softer footing after much of last week’s gains were erased on Friday post the release of the latest U.S. employment report. Earlier the NZD had put in its best weekly performance of 2016 after local data which showed the unemployment rate falling to its lowest levels since March 2009, in the final quarter of 2015. Comments from the RBNZ Governor also played a part in the rally after he highlighted the other RBNZ considerations aside from inflation when assessing monetary policy settings (inflation, last 0.1% in Q4 vs. the 1-3% RBNZ target). The U.S. employment data release was mixed as a miss in the creation of new jobs for January was offset by a better than expected unemployment rate and surprise rise in average earnings. U.S. equities fell after the report as did the odds for another Fed rate hike in March. The decline in investor sentiment saw key ‘risk’ currencies like the NZD and AUD fall sharply on the day. Other key global equity exchanges followed the U.S. lead in trade yesterday and overnight (Japan aside). A largely empty local calendar should ensure that trade in the NZD again takes its cue from offshore events this week, Of key influence will be Fed Chair Janet Yellen’s semi-annual monetary policy report.

United States

The USD continues to trade with a soft tone this week, although the losses have tempered somewhat after last week’s poor showing. Last week’s misses in the U.S. data flow were numerous and culminated in a decline in January non-farm payrolls to 151k from a revised 262k the month prior. The number failed to meet the consensus forecast, although the unemployment rate again fell reaching a fresh cyclical low at 4.9%. A rise in average hourly earnings will be welcomed by the Fed especially in light of its underperformance in the face of the steadily improving labour market(which saw unemployment peak at 10% during the height of the GFC). Questions will remain over its durability however, and most in the market continued to reduce their expectations after the data of a Fed rate hike at the next meeting in March. PMI data released last week was underwhelming and was joined by a miss in the factory order and jobless claims numbers. Focus for the USD this week will centre on a speech by Fed Chair Yellen to congress on Thursday, where a tactile approach will be needed so as to not heighten the already elevated financial market nervousness.

Europe

The EUR is trading on a solid footing again this week and retains most of last week’s gains seen against the USD. The currency was in solid demand in overnight trade on the back of a flight to safety in key government bonds as the elevated financial market uncertainty again took a turn for the worse. Credit market concerns were to the fore during trade, these concerns shifted to European banks and helped the Euro Stoxx 50 close some 3.3% lower, other global equity bourses also fell heavily in overnight trade. EUR gains last week were fuelled by general USD malaise, in part after continued softer U.S. data-flow but also on the back of more guarded comments from Fed officials. European data showed euro-zone unemployment at 4-year lows and composite PMI numbers which just topped consensus forecasts. Comments from ECB president Draghi again focussed on the case for easier monetary policy, although failed to make much impact on the EUR demand. Data scheduled for release this week includes the euro-area GDP and industrial production releases although talk from Fed Chair Janet Yellen is likely to have a more far reaching effect on sentiment.

United Kingdom

The GBP has shifted lower since our last report in part on the back of a move out of more risky currencies, this as credit, global growth and emerging market concerns weigh heavily again on investor sentiment. These issues also have many considering the wisdom of central bank interest rate hikes in 2016. Adding to the move is questioning whether the BoE may shift to adopt an easing bias should the heightening financial market volatility continue. This comes on the back of last week’s decision by the BoE to unanimously leave rates on hold at 0.5% and express a belief that the next move in rates would be higher. Data released during the week included better than expected manufacturing and services PMI data, the construction number declined however and failed to match expectations. It is a quiet week this week in the U.K., trade data due for release tonight is unlikely to trouble, whilst manufacturing and industrial production numbers slated for released tomorrow are likely to have more impact (still limited). House price data is due for release on Thursday.

Japan

The JPY has continued to surge in trade so far this week adding to the already impressive gains seen last week. Those gains were helped by a softer USD overall, which declined on the back of further soft data flow and reducing expectations of a Fed rate hike at the March FOMC meeting. A sharp deterioration in ‘risk’ sentiment and correlated surge in JPY ‘safe haven’ appeal has seen the JPY appreciate sharply in recent hours. The move was backed by declining equity bourses, weakening commodity prices (precious metals aside) and heightened credit market concerns. Japanese data releases last week included a decline in household confidence and marginal miss in the latest manufacturing PMI data. Labour cash earnings released yesterday showed just a 0.1% y/y rise for December, much less than the 0.7% expectations. The data just adds to the case for the recent move by the BOJ to shift interest rates below zero. The outlook for the JPY this week will continue to depend on swings in risk sentiment, this sentiment is currently being undermined by deteriorating corporate credit markets and sharply lower global equity bourses as global growth and emerging markets concerns weigh heavily on investor outlook.

Canada

Weakening oil prices have once again placed the CAD under pressure in trade this week. The lower prices come after reports that a meeting between Saudi Arabia and Venezuela over the weekend have accomplished little headway towards reaching an agreement to curtail production. Canadian data released on Friday didn’t help the sentiment towards the CAD either, this after net employment failed to reach the market’s expectations and the unemployment rate ticked higher to 7.2% in January. The simultaneous Ivey PMI release easily exceeded the consensus forecast however. Building permits data released overnight showed a large improvement on the month prior and also easily exceeded forecasts. House price data on Friday is the only other release of interest, this should once again leave CAD pricing vulnerable to swings in the oil price. Supply data from the American Petroleum institute and monthly reports from OPEC and the IEA are awaited by the oil market this week.

Daily exchange rates

<!–

var root_url = "http://www.interest.co.nz/charts-csv/";
var tabs_count="7";
var csvfiles_loc= ["/charts-csv/chart_data/exchangerates/daily-usd.csv"," /charts-csv/chart_data/exchangerates/daily-aud.csv"," /charts-csv/chart_data/exchangerates/daily-twi.csv"," /charts-csv/chart_data/exchangerates/daily-yen.csv"," /charts-csv/chart_data/exchangerates/daily-yuan.csv"," /charts-csv/chart_data/exchangerates/daily-eur.csv"," /charts-csv/chart_data/exchangerates/daily-gbp.csv"];
var chart_title_arr= ["US dollar","Australian dollar","Trade weighted index","Japanese Yen","Chinese Yuan","Euro","British pound"];
var chart_subtitles_arr= ["Daily benchmark rate","Daily benchmark rate","Daily benchmark rate","Daily benchmark rate","Daily benchmark rate","Daily benchmark rate","Daily benchmark rate"];
var tab_titles_arr= ["US$","AU$","TWI","u00a5en","u00a5uan","u20acuro","GBP"];
var source_arr= ["RBNZ","RBNZ","RBNZ","RBNZ","RBNZ","RBNZ","RBNZ"];
var source_hyperlink_arr= ["8"];
var tabswidth="8";
var decimal_arr= ["4","4","4","2","2","4","4"];

// variable declaration
var xpad;
var padding_value=0;
var range_selector=0
var loc;
var updt;
var val_num;
var vi=0;
var max_val;
var x;

var finalAr = new Array();
for (var i = 0; i <= tabs_count; i++) {
finalAr[i] = new Array();
}
var flagAr = new Array();
for (var i = 0; i <= tabs_count; i++) {
flagAr[i] =[];
}
var yaxisAr = new Array();
for (var i = 0; i 536)
{
var b = arr.length – 536; // to get last 36 points
}
else if (arr.length < 536)
{
var b = 537 – arr.length;
}
else if(arr.length == 536)
{
var b=2;
}

// to generate the format for date representation in x axis

var timestamweek = 604800000;
var timestamday = 86400000;
var timestammonth30 = 2592000000;
var timestammonth31 = 2678400000;
var timestamyear = 31536000000;
var timestamquarterly = 7776000000;

for (var u=0;u<2;u++) {
arr[u] = parseLineCSV(arr[u]);
fomat= String(arr[u][0]);
var k=0;

do {
k++;
} while(fomat.charAt(k)!="-")
var k1 =k;

do {
k++;
} while(fomat.charAt(k)!="-")
var k2=k;

do {
k++;
} while(k<fomat.length)
var k3=k;

var dd= fomat.substring(0,k1);
var mm = fomat.substring(k1+1,k2);
var yy = "20"+fomat.substring(k2+1,k3+1);
var yy1=fomat.substring(k2+1,k3+1);

// conversion of months into numerical form

//+++++++++++++++++++++++++++++++++++
if (mm == "Jan")
{
mm= "01";
}
else if (mm == "Feb")
{
mm= "02";
}

else if (mm == "Mar")
{
mm= "03";
}

else if (mm == "Apr")
{
mm= "04";
}

else if (mm == "May")
{
mm= "05";
}

else if (mm == "Jun")
{
mm= "06";
}

else if (mm == "Jul")
{
mm= "07";
}

else if (mm == " Aug")
{
mm= "08";
}

else if (mm == "Sep")
{
mm= "09";
}

else if (mm == "Oct")
{
mm= "10";
}

else if (mm == "Nov")
{
mm= "11";
}

else if (mm == "Dec")
{
mm= "12";
}

// +++++++++++++++++++++++++++++++++++++++++++++++++++++++

var date2 = mm+"/"+dd+"/"+yy;

if (u==0)
{
var timestam1 = Date.parse(date2);
}
else if(u==1)
{
var timestam2 = Date.parse(date2);
}
}
var timestamvar = (timestam2- timestam1);
var flagAR_count=0;
for (var i=2;i<arr.length;i++) {
flagAR_count++;
var tempAr = new Array();
var tempAr1 = new Array();
arr[i] = parseLineCSV(arr[i]);
if (arr[i]!='')
{

fomat= String(arr[i][0]);
replic=String(arr[i][0]);
var k=0;

do {
k++;
} while(fomat.charAt(k)!="-")
var k1 =k;

do {
k++;
} while(fomat.charAt(k)!="-")
var k2=k;

do {
k++;
} while(k<fomat.length)
var k3=k;

var dd= fomat.substring(0,k1);
var mm = fomat.substring(k1+1,k2);
var current_year=""+new Date().getFullYear();
var c_year=Number(current_year.substring(2,4));
var c_data=Number(''+fomat.substring(k2+1,k3+1));
if(c_data c_year)
{
var yy = “19”+fomat.substring(k2+1,k3+1);
}
else if(c_data == c_year)
{
var yy = “20”+fomat.substring(k2+1,k3+1);
}
// conversion of months into numerical form

//+++++++++++++++++++++++++++++++++++
if (mm == “Jan”)
{
mm= “01”;
}
else if (mm == “Feb”)
{
mm= “02”;
}

else if (mm == “Mar”)
{
mm= “03”;
}

else if (mm == “Apr”)
{
mm= “04”;
}

else if (mm == “May”)
{
mm= “05”;
}

else if (mm == “Jun”)
{
mm= “06”;
}

else if (mm == “Jul”)
{
mm= “07”;
}

else if (mm == “Aug”)
{
mm= “08”;
}

else if (mm == “Sep”)
{
mm= “09”;
}

else if (mm == “Oct”)
{
mm= “10”;
}

else if (mm == “Nov”)
{
mm= “11”;
}

else if (mm == “Dec”)
{
mm= “12”;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++

var date = mm+”/”+dd+”/”+yy;

var timestam_1 = Date.parse(date);
var timestam= timestam_1+86400000; //86400000 added to get correct timezone output from Date.parse
var time4 = new Date(timestam);
var Weeko = time4.getDay();
var dd2 = time4.getDate();
var mm2 = time4.getMonth();
var flag_y=arr[i][1];
var ahref_title=”Click here for full story”;
if(arr[i][2]) {
var url=arr[i][2];
var flag_date='{“x”:’+timestam+’, “title”:”  “,”text”:”Click here for Story!”}’;

flagAr[csvgen_counter].push(flag_date);
}
var yy2 = time4.getFullYear();
var yy3 = yy2+””;
var yy4= yy3.substring(2,4);
//++++++++++++++++++++++++this for days conversion++++++++++++++++++++++++++++
if (Weeko==1)
{
Weeko = “Mon”;
}

else if (Weeko==2)
{
Weeko = “Tue”;
}

else if (Weeko==3)
{
Weeko = “Wed”;
}

else if (Weeko==4)
{
Weeko = “Thu”;
}

else if (Weeko==5)
{
Weeko = “Fri”;
}

else if (Weeko==6)
{
Weeko = “Sat”;
}

else if (Weeko==0)
{
Weeko = “Sun”;
}

//+++++++++++++++++++++++this is for month conversion+++++

if (mm2==0)
{
mm2 = “Jan”;
}

else if (mm2==1)
{
mm2 = “Feb”;
}

else if (mm2==2)
{
mm2 = “Mar”;
}

else if (mm2==3)
{
mm2 = “Apr”;
}

else if (mm2==4)
{
mm2 = “May”;
}

else if (mm2==5)
{
mm2 = “Jun”;
}

else if (mm2==6)
{
mm2 = “Jul”;
}

else if (mm2==7)
{
mm2 = “Aug”;
}

else if (mm2==8)
{
mm2 = “Sep”;
}

else if (mm2==9)
{
mm2 = “Oct”;
}

else if (mm2==10)
{
mm2 = “Nov”;
}

else if (mm2==11)
{
mm2 = “Dec”;
}
//++++++++++++++++++++++++++++++++++++++++

//weekly
if ( timestamvar == timestamweek)
{
fomat2=dd2+”-“+mm2+”-“+yy4;
padding_value=timestamweek;
range_selector=2;
}

// Daily
else if ( timestamvar = timestamyear)
{
fomat2=mm2+”-“+yy4;
padding_value=timestamyear;
range_selector=3;
}

//monthly
else if ((timestamvar <= timestammonth30)&&(timestamvar = timestamquarterly)
{
fomat2=mm2+”-“+yy4;
padding_value=timestamquarterly;
range_selector=3;
}

else
{
fomat2=dd2+”-“+mm2+”-“+yy4;
padding_value=timestamday;
range_selector=3;
}

arr[i][0]= fomat2;
var decpad;
decpad = parseFloat(arr[i][1]);
arr[i][1] = decpad;

if(i==(arr.length-1))
{

// Functionality to get the last value

var xvalu=dd2+”-“+mm2+”-“+yy4;
var yvalu= String(arr[i][1]);
var xyvalu=”Latest value at “+xvalu+” is “+yvalu;
updt=”Updated on “+xvalu;
}

tempAr.push(timestam);
if(!arr[i][1])
{
arr[i][1]=null;
}
yaxisAr[csvgen_counter].push(arr[i][1]);
// tempAr1.push(timestam);
// tempAr2.push(tempAr1);
tempAr.push(arr[i][1]);
last_val=timestam;
finalAr[csvgen_counter].push(tempAr);
}
xpad=last_val+padding_value; //*****************to end up graph early//////
if(arr[i]== “”)
{
vi=arr.length-i;
arr.length=arr.length-vi;
i=arr.length-1;
fomat = replic;

var k=0;

do {
k++;
} while(fomat.charAt(k)!=”-“)
var k1 =k;

do {
k++;
} while(fomat.charAt(k)!=”-“)
var k2=k;

do {
k++;
} while(k<fomat.length)
var k3=k;

var dd= fomat.substring(0,k1);
var mm = fomat.substring(k1+1,k2);
var yy = "20"+fomat.substring(k2+1,k3+1);

// conversion of months into numerical form

//+++++++++++++++++++++++++++++++++++
if (mm == "Jan")
{
mm= "01";
}
else if (mm == "Feb")
{
mm= "02";
}

else if (mm == "Mar")
{
mm= "03";
}

else if (mm == "Apr")
{
mm= "04";
}

else if (mm == "May")
{
mm= "05";
}

else if (mm == "Jun")
{
mm= "06";
}

else if (mm == "Jul")
{
mm= "07";
}

else if (mm == "Aug")
{
mm= "08";
}

else if (mm == "Sep")
{
mm= "09";
}

else if (mm == "Oct")
{
mm= "10";
}

else if (mm == "Nov")
{
mm= "11";
}

else if (mm == "Dec")
{
mm= "12";
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++

var date = mm+"/"+dd+"/"+yy;
//here flagAr may be
var timestam = Date.parse(date);
var time4 = new Date(timestam);
var Weeko = time4.getDay();
var dd2 = time4.getDate();
var mm2 = time4.getMonth();

var yy2 = time4.getFullYear();
var yy3 = yy2+"";
var yy4= yy3.substring(2,4);
//++++++++++++++++++++++++this for days conversion++++++++++++++++++++++++++++
if (Weeko==1)
{
Weeko = "Mon";
}

else if (Weeko==2)
{
Weeko = "Tue";
}

else if (Weeko==3)
{
Weeko = "Wed";
}

else if (Weeko==4)
{
Weeko = "Thu";
}

else if (Weeko==5)
{
Weeko = "Fri";
}

else if (Weeko==6)
{
Weeko = "Sat";
}

else if (Weeko==0)
{
Weeko = "Sun";
}

//+++++++++++++++++++++++this is for month conversion+++++

if (mm2==0)
{
mm2 = "Jan";
}

else if (mm2==1)
{
mm2 = "Feb";
}

else if (mm2==2)
{
mm2 = "Mar";
}

else if (mm2==3)
{
mm2 = "Apr";
}

else if (mm2==4)
{
mm2 = "May";
}

else if (mm2==5)
{
mm2 = "Jun";
}

else if (mm2==6)
{
mm2 = "Jul";
}

else if (mm2==7)
{
mm2 = "Aug";
}

else if (mm2==8)
{
mm2 = "Sep";
}

else if (mm2==9)
{
mm2 = "Oct";
}

else if (mm2==10)
{
mm2 = "Nov";
}

else if (mm2==11)
{
mm2 = "Dec";
}
//++++++++++++++++++++++++++++++++++++++++

//weekly
if ( timestamvar == timestamweek)
{
fomat2=dd2+"-"+mm2+"-"+yy4;
}

// Daily
else if ( timestamvar = timestamyear)
{
fomat2=mm2+”-“+yy4;
}

//monthly
else if ((timestamvar <= timestammonth30)&&(timestamvar = timestamquarterly)
{
fomat2=mm2+”-“+yy4;
}

arr[i][0]= fomat2;
var decpad;

decpad = parseFloat(arr[i][1]);
//arr[i][1] = roundVal(decpad);
arr[i][1] = decpad;
if(i==(arr.length-1))
{

var xvalu=dd2+”-“+mm2+”-“+yy4;
var yvalu= String(arr[i][1]);
var xyvalu=”Latest value at “+xvalu+” is “+yvalu;
updt=”Updated on “+xvalu;
}
}

}
}

//other required functions

//chart configuration starts here

function getXMLHttpRequest(file) {

//var arrSignatures = [“MSXML2.XMLHTTP.5.0”, “MSXML2.XMLHTTP.4.0″,
//”MSXML2.XMLHTTP.3.0”, “MSXML2.XMLHTTP”,
//”Microsoft.XMLHTTP”];

//for (var i=0; i < arrSignatures.length; i++) {

try
{
var xmlhttp = new window.XMLHttpRequest();
xmlhttp.open("POST",file,false);
return xmlhttp;
}
catch(e)
{
error=e.message;
}

//}
throw new Error("MSXML is not installed on your system.");
}

function readCSV(locfile) {
// load a whole csv file, and then split it line by line
var req = new getXMLHttpRequest(locfile);
//req.open("POST",locfile,false);
req.send("");
return req.responseText.split(/n/g);
}

function parseLineCSV(lineCSV) {
// parse csv line by line into array
var CSV = new Array();

lineCSV = lineCSV.replace(/,/g," ,");

lineCSV = lineCSV.split(/,/g);

// This is continuing of 'split' issue in IE
// remove all trailing space in each field
for (var i=0;i<lineCSV.length;i++) {
lineCSV[i] = lineCSV[i].replace(/s*$/g,"");
}

lineCSV[lineCSV.length-1]=lineCSV[lineCSV.length-1].replace(/^s*|s*$/g,"");
var fstart = -1;

for (var i=0;i=0) {
for (var j=fstart+1;j<=i;j++) {
lineCSV[fstart]=lineCSV[fstart]+","+lineCSV[j];
lineCSV[j]="-DELETED-";

}
fstart=-1;
}
}
fstart = (lineCSV[i].match(/^"/)) ? i : fstart;
}

var j=0;

for (var i=0;i<lineCSV.length;i++) {
if (lineCSV[i]!="-DELETED-") {
CSV[j] = lineCSV[i];
j++;
}

}

return CSV;
}

function roundVal(val_num){
var dec = 2;
var result = Math.round(val_num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}

function setdecimalpoints(deca)
{
var deca1= deca;
var deca2= parseInt(deca);
if((deca1-deca2)!=0)
{
return 2;
}
else
{
return 0;
}
}
for(i=0;i

Charts loading…
Charts loading…
Charts loading…
Charts loading…
Charts loading…
Charts loading…
Charts loading…

—————————–

Ian Dobbs is a currency analyst with Direct FX You can contact him here »