Markets set for extended period of volatility; path ahead for UK uncertain; GBP falls 12% against USD to 1985 levels

By Ian Dobbs*:

Markets look set for an extended period of uncertainty and elevated volatility in the aftermath of the UK’s decision to depart the EU on Friday.

Pain is being felt across the globe as investors have moved quickly to re-price those assets with the greatest exposure to a slowdown in global growth.

Risk currencies such as the NZD and AUD have been in the crosshair, although the falls in them pale in comparison to the falls seen by the GBP which has fallen around 12% against the USD to lows last seen in 1985.

The plunge is well grounded given that the path ahead for the UK is now highly uncertain. Estimates from the UK Treasury forecast are that the UK GDP could be anywhere between 5.4-9.5% lower in 15 years’ time should the UK proceed with a Brexit.

Meanwhile the political landscape in the UK is disintegrating after PM Cameron resigned as he indicated he had no interest in being part of Britain’s EU exit negotiations which are likely to see the EU position to negotiate strongly to protect the integrity of the European project.

Calls are mounting for a second UK EU referendum whilst a referendum on a Scottish exit from the UK in the not-too distant future is now a given.

Major Announcements last week:

  • Australian Q1 House Price Index, -0.2% q/q vs. 0.8% exp.
  • EU ZEW Survey-Economic Sentiment, 20.2 vs. 15.3 exp. (Jun.)
  • Canadian Retail Sales, 0.9% m/m on exp. (Apr.)
  • US Existing Homes Sales Change, 1.8% m/m vs. 1.1% exp. (May)
  • Japanese Nikkei Manufacturing PMI, 47.8 vs 48.2 exp (Jun.)
  • German Markit Manufacturing PMI, 54.4 vs. 51.9 exp. (Jun.)
  • US Initial Jobless Claims (Jun 17), 259k vs. 270k exp.
  • US Markit Manufacturing PMI, 51.4 vs. 50.8 exp. (Jun.)
  • German IFO-Business Climate, 108.7 vs. 107.5 exp. (Jun.)
  • US Durable Goods Orders, -2.2% vs. -0.5% exp. (May)

NZD/USD

The New Zealand dollar has fallen sharply against the USD after Friday’s UK vote to leave the EU. Volatility has been extreme after the news as risk currencies slumped in response to the prospect of a period of elevated uncertainty and reduced global growth. Expect another volatile week as the markets gyrate over headlines out of the UK and the EU, whilst in the US data of interest starts with numbers on GDP today. Initial support is eyed in the broad .6940/75 zone a break of which opens .6900 and .6850. Resistance has again formed in the .7150/65 area. We strongly favour selling rallies near first resistance in this environment.

DIRECT FX Current level Support Resistance Last wk range
NZD / USD 0.7022 0.6940 0.7165 0.6982 – 0.7288

NZD/AUD (AUD/NZD)

The New Zealand dollar has remained within a range against the Australian dollar since our last report. This comes as the decision by the UK to leave the EU has affected both the NZD and AUD in similar ways in response to moves away from those currencies perceived as more risky. Expect a similar week this week with ranges that respond to flow against the USD given the lack of incoming key data from either country. We favour buying AUD over NZD overall, although a sustained break of .9600 (under 1.0417) should open further NZ dollar upside. The Australian election will offer the lead in the near term.

DIRECT FX Current level Support Resistance Last wk range
NZD / AUD 0.9534 0.9480 0.9600 0.9502 – 0.9586
AUD / NZD 1.0489 1.0417 1.0549 1.0432 – 1.0524

NZD/GBP (GBP/NZD)

The decision on Friday by the UK to choose to leave the EU has seen the GBP plummet against the New Zealand dollar since the result. The move is a manifestation of the material re-rating in the GBP as the market discounts the prospects for the UK economy given the relative uncertainty it will experience over the months and years ahead. Look for this sentiment to dictate the trade ahead which has us favouring further NZD outperformance of the GBP over time should the UK proceed to exit. First NZD resistance may lie near the recent highs (~.5365, 1.8639), although further GBP weakness beckons the 2013 highs near .5650 (1.7699) in the weeks ahead. Support is seen at .5150 (1.9417 resistance) initially, although in reality the degree of volatility severely weakens the importance of such levels.

DIRECT FX Current level Support Resistance Last wk range
NZD / GBP 0.5309 0.5150 0.5365 0.4828 – 0.5366
GBP / NZD 1.8837 1.8639 1.9417 1.8635 – 2.0712

 NZD/CAD

The New Zealand dollar has eased against the Canadian dollar since our report on Friday. The move comes on the back of the decision by the UK to leave the EU which saw the ‘risk’ currencies punished severely after the news. This occurred in part on the back of the overconfidence that the market had placed on a ‘Bremain’ vote running into the vote (which saw the ‘risk currencies rally strongly into Friday). Look for global confidence and swings in risk appetite to dominate moves in the cross this week as volatility in the ‘risk’ currencies supersedes any fallout from the Brexit on the price of oil.

DIRECT FX Current level Support Resistance Last wk range
NZD / CAD 0.9175 0.9060 0.9320 0.9084 – 0.9311

NZD/EURO (EURO/NZD)

The New Zealand dollar sits at a similar level to Friday’s report in current trade against the Euro. Volatility has been high since Friday’s decision by the UK to leave the EU. Highs near .6470 (lows 1.5456) came soon after the decision, although trading levels have drifted lower in trade this week on the back of the overnight slide in the NZD/USD exchange rate. We favour buying NZ dollar dips near first support given the ongoing difficulties facing Europe over the weeks/months ahead. Data during the week is light with the Euro-zone inflation numbers on Thursday and ECB minutes being the most important.

DIRECT FX Current level Support Resistance Last wk range
NZD / EUR 0.6372 0.6300 0.6470 0.6267 – 0.6469
EUR / NZD 1.5693 1.5456 1.5873 1.5459 – 1.5956

NZD/YEN

The New Zealand dollar has fallen heavily against the Japanese Yen since our report on Friday. The move comes on the back of the decision by the UK to leave the EU which has seen investors depart ‘risk’ currencies like the NZD in favour of ‘safe haven’ currencies like the JPY (and USD,CHF). We favour buying JPY on dips against the NZD near first resistance (above 73.00) given the likelihood of a protracted period of market volatility in the weeks ahead. Data considerations this  week include Japanese inflation numbers and the Tankan survey on Friday but expect these to hold little sway against the relative importance of the Brexit headlines.

DIRECT FX Current level Support Resistance Last wk range
NZD / YEN 71.41 69.00 73.35 70.04 – 77.70

AUD/USD

The Australian dollar has fallen sharply against the USD in response to the UK’s decision to leave the EU on Friday. The move comes on the back of a wholesale departure from riskier currencies like the AUD on the back of concerns over a period of considerable uncertainty for the global economy which has seen global equities fall sharply since the news. Initial support is seen in the .7290/.7305 zone, whilst resistance is eyed at .7450 and then .7500/10. Data in Australia this week is light so look for the prevailing risk sentiment and incoming US data to influence. We favour selling rallies in this highly uncertain environment.

DIRECT FX Current level Support Resistance Last wk range
AUD / USD 0.7360 0.7290 0.7450 0.7314 – 0.7643

AUD/GBP (GBP/AUD) 

The Australian dollar has been re-rated materially higher against the UK pound in the wake of the decision by British voters in choosing to leave the EU on Friday. The move comes as the GBP has fallen ~12% against the greenback to lows last seen in 1985 as investors fear for the prospects of the UK economy in years ahead should they proceed to leave the EU. Look for Brexit sentiment to dominate this week (and in the weeks ahead) which has us favouring buying AUD over the GBP targeting entries near first support ahead of .5465 (1.8298 resistance).

DIRECT FX Current level Support Resistance Last wk range
AUD / GBP 0.5564 0.5465 0.5630 0.5072 – 0.5626
GBP / AUD 1.7973 1.7762 1.8298 1.7773 – 1.9716

AUD/EURO (EURO/AUD)

The Australian dollar sits at similar levels against the Euro in current trade to those seen on Friday. This comes despite the decision by the UK to leave the EU, which initially saw the cross trade to highs above .6750 (1.4815). The easing in recent hours comes on the back of the relative underperformance by the ‘risk’ currencies in overnight trade against the USD. First support for the cross is noted around .6600 (1.5152 resistance), whilst Friday’s highs above .6750 (1.4815) is the first level to watch on the topside. We favour buying dips in the cross as the political environment heats up in the EU over the weeks ahead, although global risk appetite complicates the call considerably.

DIRECT FX Current level Support Resistance Last wk range
AUD / EUR 0.6678 0.6600 0.6755 0.6584 – 0.6752
EUR / AUD 1.4973 1.5152 1.4804 1.4810 – 1.5189

AUD/YEN

The Australian dollar has fallen sharply against the Japanese Yen in the wake of Friday’s decision by the UK to leave the EU. The move comes as the market quickly unwound the ill-founded gains that had taken place running into Friday’s vote which had assumed that the UK would vote to remain within the EU. The significant volatility and declines on global equity exchanges has seen the JPY appreciate materially on ‘safe haven’ flow, whilst the AUD has felt the weight of a significant flow out of ‘risk’ assets/currencies. Look for this theme to dominate again this week. We favour selling rallies in this cross, hopefully near first resistance (76.90/77.00).

DIRECT FX Current level Support Resistance Last wk range
AUD / YEN 74.84 72.50 77.00 73.32 – 81.57

AUD/CAD

The Australian dollar has eased against the Canadian dollar in the wake of the decision by the UK to leave the EU on Friday. The move comes on the back of the heavy selling which took place in the ‘risk’ currencies as investors moved to re-weight away from those currencies with the heaviest exposure to a likely slowdown in global growth. Oil prices have also fallen in the wake of the decision (CAD-), although the prevalent theme of ‘risk-off’ has dominated the move in this cross. Look for this theme to hold sway this week which has us favouring selling rallies for the time being.

DIRECT FX Current level Support Resistance Last wk range
AUD / CAD 0.9617 0.9500 0.9760 0.9513 – 0.9748

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

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

Email:  

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

Market commentary:

Markets look set for an extended period of uncertainty and elevated volatility in the aftermath of the UK’s decision to depart the EU on Friday. Pain is being felt across the globe as investors have moved quickly to re-price those assets with the greatest exposure to a slowdown in global growth. Risk currencies such as the NZD and AUD have been in the crosshair, although the falls in them pale in comparison to the falls seen by the GBP which has fallen around 12% against the USD to lows last seen in 1985. The plunge is well grounded given that the path ahead for the UK is now highly uncertain. Estimates from the UK Treasury forecast are that the UK GDP could be anywhere between 5.4-9.5% lower in 15 years’ time should the UK proceed with a Brexit. Meanwhile the political landscape in the UK is disintegrating after PM Cameron resigned as he indicated he had no interest in being part of Britain’s EU exit negotiations which are likely to see the EU position to negotiate strongly to protect the integrity of the European project. Calls are mounting for a second UK EU referendum whilst a referendum on a Scottish exit from the UK in the not-too distant future is now a given.

Australia

Gains posted by the AUD/USD heading into Friday’s UK EU vote quickly evaporated during the afternoon as the vote count showed that Britain had chosen to depart the EU. It was an outcome that had been discounted heavily by the financial markets. The shock result led to severe volatility during the offshore session as the market tried to ascertain the implications that the unprecedented move would have on the global economy and the UK/European political landscape. Falls in the AUD/USD totalled almost 3.5c (~4.5%) at one stage as investors shunned risk in favour of safe haven currencies. Events last week in Australia were uneventful. The RBA minutes which having had come prior to the Brexit vote failed to indicate an intention to ease, although the subsequent uncertainty that will flow from the UK’s decision when combined with stubbornly low local inflation should lift the prospect for a cut in coming months. Data on house March quarter house prices eased slightly, although the private sector data suggests a renewed pick-up since the survey, particularly so in Sydney. Indicators this week include HIA new home sales on Wednesday and private sector credit data on Thursday, although expect attention to focus offshore and on the Australian Federal election at the weekend.

New Zealand

The shock decision by British voters who chose to abandon the EU on Friday saw the NZD plummet in trade during the afternoon. Highs above .7300 against the USD quickly turned into a fall of over 4% as the vote revealed an unassailable lead for the ‘leave’ campaign well prior to the last count. Risk currencies sold off heavily on the news after they had previously followed the GBP higher earlier in the day as the market chose to ignore polls that had warned of a tight race. The result saw the GBP fall ~12% at one stage against the USD to lows not seen since 1985. Prior to Friday’s UK vote saw the release of bottom tier local data which included the latest migration numbers which showed an easing in the net monthly gain. Credit card spending posted a smaller rise from the month prior whilst trade data for May released yesterday which beat expectations posted a modest rise from the month prior. Data releases this week feature on Thursday as the latest building consents and ANZ business confidence data comes to market. As with last week expect these to have no impact given the unprecedented event of the UK vote to leave the EU.

United States

Friday’s shock UK vote to leave the EU has left financial markets in turmoil after the decision and has seen investors flock to safe haven currencies like the USD in its aftermath. The move comes as investors ditch the pound (~-12%) and the risk currencies as concerns over UK/EU growth mount in lieu of the new highly uncertain global financial environment. The move has seen US equities drop sharply (S&P 500 -5.3%, Dow -4.8%) since Friday and has seen the market move to discount any prospect of a Fed rate hike in 2016/17. This comes as the market looks to price in the prospects of slower US growth and a smaller rebound in inflation. The UK’s decision comes at a poor time for the US as the domestic economy appears to be losing momentum amid a slowdown in employment growth and sustained contraction in business investment. Data from last week prior to the British vote had little consequence given the magnitude of Friday’s potential outcome. US existing home sales rose to 9 year highs, whilst the initial jobless claims employment indicator posted a larger than expected decline. New home sales were seen falling 6% in May, whilst durable goods orders for the same month disappointed after falling 2.2%. This week so far has seen the latest services  and Dallas PMI come in under expectations and the latest trade deficit show an expansion from the month prior. Other data to feature this week begins with Q1 GDP numbers today although expect Brexit sentiment to again feature predominantly.

Europe

The decision by the UK in choosing to leave the EU has seen the Euro decline sharply as investors weigh up what the move means for the EU. The process of negotiating a UK exit is likely to be long one as UK leaders look to cherry pick the best parts of the relationship and as EU leaders seek to protect the integrity of the European project by not yielding to wishes from Britain that may encourage other member states to go it alone. The prospect of reduced EU growth and an extended period of political and economic uncertainty has led to sharp declines across the European equity bourses. The Euro Stoxx 50 has fallen 11%, whilst peripheral markets such as Spain’s IBEX 35 which has fallen 14%, reflect elevated concern over outlying EU nations seeking their own independence. Expect volatility to remain high in the weeks and months ahead. The degree of volatility will depend on the response of the financial markets to central bank words and whether the vote is seen by European leaders as an urgent call to fix the EU’s current problems, or whether it alternatively leads to increased break-up momentum across the EU. Data prior to Friday’s referendum last week understandably had little influence on the markets. The German ZEW current conditions index beat expectations, whilst the latest euro-zone consumer confidence remained weak-  a condition that looks only likely to deteriorate further in the months ahead. PMI indicators were mixed and included disappointments in France and strength in German manufacturing.

United Kingdom

Friday’s shock decision by the UK in choosing to leave the EU has seen the pound crash to lows against the greenback not seen since 1985. The decline from Friday’s highs has so far totalled around 12%, whilst Friday’s move of over 8% was almost double that of Black Wednesday in 1992 when the UK was forced out of Europe’s exchange rate mechanism. The decision which has sent shockwaves around the world has seen global equities plummet in its wake. Britain’s FTSE 100 fell around 8.7% at one stage during the day prior to moves by the BoE to add liquidity to the financial system. The decision now opens the door to a period of heightened uncertainty for the UK and Europe (and indeed globally) as British policymakers begin negotiations and look to eventually invoke Article 50 of the Lisbon treaty which will give the UK two years to negotiate an exit. The decision has invoked severe bickering amongst the UK political parties and has seen PM Cameron (who campaigned for the UK to remain in the EU) resign from his post. He indicated that he was not the right person to lead the UK forward in discussions in a move that has put the onus of negotiation on the Brexit campaigners (like potentially Boris Johnson) to navigate the uncertain waters ahead. Look for the GDP data on Thursday to be overlooked in light of the EU decision as investors look to the prospect of vastly reduced future UK growth and declining public finances should the UK proceed to leave the EU (note the UK politicians are not bound to actually follow the public’s vote).

Japan

The shock decision by the UK in voting to leave the EU on Friday has seen the Yen surge in trade after the news. The move was most notable against the ‘risk’ currencies and the British pound which has seen its exchange rate depreciate over 15% since Friday on the news as investors flocked to the relative safety of the Japanese Yen. The UK’s decision saw global equities plummet in the wake of the news. The near 8% decline in the Japanese Nikkei 225 on Friday was the largest decline in over 16 years and occurred as investors reacted to the higher Yen and deteriorating prospects for Japanese exporters. Japanese events last week had little influence on the market ahead of the UK EU vote. They included the latest BOJ minutes which showed policymaker concern over risks posed by overseas economies. Friday’s Brexit risk was seen as one of the key reasons that the BOJ didn’t move to ease further at the most recent monetary policy meeting. Trade numbers released on Monday posted a small fall from the month prior, whilst the latest indicator on Japanese manufacturing showed further weakness as conditions remained mired in contraction territory. Data this week starts with numbers on retail sales on Wednesday, although fortunes for the Yen will be linked to international markets and the prospect of BOJ intervention to stem its continued rise.

Canada

The volatility that has ensued after the UK voted to leave the EU on Friday has seen the Canadian dollar come under significant pressure on the news as investors moved to the relative safety of the USD. The decision which had been discounted by the market as unlikely, has led to a severe reaction across global equity bourses and has seen the price of oil marked lower by ~8%. This comes as investors fret over the potential for a decline in demand for oil if economic growth throughout the euro area falls sharply. Data from last week in Canada had little impact in light of the events going on globally. Wholesale sales were seen rebounding from the month prior, whilst April retail sales lifted in line with expectations at the headline level, although the core data was more than twice that expected. Data expected this week includes GDP for April and the latest index on raw materials pricing. Expect both to be quickly overlooked as the market looks past these historical reads in favour of the now clouded (post Brexit vote) outlook for global growth.

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 »