Tuesday, March 19, 2013

Today News Focus at EUR German ZEW Survey (Economic Sentiment) - 19 March 2013


EUR-German ZEW Survey (Economic Sentiment) at 10.00 GMT
    - Medium risk to trade on this news
    - Small Pip Profit might can get
    - Range of pip estimate is not signification

Trading Strategy :
    - Wait until 5 Minute after news
    - See direction of 5 minute Bar
    - Open Trade follow the bar direction
    - Trade more 30 minute will be more risky
    - Recommend to not trade more than 30 minute
    - Expected Profit is 10-20 pips
    - Take Profit at 10 pips is wise decision

     


Friday, March 15, 2013

Today News Focus at Customer Price Index (CPI) - 14 March 2013


USD-Customer Price Index (YoY) at 12.30 GMT
    - Medium risk to trade on this news
    - Small Pip Profit might can get
    - Range of pip estimate is not signification

Trading Strategy :
    - Wait until more than 5 Minute after news
    - See direction of 5 minute Bar
    - Open Trade follow the bar direction
    - Trade more 15 minute will be more risky
    - Recommend to not trade more than 30 minute
    - Invert your open trade if price come bact to opening
    - Expected Profit is 10-20 pips
    - Take Profit at 10 pips is wise decision

     


Thursday, March 14, 2013

Today News Focus - 14 March 2013


USD-Producer Price Index (YoY) at 12.30 GMT
    - Medium risk to trade on this news
    - Small Pip Profit might can get
    - Range of pip estimate is not signification

Trading Strategy :
    - Wait until 2-3 Minute after news
    - See direction of 2-3 minute Bar
    - Open Trade follow the bar direction
    - Trade more 15 minute will be more risky
    - Recommend to not trade more than 30 minute
    - Expected Profit is 10-20 pips
    - Take Profit at 10 pips is wise decision

     


Wednesday, March 13, 2013

Today News Focus - 13 March 2013

News Focus 


USD-Retail Sales (MoM) at 12.30 GMT
    - Medium risk to trade on this news
    - Small Pip Profit might can get
    - Range of pip estimate is not signification

    Trading Strategy :
    - Wait until 5 Minute after news
    - See direction of 5 minute Bar
    - Open Trade follow the bar direction
    - Trade more 15 minute will be more risky
    - Recommend not to trade more than 30 minute


Friday, March 8, 2013

Today News Focus - 8 March 2013


News Focus 

1. Nonfarm Payrolls at 13.30 GMT
    - Range estimate is more than 100 pips in 60 Minutes


Thursday, March 7, 2013

Today News Focus 07 March 2013

News Focus 

1. ECB Monetary Poliy Statement
    - Range estimete is more than 100 pips in 60 Minutes
   
   









3 Ways to Trade Forex News

Original Article From TradingMarkets.com

Capital markets, in general, are unique from other markets for goods and services. While I do believe the Forex is driven by supply and demand for the respective currencies at play, often what really moves the markets is anticipation of future supply and demand rather than actual supply and demand. That realization comes to most traders at some point in their career. This concept leads to the biggest question in the Forex: where do these estimates of supply and demand come from?

Surely a comprehensive survey of every user of every currency is impossible. However, there are ways to aggregate and access some information in one place. This is the purpose of news and announcements. News comes from a variety of sources--both commercial and governmental. In the Forex, an emphasis is placed on the value of information or news from government sources. This is fine and is certainly a location on which I place a lot of my own attention, but commercial sources and general investor commentary can do a lot to improve your trading as well.
Click here to learn exactly how you can maximize your returns with our new 2-Period RSI Stock Strategy Guidebook. Included are dozens of high-performing, fully quantified stocks strategy variations based around the 2-period RSI.
The purpose of this article is to provide some basic step-by-step methods you can employ today to take advantage offorex news in the market. I have some experiences that I will share to show how you can find some great trades and how you can identify the duds before they become real bombs in your portfolio. The examples I am using in this article are not the only possible trades available. There are a variety of events each month that can be used to time a good trade. It is useful to watch ongoing news stories that are currently dominating the headlines and minds of investors to identify trading opportunities. The significance of one piece of news over another will change over time. An easy gauge to tell what is important and what can be minimized is the news coverage itself. If one piece of information or speculation about that information is dominating the scene, then it is clearly something you need to be aware of. 

As we proceed through this article, I will share some rules that I have used in the past to profit from news events. However, I think it is somewhat foolhardy to rely completely on a set of rules established in the past. Adjusting your price targets and stops to market volatility and your own risk tolerance is very important. Similarly, while I consider myself a swing trader--willing to hold a position for between 2-3 days and 2-3 weeks--there is a lot of room for good day- or shorter-term traders and long-term traders as well. I will periodically take some very short-term trades around a specific announcement, and I will share those circumstances with you in this article. Understanding the news is very important for every trader, especially those looking at the long-term play. In my book, Profiting with Forex, I spend a great deal of time illustrating the long-term effects of fundamental changes on the Forex. 

Before we begin diving into specific strategies, it is important to accumulate our arsenal of trading weapons. Two of the strategies I will be discussing rely on the use of an outright long or short position. You could take this position in either the spot Forex market, which most of you are probably using, or in the exchange-listed currency futures market on the CME. The third strategy begins diving into the world of options. For those of you familiar with equity options, currency-futures and some spot Forex dealers offer similar instruments for trading. Recently exotic, single-payment and binary options have also become popular. I will refrain from going into too much detail here and instead just pick one type as an example. Check them out on your own, and see how they work for you.

Example #1

The first technique I have to share comes with a couple of tips. First, I have found that news that involves the U.S. dollar usually has the biggest impact on the market as a whole. I am sure most traders are already aware of this, but with very few exceptions they tend to be the most closely watched by the greatest number of participants. Each month there are some ï'hotï' news announcements, one of which is the unemployment report, which is released on the first Friday of each month. The trick with this, however, is that the largest moves are usually made when the numbers miss or beat expectations. But be careful. The correction usually happens very quickly. I use an easy technique to get me into the market before the move occurs with a generous stop and limit order on the other two sides of the trade. 

forex market news
Source: Prophet.net

The chart above shows a graph of the EUR/USD pair during the labor announcement of August 4, 2006. The numbers released showed that a substantially lower number of new jobs had been created in the U.S. than had been anticipated. In this case, the consensus estimate was around 150,000 new jobs and the actual number came in around 113,000. That means that the U.S. economy was weaker than expected, or at least the labor side of the economy was. This is not good news for the U.S. dollar, and therefore we saw a move up in this pair. Another tip I can share from my personal experience is that I have had the best success trading U.S. economic news and announcements with the EUR/USD than any other pair. I feel that it is a good proxy for the U.S. economy in general or at least in very short time spans. 

If we were to break this chart down into minutes or seconds following the announcement, you would see how quickly it moved. Therefore, I would have had to have lightning fingers on my buy button or a buddy on the dealing desk to have taken advantage of the announcement once it was issued. I unfortunately have neither. I did profit from this announcement, however, by anticipating the marketï's movement. 

I want to emphasize, though, that I am willing to do this when the conditions of a couple of rules have been met. First, I will only trade the direction that the market has been trending on the daily charts previous to the announcement. Second, I will only enter the order if just prior to the announcement the market has been in a fairly tight range. 

In the chart above you can see that the market had been trading in a fairly tight range until 30 minutes prior to the announcement. Because the volatility in that last 30 minutes was really concentrated in the last 5 minutes before the announcement I had already placed my order and was not concerned. Call me paranoid, but if I am seeing large moves the night or several hours before an announcement, I get too nervous to take the trade. I suspect that either word has leaked (unlikely) or that I will get whipsawed by wound-up traders just following the actual news. That means that there are plenty of occasions that I have spent a lot of time preparing for a trade that I cancel prior to launch. The risk that I worry about the most is when the market is too volatile and whips me out before I even have a chance to prove if I am right or not. 

In the chart below, you can see the daily trend of the EUR/USD before the announcement on the 4th. Clearly, the market was discounting the dollar and already had a bullish bias on this pair before the trade. Thus my two setup rules were satisfied, qualifying this as a legitimate opportunity.

forex news trade
Source: Prophet.net

Of course, there is more detail behind how I set these trades up. This is pretty simple and is open to customization depending on the situation and your personal preferences. I have placed another chart illustrating the setup with my trade barriers in place below. There are some components of the potential trade that are already in place before the announcement. I know that I am planning to trade long based on the previous trend, and I am targeting 100 pips as upside potential based on the average movement I have seen on this pair during previous months. I like to maintain a pretty aggressive stop-loss-to-profit-target ratio in my trading so a stop 25 pips below my entry is sufficient. Entering the trade 30 minutes before the announcement gives me plenty of room before the pair breaks out of its range.

trade news
Source: Prophet.net

As you can imagine, the market does not always hit my limit just because I think it should. If momentum begins to cool off and the market falls back into a smaller channel again, I will elect to close the trade early. A few other news announcements I recommend for this strategy include inflation data, FOMC meeting announcements and trade numbers.

Example #2

International trade is another announcement that I like to trade. I like it because it has growth and economic strength implications for the U.S., and it is a very important metric for trade-centric economies, like that of Japan. In fact, I generally concentrate on the USD/JPY pair when this announcement is due since the reaction can be quite dramatic. It is possible to trade other currencies that are trade dependent for economic health, but I prefer the USD/JPY because of its liquidity. 

To understand how this trade works, it is important to understand the implications of trade balance. When an economy such as that of the U.S. is importing more from exporting currencies, those goods must ultimately be paid for in the local currency. In the example I am using here, that means Japanese goods must be paid for in Japanese yen. If the U.S. is doing the importing, then U.S. dollars must be sold to purchase Japanese yen. This shifts the supply and demand balance toward a stronger Japanese yen and a weaker U.S. dollar. In this case, that means that the USD/JPY exchange rate would decline in value. Conversely, if the U.S. trade deficit narrows, that means demand for Japanese yen could be declining and its value should drop relative to the U.S. dollar. If that is the case, the USD/JPY exchange rate will rise toward a weaker Japanese yen. 

Like most U.S.-based economic announcements, trade is released an hour before the equity markets open at 8:30 a.m. eastern. Like the labor announcement, I need to set up my trade just prior to the announcement. I like to see the market in a tight range or channel. I have pulled a trade example from August 10, 2006. As you can see in the chart below, although the pair was declining in the hours prior to the announcement, the range was pretty tight without a lot of volatility whipping the market back and forth. This looks like a good setup and you can see the spike in the market after the announcement that the deficit was tightening occurred.

forex news trading
Source: Prophet.net

The fact that I setup my trade as a long position just prior to the announcement was determined by the trend in the daily chart. The market had basically been in an uptrend since May, and the most recent days during the week before also had a bullish bias. This is not an exact science, but it helps immensely to put the odds in your favor by using the tools you have at your disposal. You can also see from the daily chart of the USD/JPY that its daily range was fairly tight. This means that my target is a little smaller than it was on the EUR/USD in the previous example. 

forex market news
Source: Prophet.net

In this case I used a 50-pip limit, or profit target, against a 15-pip stop loss. This still maintains a nice risk-to-reward ratio while allowing enough room for the market to shake out a little if needed. 

As you can imagine, it is not uncommon to be wrong more times than you are right with any trading technique. It is therefore necessary to make sure that it is possible to be more right when you are right than wrong when you are wrong. I know many traders who talk about systems that are right 80 percent or more of the time, but the one time they are wrong, they wind up wiping out yearsï' worth of profits. If you ask me, I think it is healthier for my portfolio and my stress levels to take trades that have more balance between what I have at risk versus what I stand to gain if I am a winner.


Source: Prophet.net

Example #3

In this last example I have prepared, I need to introduce you to a special kind of option called a barrier option. This type of trading instrument is also known as a binary option, and is part of a group of options known as single-payment options. In order to use a barrier option, you have to decide on three things. The first is how far the currency pair is expected to go one direction or the other. The second is to know how long it will take to get there. And the third question you must answer is whether the currency will stay at or beyond your target for a certain length of time. That sounds complex, so letï's look at an example before we go on to a specific trade strategy.

I have an image of the EUR/USD exchange rate from the last half of July 2006 to the beginning of August 2006 below. If I thought that the market was likely to move a lot and I wanted to speculate to the downside, I could buy a barrier option that said that the market will close below 1.2500 at the end of seven days. If the rate does close below that level, I will be paid a certain amount. I will have to pay for the option, but I will stand to gain a lot more than I paid if I am right. If I am wrong, I will lose the total amount I invested in the option. Every time I explain this to new traders, they invariably say that it sounds like gambling. That would be true if the expected return was less than zero. But how many of us willingly trade for a negative expected return? In this real-life example, the option would cost me $1,500 for a potential payoff of $10,000. 


Source: Prophet.net

One of the benefits of options is that I donï't have to use a stop loss because no matter how high this rate rises, I have already invested as much as I can lose. Another benefit is that I donï't have to worry about timing my exit. As long as the exchange rate closes below my barrier, I will be paid at the end of the contract. One final benefit is that it is possible, using options, to straddle (or strangle) the market by placing a barrier option on the upside and the downside. That means that you donï't have to be right about the direction of the market, you just have to be right about the potential for a big move. That makes this trade pretty simple and ideal for a news event. One helpful hint for new options traders is that you may have to plan a little farther in advance of this trade than you do on the others.

Recently I wrote an article about rising oil prices and its effects on Forex crosses involving oil-producing and oil-consuming countries. The example I used was the AUD/JPY. In this case, I was confident that the market would rise from support near 87.50 toward 89.00 or 90.00 within the short term. A purchase of an option on August 1, 2006 with a barrier at 89.00 and expiration at 10:00 am on August 14, 2006 cost $3,200 for a potential $10,000 payout. The benefit of not having to maintain a stop loss more than made up for the cost of the option and the lower risk-to-reward ratio.

forex news trading
Source: Prophet.net

In this example, I was speculating on an ongoing bit of news, rising oil prices, instead of a specific announcement. I used similar rules in that I traded with the trend. But because I was not pinned to a specific time and date, I could be a little more flexible with my entry timing. I liked the fact that this pair was at support and was still within a very strong uptrend. 

Conclusion

Trading the news is important as an effective method for finding new trading opportunities and to become more aware of the fundamental forces at work in your portfolio. The opportunities presented are some of my favorite trades, but they are not the only reason to be aware of your surroundings. I am convinced that the Forex favors the well informed, and these methods can add a few more solid trades to your arsenal every month.

John Jagerson is a Forex writer and active trader. His book, Profiting With Forex, published by McGraw Hill, is available nationwide. This author also develops Forex education courses for INVESTools.com.

How To Trade Forex On News Releases

Original Article from http://www.investopedia.com 
By Kathy Lien

One of the great advantages of trading currencies is that the forex market is open 24 hours a day (from 5pm EST on Sunday until 4pm EST Friday). Economic data tends to be one of the most important catalysts for short-term movements in any market, but this is particularly true in the currency market, which responds not only to U.S. economic news, but also to news from around the world. With at least eight major currencies available for trading at most currency brokers and more than 17 derivatives of them, there is always some piece of economic data slated for release that traders can use to inform the positions they take. Generally, no less than seven pieces of data are released daily from the eight major currencies or countries that are most closely followed. So for those who choose to trade news, there are plenty of opportunities. Here we look at which economic news releases are released when, which are most relevant to forex (FX) traders, and how traders can act on this market-moving data.

Tutorial: Top 10 Forex Trading Rules
Which Currencies Should Be Your Focus? The following are the eight major currencies:1. U.S. dollar (USD)
2. Euro (EUR)
3. British pound (GBP)
4. Japanese yen (JPY)
5. Swiss franc (CHF)
6. Canadian dollar (CAD)
7. Australian dollar (AUD)
8. New Zealand dollar (NZD)

This is just a sample of some of the more liquid derivatives based on the currencies above:

1. EUR/USD
2. USD/JPY
3. AUD/USD
4. GBP/JPY
5. EUR/CHF
6. CHF/JPY

As you can see from these lists, the currencies that we can easily trade span the entire globe. This means that you can handpick the currencies and economic releases to which you pay particular attention. But, as a general rule, since the U.S. dollar is on the "other side" of 90% of all currency trades, U.S. economic releases tend to have the most pronounced impact on the market.

Trading news is harder than it may sound. Not only is the reported consensus figure important, but so are the whisper number and the revisions. Also, some releases are more important than others; this can be measured in terms of both the significance of the country releasing the data and the importance of the release in relation to the other pieces of data being released at the same time.

When Are News Releases Issued? Figure 1 lists the approximate times (EST) at which the most important economic releases for each of the following countries are published. These are also the times at which you should be paying extra attention to the markets if you plan on trading news releases.


Country 

Currency 

Time (EST) 

U.S. 

USD 

8:30 - 10:00 

Japan 

JPY 

18:50 - 23:30 

Canada 

CAD 

7:00 - 8:30 

U.K. 

GBP 

2:00 - 4:30 

Italy 

EUR 

3:45 - 5:00 

Germany 

EUR 

2:00 - 6:00 

France 

EUR 

2:45 - 4:00 

Switzerland 

CHF 

1:45 - 5:30 

New Zealand 

NZD 

16:45 - 21:00 

Australia 

AUD 

17:30 - 19:30 
Figure 1: Times at which various countries release important economic news.

What Are the Key Releases? When trading news, you first have to know which releases are actually expected that week. Second, it is key for you to know which data is important. Generally speaking, these are the most important economic releases for any country:

1. Interest rate decision
2. Retail sales 

3. Inflation (consumer price or producer price)
4. Unemployment
5. Industrial production
6. Business sentiment surveys
7. Consumer confidence surveys
8. Trade balance
9. Manufacturing sector surveys

Depending on the current state of the economy, the relative importance of these releases may change. For example, unemployment may be more important this month than trade or interest rate decisions. Therefore, it is important to keep on top of what the market is focusing on at the moment. (For more insight on these indicators, see Economic Indicators To Know.)

How Long Does the Effect Last?
According to a study by Martin D. D. Evans and Richard K. Lyons published in the Journal of International Money and Finance (2004), the market could still be absorbing or reacting to news releases hours, if not days, after they are released. The study found that the effect on returns generally occurs in the first or second day, but the impact does seem to linger until the fourth day. The impact on order flow, on the other hand, is still very pronounced on the third day and is still observable on the fourth day.

How Do I Actually Trade News? The most common way to trade news is to look for a period of consolidation ahead of a big number and to just trade the breakout on the back of the number. This can be done on both a short-term intraday basis and a daily basis. Let's look at the chart in Figure 2 as an example. After a weak number in September, the market was holding its breath ahead of the October number, which was to be released to the public in November. In the 17 hours before the release, the EUR/USD was confined within a tight 30-pip trading range. For news traders, this would have provided a great opportunity to put on a breakout trade, especially since the likelihood of a sharp move at this time was extremely high.

Figure 2: This chart illustrates the indecision of the market leading up to the October non-farm payroll numbers, which were released in early November. Note the increase in volatility that occurred once the worse than expected news was released.
Source: eSignal

We mentioned earlier that trading news is harder than you might think. Why? The primary reason is volatility. You can be making the right move but end up being stopped out, or the market may simply not have the momentum to sustain the move.

Let's look at the chart in Figure 3 as an example. This chart shows activity after the same release as the one shown in Figure 2, but on a different time frame to show how difficult trading news releases can be. On November 4, 2005, the market had expected 120,000 jobs to be added to the U.S. economy, but instead only 56,000 jobs were added. This sharp disappointment led to an approximately 60-pip sell-off in the dollar against the euro in the first 25 minutes after the release. However, the dollar's upside momentum was so strong that the gains were quickly reversed, and an hour later, the EUR/USD had broken its previous low and actually hit a 1.5-year low against the dollar. Opportunities were plentiful for breakout traders, but bullish momentum in the dollar was so strong that such a bad payrolls number failed to put a sustainable dent in the currency's rally. One thing you should keep in mind is that, on the back of a good number, a strong move should also see a strong extension.


Figure 3: This intraday chart shows that, while the worse-than-expected non-farm payroll numbers sent the EUR/USD rate upward for a short period of time, the strong momentum of the U.S. dollar was able to take control and push the dollar higher. Keep in mind that when the EUR/USD rate falls, the U.S. dollar is going upward, and vice versa.
Source: eSignal

Can I Avoid Getting Hit by Volatility When Trading News? The answer to capturing a breakout in volatility without having to face the risk of a reversal is to trade FX SPOT options. A number of different FX brokers offer a variety of exotic options. Exotic options generally have barrier levels and will be profitable or unprofitable based on whether the barrier level is breached. The payout is predetermined and the premium or price of the option is based on the payout. The following are the most popular types of exotic options to use to trade news releases:


A double one-touch option has two barrier levels. Either one of the levels must be breached prior to expiration in order for the option to become profitable and for the buyer to receive the payout. If neither barrier level is breached prior to expiration, the option expires worthless. A double one-touch option is the perfect option to trade for news releases because it is a pure non-directional breakout play. As long as the barrier level is breached - even if the price reverses course later - the payout is made.

A one-touch option only has one barrier level, which generally makes it slightly less expensive than a double one-touch option. The same criterion holds - the payout is only made if the barrier is breached prior to expiration. This is a good option to buy if you actually have a view on whether the number will be stronger or weaker than the market's consensus forecast.

A double no-touch option is the exact opposite of a double one-touch option. There are two barrier levels, but in this case, neither barrier level can be breached before expiration - otherwise the option payout is not made. This option is great for news traders who think that the economic release will not cause a pronounced breakout in the currency pair and that it will continue to range trade.

FX SPOT options are a viable alternative for those who do not care to get whipsawed in the markets by undue volatility before they actually see the spot price move in their desired direction.

The Bottom LineAs we've seen, the currency market is particularly prone to short-term movements brought on by the release of economic news from both the U.S. and the rest of the world. If you want to trade news successfully in the FX market, key considerations to keep in mind are knowing which releases are expected when, which ones are most important given current economic conditions and, of course, how to trade based on this market-moving data. A variety of exotic options are available for traders who want to capture a breakout in volatility without having to face the risk of a reversal; do your research and stay on top of economic news and you could reap the rewards.





Wednesday, March 6, 2013

NewsImpactEUR.mq4


//+------------------------------------------------------------------+
//|                                                NewsImpactEUR.mq4 |
//|                               Copyright 2013, newsimpactstrategy |
//|                          http://newsimpactstrategy.blogspot.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, newsimpactstrategy"
#property link      "http://newsimpactstrategy.blogspot.com/"

#include <WinUser32.mqh>
#include <stdlib.mqh>

//--- input parameters
extern int       GMTOffset=2;
extern string    FileName = "NewsFile.csv";


int TimeCurr;
int TimeGMT,TimeTokyo,TimeNewYork,TimeSydney;
int spread,NearCloseL,NearCloseR;
double Dpoint;
double Lots,Newsupdate;

double dateft[5];
string ftext[5];
int NeartimeL=0,NeartimeLA=0,NeartimeRA;
int NeartimeR=0;
string NearStrL,NearStrR;
int arraydate,arraycount;
int x,y;
int      eventCount;

int eventTimes[100];
string      eventCurr[100],eventImp[100], eventNames[100],
            eventPrev[100],eventFcs[100];
     
string  eventHysDate1[100];
string  eventEURUSD1N_1[100], eventEURUSD5N_1[100],
        eventEURUSD15N_1[100],eventEURUSD30N_1[100],eventEURUSD60N_1[100],
          eventEURUSD1P_1[100], eventEURUSD5P_1[100],
                eventEURUSD15P_1[100], eventEURUSD30P_1[100],eventEURUSD60P_1[100];
     
string  eventGBPUSD1N_1[100], eventGBPUSD5N_1[100], eventGBPUSD15N_1[100],
        eventGBPUSD30N_1[100], eventGBPUSD60N_1[100],
            eventGBPUSD1P_1[100], eventGBPUSD5P_1[100], eventGBPUSD15P_1[100],
                eventGBPUSD30P_1[100], eventGBPUSD60P_1[100];
               
                   
string   eventHysDate2[100];
string   eventEURUSD1N_2[100], eventEURUSD5N_2[100], eventEURUSD15N_2[100],    
         eventEURUSD30N_2[100], eventEURUSD60N_2[100],
               eventEURUSD1P_2[100], eventEURUSD5P_2[100], eventEURUSD15P_2[100],    
                  eventEURUSD30P_2[100], eventEURUSD60P_2[100];
     
string   eventGBPUSD1N_2[100], eventGBPUSD5N_2[100], eventGBPUSD15N_2[100],
         eventGBPUSD30N_2[100], eventGBPUSD60N_2[100],
               eventGBPUSD1P_2[100], eventGBPUSD5P_2[100], eventGBPUSD15P_2[100],
                  eventGBPUSD30P_2[100], eventGBPUSD60P_2[100];
                 
     
string   eventHysDate3[100];
string   eventEURUSD1N_3[100], eventEURUSD5N_3[100],eventEURUSD15N_3[100],
         eventEURUSD30N_3[100], eventEURUSD60N_3[100],
            eventEURUSD1P_3[100], eventEURUSD5P_3[100],eventEURUSD15P_3[100],
            eventEURUSD30P_3[100], eventEURUSD60P_3[100];
                 
     
string   eventGBPUSD1N_3[100], eventGBPUSD5N_3[100], eventGBPUSD15N_3[100],
         eventGBPUSD30N_3[100], eventGBPUSD60N_3[100],
            eventGBPUSD1P_3[100], eventGBPUSD5P_3[100], eventGBPUSD15P_3[100],
             eventGBPUSD30P_3[100], eventGBPUSD60P_3[100];
     

int ii = 0;
color TokyoColor = Orange, LondonColor = LightSalmon, NYColor=SandyBrown, SydneyColor = DarkOrange;



//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
//TimeCurr=StrToTime("2013.02.16 16:08");
TimeCurr=TimeCurrent();
TimeGMT = TimeCurr-3600*GMTOffset;

Box();
DiplayClock();
FileLoad();

 
//----
   return(0);
  }
 
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectsDeleteAll();
//----
   return(0);
  }

 //read file

int FileLoad()
{
 int FileHandle = FileOpen("NewsFile.csv", FILE_CSV|FILE_READ,',');

   if(FileHandle==0)
      Print("File "+"NewsFile.csv"+" not found.");
int lim,lima,i=0, j=0, hyst[100], hysta[100];

   for(eventCount = 0; !FileIsEnding(FileHandle); eventCount++)
   {
      eventTimes[eventCount] = StrToTime(FileReadString(FileHandle)); //1
      eventCurr[eventCount] = FileReadString(FileHandle);  //2
      eventImp[eventCount]=FileReadString(FileHandle); //3
      eventNames[eventCount] = FileReadString(FileHandle); //4
      eventPrev[eventCount] = FileReadString(FileHandle); //5
      eventFcs[eventCount] = FileReadString(FileHandle);  //6
     
      eventHysDate1[eventCount] = FileReadString(FileHandle);//7
      eventEURUSD1N_1[eventCount] = FileReadString(FileHandle);//9
      eventEURUSD1P_1[eventCount] = FileReadString(FileHandle);//8
     
      eventEURUSD5N_1[eventCount] = FileReadString(FileHandle);//10
      eventEURUSD5P_1[eventCount] = FileReadString(FileHandle);//11
      eventEURUSD15N_1[eventCount] = FileReadString(FileHandle);//13
      eventEURUSD15P_1[eventCount] = FileReadString(FileHandle);//12
      eventEURUSD30N_1[eventCount] = FileReadString(FileHandle);//15
      eventEURUSD30P_1[eventCount] = FileReadString(FileHandle);//14
      eventEURUSD60N_1[eventCount] = FileReadString(FileHandle);//17
      eventEURUSD60P_1[eventCount] = FileReadString(FileHandle);//16
     
      eventHysDate2[eventCount] = FileReadString(FileHandle);//28
      eventEURUSD1N_2[eventCount] = FileReadString(FileHandle);//30
      eventEURUSD1P_2[eventCount] = FileReadString(FileHandle);//29
      eventEURUSD5N_2[eventCount] = FileReadString(FileHandle);//32
      eventEURUSD5P_2[eventCount] = FileReadString(FileHandle);//31
      eventEURUSD15N_2[eventCount] = FileReadString(FileHandle);//34
      eventEURUSD15P_2[eventCount] = FileReadString(FileHandle);//33
      eventEURUSD30N_2[eventCount] = FileReadString(FileHandle);//36
      eventEURUSD30P_2[eventCount] = FileReadString(FileHandle);//35
      eventEURUSD60N_2[eventCount] = FileReadString(FileHandle);//38
      eventEURUSD60P_2[eventCount] = FileReadString(FileHandle);//37
     
      eventHysDate3[eventCount] = FileReadString(FileHandle);//49
      eventEURUSD1N_3[eventCount] = FileReadString(FileHandle);//51
      eventEURUSD1P_3[eventCount] = FileReadString(FileHandle);//50
      eventEURUSD5N_3[eventCount] = FileReadString(FileHandle);//53
      eventEURUSD5P_3[eventCount] = FileReadString(FileHandle);//52
      eventEURUSD15N_3[eventCount] = FileReadString(FileHandle);//55
      eventEURUSD15P_3[eventCount] = FileReadString(FileHandle);//54
      eventEURUSD30N_3[eventCount] = FileReadString(FileHandle);//57
      eventEURUSD30P_3[eventCount] = FileReadString(FileHandle);//56
      eventEURUSD60N_3[eventCount] = FileReadString(FileHandle);//59
      eventEURUSD60P_3[eventCount] = FileReadString(FileHandle);//58
     
         
     
      if(eventTimes[eventCount]<TimeGMT)
       {  
            lim=eventCount;      
           
                  i=i+1;hyst[i]=eventCount;
               
       }
     
         if(eventTimes[eventCount]>=TimeGMT)
       {  
            lima=eventCount;      
           
                  j=j+1;hysta[j]=eventCount;
               
       }
     
   }//for
 
  DisplayNews(hyst[i-1],0,1);
  DisplayNews(hyst[i],2,2);
  DisplayNews(hysta[1],4,3);
  DisplayNews(hysta[2],6,4);
  DisplayNews(hysta[3],8,5);
  DisplayNews(hysta[4],10,6);
  DisplayNews(hysta[5],12,8);
   arraydate=eventCount;
   arraycount=eventCount;
   FileClose(FileHandle);
 

   return(1);

}

int DisplayNews(int i,int ii,int code)
{

      string LblNews;
      string LblDateNews,LblCurNews,LblIpNews,LblFcsNews,LblPreNews;
     
      string  LbleventHysDate1, LbleventEURUSD1N_1, LbleventEURUSD5N_1,
              LbleventEURUSD15N_1,LbleventEURUSD30N_1,LbleventEURUSD60N_1,
                  LbleventEURUSD1P_1, LbleventEURUSD5P_1,
                  LbleventEURUSD15P_1,LbleventEURUSD30P_1,LbleventEURUSD60P_1;
                 
      string LblarrowEURUSD1_1, LblarrowEURUSD5_1, LblarrowEURUSD15_1, LblarrowEURUSD30_1, LblarrowEURUSD60_1;
             
             
      string  LbleventGBPUSD1N_1, LbleventGBPUSD5N_1, LbleventGBPUSD15N_1,
              LbleventGBPUSD30N_1, LbleventGBPUSD60N_1,
                  LbleventGBPUSD1P_1, LbleventGBPUSD5P_1, LbleventGBPUSD15P_1,
                  LbleventGBPUSD30P_1, LbleventGBPUSD60P_1;
                 
      string LblarrowGBPUSD1_1, LblarrowGBPUSD5_1, LblarrowGBPUSD15_1, LblarrowGBPUSD30_1, LblarrowGBPUSD60_1;
     
      string   LbleventHysDate2;
      string   LbleventEURUSD1N_2, LbleventEURUSD5N_2, LbleventEURUSD15N_2,    
               LbleventEURUSD30N_2, LbleventEURUSD60N_2,
                  LbleventEURUSD1P_2, LbleventEURUSD5P_2, LbleventEURUSD15P_2,    
                  LbleventEURUSD30P_2, LbleventEURUSD60P_2;
                 
                  string LblarrowEURUSD1_2, LblarrowEURUSD5_2, LblarrowEURUSD15_2, LblarrowEURUSD30_2, LblarrowEURUSD60_2;
             
      string   LbleventGBPUSD1N_2, LbleventGBPUSD5N_2, LbleventGBPUSD15N_2,
               LbleventGBPUSD30N_2, LbleventGBPUSD60N_2,
                  LbleventGBPUSD1P_2, LbleventGBPUSD5P_2, LbleventGBPUSD15P_2,
                  LbleventGBPUSD30P_2, LbleventGBPUSD60P_2;
                 
                  string LblarrowGBPUSD1_2, LblarrowGBPUSD5_2, LblarrowGBPUSD15_2, LblarrowGBPUSD30_2, LblarrowGBPUSD60_2;
     
      string   LbleventHysDate3;
      string   LbleventEURUSD1N_3, LbleventEURUSD5N_3,LbleventEURUSD15N_3,
               LbleventEURUSD30N_3, LbleventEURUSD60N_3,
                  LbleventEURUSD1P_3, LbleventEURUSD5P_3,LbleventEURUSD15P_3,
                  LbleventEURUSD30P_3, LbleventEURUSD60P_3;
                 
                   string LblarrowEURUSD1_3, LblarrowEURUSD5_3, LblarrowEURUSD15_3, LblarrowEURUSD30_3, LblarrowEURUSD60_3;
     
      string   LbleventGBPUSD1N_3, LbleventGBPUSD5N_3, LbleventGBPUSD15N_3,
               LbleventGBPUSD30N_3, LbleventGBPUSD60N_3,
                  LbleventGBPUSD1P_3, LbleventGBPUSD5P_3, LbleventGBPUSD15P_3,
                  LbleventGBPUSD30P_3, LbleventGBPUSD60P_3;
                 
                  string LblarrowGBPUSD1_3, LblarrowGBPUSD5_3, LblarrowGBPUSD15_3, LblarrowGBPUSD30_3, LblarrowGBPUSD60_3;
      string TCodeStr;
      color impcolor;
     
   
         LblNews=StringConcatenate("DNews",code);
         LblCurNews=StringConcatenate("CurNews",code);
         LblIpNews=StringConcatenate("IpNews",code);
         LblDateNews=StringConcatenate("LblDatenews",code);
         LblPreNews=StringConcatenate("PreNews",code);
         LblFcsNews=StringConcatenate("FcsNews",code);
       
         LbleventHysDate1 = StringConcatenate("LbleventHysDate1",code);
         LbleventEURUSD1N_1= StringConcatenate("LbleventEURUSD1N_1",code);
         LbleventEURUSD5N_1= StringConcatenate("LbleventEURUSD5N_1",code);
         LbleventEURUSD15N_1= StringConcatenate("LbleventEURUSD15N_1",code);
              LbleventEURUSD30N_1= StringConcatenate("LbleventEURUSD30N_1",code);
              LbleventEURUSD60N_1= StringConcatenate("LbleventEURUSD60N_1",code);
             
                     LblarrowEURUSD1_1= StringConcatenate("LblarrowEURUSD1_1",code);
                     LblarrowEURUSD5_1= StringConcatenate("LblarrowEURUSD5_1",code);
                     LblarrowEURUSD15_1= StringConcatenate("LblarrowEURUSD15_1",code);
                     LblarrowEURUSD30_1= StringConcatenate("LblarrowEURUSD30_1",code);
                     LblarrowEURUSD60_1= StringConcatenate("LblarrowEURUSD60_1",code);
             
               LbleventEURUSD1P_1= StringConcatenate("LbleventEURUSD1P_1",code);
               LbleventEURUSD5P_1= StringConcatenate("LbleventEURUSD5P_1",code);
               LbleventEURUSD15P_1= StringConcatenate("LbleventEURUSD15P_1",code);
                  LbleventEURUSD30P_1= StringConcatenate("LbleventEURUSD30P_1",code);
                  LbleventEURUSD60P_1= StringConcatenate("LbleventEURUSD60P_1",code);
     
     
         LbleventHysDate2= StringConcatenate("LbleventHysDate2",code);
       
         LbleventEURUSD1N_2= StringConcatenate("LbleventEURUSD1N_2",code);
         LbleventEURUSD5N_2= StringConcatenate("LbleventEURUSD5N_2",code);
         LbleventEURUSD15N_2= StringConcatenate("LbleventEURUSD15N_2",code);
              LbleventEURUSD30N_2= StringConcatenate("LbleventEURUSD30N_2",code);
              LbleventEURUSD60N_2= StringConcatenate("LbleventEURUSD60N_2",code);
                  LbleventEURUSD1P_2= StringConcatenate("LbleventEURUSD1P_2",code);
                  LbleventEURUSD5P_2= StringConcatenate("LbleventEURUSD5P_2",code);
                  LbleventEURUSD15P_2= StringConcatenate("LbleventEURUSD15P_2",code);
                     LbleventEURUSD30P_2= StringConcatenate("LbleventEURUSD30P_2",code);
                     LbleventEURUSD60P_2= StringConcatenate("LbleventEURUSD60P_2",code);
                   
                           LblarrowEURUSD1_2= StringConcatenate("LblarrowEURUSD1_2",code);
                           LblarrowEURUSD5_2= StringConcatenate("LblarrowEURUSD5_2",code);
                           LblarrowEURUSD15_2= StringConcatenate("LblarrowEURUSD15_2",code);
                           LblarrowEURUSD30_2= StringConcatenate("LblarrowEURUSD30_2",code);
                           LblarrowEURUSD60_2= StringConcatenate("LblarrowEURUSD60_2",code);
       
     
         LbleventHysDate3= StringConcatenate("LbleventHysDate3",code);
   
         LbleventEURUSD1N_3= StringConcatenate("LbleventEURUSD1N_3",code);
         LbleventEURUSD5N_3= StringConcatenate("LbleventEURUSD5N_3",code);
         LbleventEURUSD15N_3= StringConcatenate("LbleventEURUSD15N_3",code);
              LbleventEURUSD30N_3= StringConcatenate("LbleventEURUSD30N_3",code);
              LbleventEURUSD60N_3= StringConcatenate("LbleventEURUSD60N_3",code);
                  LbleventEURUSD1P_3= StringConcatenate("LbleventEURUSD1P_3",code);
                  LbleventEURUSD5P_3= StringConcatenate("LbleventEURUSD5P_3",code);
                  LbleventEURUSD15P_3= StringConcatenate("LbleventEURUSD15P_3",code);
                     LbleventEURUSD30P_3= StringConcatenate("LbleventEURUSD30P_3",code);
                     LbleventEURUSD60P_3= StringConcatenate("LbleventEURUSD60P_3",code);
                         
                           LblarrowEURUSD1_3= StringConcatenate("LblarrowEURUSD1_3",code);
                           LblarrowEURUSD5_3= StringConcatenate("LblarrowEURUSD5_3",code);
                           LblarrowEURUSD15_3= StringConcatenate("LblarrowEURUSD15_3",code);
                           LblarrowEURUSD30_3= StringConcatenate("LblarrowEURUSD30_3",code);
                           LblarrowEURUSD60_3= StringConcatenate("LblarrowEURUSD60_3",code);
       
       
         TCodeStr=StringConcatenate("",code);
       
       
       
               if(eventImp[i]=="Hi") impcolor=Red;
               if(eventImp[i]=="Med") impcolor=Yellow;
               if(eventImp[i]=="Lo") impcolor=LimeGreen;
             
              TextLabel(LblDateNews, TimeToStr(eventTimes[i]),732,ii*30+172,Honeydew);//815
              TextLabel(LblCurNews, StringConcatenate(eventCurr[i]," "),687,ii*30+172,impcolor);//770
              arrownews(LblIpNews,eventImp[i], 652, ii*30+172);
             
              TextLabel(LblNews, StringConcatenate(eventNames[i]," "),652,ii*30+185,impcolor);
             
              TextLabel(LblPreNews, StringConcatenate("P : ",eventPrev[i]),717,ii*30+200,impcolor);//800
              TextLabel(LblFcsNews, StringConcatenate("F : ",eventFcs[i]),787,ii*30+200,impcolor);//735
             
               if(code==1 || code ==2)
               {
                  TextLabel(TCodeStr, TimeToStr(TimeGMT-eventTimes[i],TIME_MINUTES),652,ii*30+200, Blue);
               }
             
               if(code>=3)
               {
                 TextLabel(TCodeStr, TimeToStr(eventTimes[i]-TimeGMT,TIME_MINUTES),652,ii*30+200, Honeydew);
              }
             
            //last
            int Spc1 = 40;
            int Str1 =460;  
               TextLabel(LbleventHysDate1, eventHysDate1[i], 520 ,ii*30+170,LightSalmon);
                 
                  TextLabel(LbleventEURUSD1P_1, eventEURUSD1P_1[i],Str1,ii*30+185,Green);
                  TextLabel(LbleventEURUSD5P_1, eventEURUSD5P_1[i],Str1+Spc1,ii*30+185,Green);
                  TextLabel(LbleventEURUSD15P_1, eventEURUSD15P_1[i],Str1+2*Spc1,ii*30+185,Green);
                  TextLabel(LbleventEURUSD30P_1, eventEURUSD30P_1[i],Str1+3*Spc1,ii*30+185,Green);
                  TextLabel(LbleventEURUSD60P_1, eventEURUSD60P_1[i],Str1+4*Spc1,ii*30+185,Green);
             
               TextLabel(LbleventEURUSD1N_1, eventEURUSD1N_1[i],Str1,ii*30+200,Red);
               TextLabel(LbleventEURUSD5N_1, eventEURUSD5N_1[i],Str1+Spc1,ii*30+200,Red);
               TextLabel(LbleventEURUSD15N_1, eventEURUSD15N_1[i],Str1+2*Spc1,ii*30+200,Red);
               TextLabel(LbleventEURUSD30N_1, eventEURUSD30N_1[i],Str1+3*Spc1,ii*30+200,Red);
               TextLabel(LbleventEURUSD60N_1, eventEURUSD60N_1[i],Str1+4*Spc1,ii*30+200,Red);
             
                        int str11=Str1-15;
                        if(StrToInteger(eventEURUSD1P_1[i]) - 0 > 0 - StrToInteger(eventEURUSD1N_1[i])) arrownews(LblarrowEURUSD1_1,"1", str11, ii*30+192);
                        if(StrToInteger(eventEURUSD1P_1[i]) - 0 < 0 - StrToInteger(eventEURUSD1N_1[i])) arrownews(LblarrowEURUSD1_1,"-1", str11, ii*30+192);
                        if(StrToInteger(eventEURUSD1P_1[i]) - 0 == 0 - StrToInteger(eventEURUSD1N_1[i])) arrownews(LblarrowEURUSD1_1,"0", str11, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD5P_1[i]) - 0 > 0 - StrToInteger(eventEURUSD5N_1[i])) arrownews(LblarrowEURUSD5_1,"1", str11 + Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD5P_1[i]) - 0 < 0 - StrToInteger(eventEURUSD5N_1[i])) arrownews(LblarrowEURUSD5_1,"-1", str11 + Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD5P_1[i]) - 0 == 0 - StrToInteger(eventEURUSD5N_1[i])) arrownews(LblarrowEURUSD5_1,"0", str11 + Spc1, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD15P_1[i]) - 0 > 0 - StrToInteger(eventEURUSD15N_1[i])) arrownews(LblarrowEURUSD15_1,"1", str11 + 2*Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD15P_1[i]) - 0 < 0 - StrToInteger(eventEURUSD15N_1[i])) arrownews(LblarrowEURUSD15_1,"-1", str11 + 2*Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD15P_1[i]) - 0 == 0 - StrToInteger(eventEURUSD15N_1[i])) arrownews(LblarrowEURUSD15_1,"0", str11 + 2*Spc1, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD30P_1[i]) - 0 > 0 - StrToInteger(eventEURUSD30N_1[i])) arrownews(LblarrowEURUSD30_1,"1", str11 + 3*Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD30P_1[i]) - 0 < 0 - StrToInteger(eventEURUSD30N_1[i])) arrownews(LblarrowEURUSD30_1,"-1", str11 + 3*Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD30P_1[i]) - 0 == 0 - StrToInteger(eventEURUSD30N_1[i])) arrownews(LblarrowEURUSD30_1,"0", str11 + 3*Spc1, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD60P_1[i]) - 0 > 0 - StrToInteger(eventEURUSD60N_1[i])) arrownews(LblarrowEURUSD60_1,"1", str11 + 4*Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD60P_1[i]) - 0 < 0 - StrToInteger(eventEURUSD60N_1[i])) arrownews(LblarrowEURUSD60_1,"-1", str11 + 4*Spc1, ii*30+192);
                        if(StrToInteger(eventEURUSD60P_1[i]) - 0 == 0 - StrToInteger(eventEURUSD60N_1[i])) arrownews(LblarrowEURUSD60_1,"0", str11 + 4*Spc1, ii*30+192);
         
               
                //2nd Last
               TextLabel(LbleventHysDate2, eventHysDate2[i],300,ii*30+170,LightSalmon);
                 
                  TextLabel(LbleventEURUSD1P_2, eventEURUSD1P_2[i],245,ii*30+185,Green);
                  TextLabel(LbleventEURUSD5P_2, eventEURUSD5P_2[i],285,ii*30+185,Green);
                  TextLabel(LbleventEURUSD15P_2, eventEURUSD15P_2[i],325,ii*30+185,Green);
                  TextLabel(LbleventEURUSD30P_2, eventEURUSD30P_2[i],365,ii*30+185,Green);
                  TextLabel(LbleventEURUSD60P_2, eventEURUSD60P_2[i],405,ii*30+185,Green);
                 
               TextLabel(LbleventEURUSD1N_2, eventEURUSD1N_2[i],245,ii*30+200,Red);
               TextLabel(LbleventEURUSD5N_2, eventEURUSD5N_2[i],285,ii*30+200,Red);
               TextLabel(LbleventEURUSD15N_2, eventEURUSD15N_2[i],325,ii*30+200,Red);
               TextLabel(LbleventEURUSD30N_2, eventEURUSD30N_2[i],365,ii*30+200,Red);
               TextLabel(LbleventEURUSD60N_2, eventEURUSD60N_2[i],405,ii*30+200,Red);
             
                        if(StrToInteger(eventEURUSD1P_2[i]) - 0 > 0 - StrToInteger(eventEURUSD1N_2[i])) arrownews(LblarrowEURUSD1_2,"1", 230, ii*30+192);
                        if(StrToInteger(eventEURUSD1P_2[i]) - 0 < 0 - StrToInteger(eventEURUSD1N_2[i])) arrownews(LblarrowEURUSD1_2,"-1", 230, ii*30+192);
                        if(StrToInteger(eventEURUSD1P_2[i]) - 0 == 0 - StrToInteger(eventEURUSD1N_2[i])) arrownews(LblarrowEURUSD1_2,"0", 230, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD5P_2[i]) - 0 > 0 - StrToInteger(eventEURUSD5N_2[i])) arrownews(LblarrowEURUSD5_2,"1", 270, ii*30+192);
                        if(StrToInteger(eventEURUSD5P_2[i]) - 0 < 0 - StrToInteger(eventEURUSD5N_2[i])) arrownews(LblarrowEURUSD5_2,"-1", 270, ii*30+192);
                        if(StrToInteger(eventEURUSD5P_2[i]) - 0 == 0 - StrToInteger(eventEURUSD5N_2[i])) arrownews(LblarrowEURUSD5_2,"0", 270, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD15P_2[i]) - 0 > 0 - StrToInteger(eventEURUSD15N_2[i])) arrownews(LblarrowEURUSD15_2,"1", 310, ii*30+192);
                        if(StrToInteger(eventEURUSD15P_2[i]) - 0 < 0 - StrToInteger(eventEURUSD15N_2[i])) arrownews(LblarrowEURUSD15_2,"-1", 310, ii*30+192);
                        if(StrToInteger(eventEURUSD15P_2[i]) - 0 == 0 - StrToInteger(eventEURUSD15N_2[i])) arrownews(LblarrowEURUSD15_2,"0", 310, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD30P_2[i]) - 0 > 0 - StrToInteger(eventEURUSD30N_2[i])) arrownews(LblarrowEURUSD30_2,"1", 350, ii*30+192);
                        if(StrToInteger(eventEURUSD30P_2[i]) - 0 < 0 - StrToInteger(eventEURUSD30N_2[i])) arrownews(LblarrowEURUSD30_2,"-1", 350, ii*30+192);
                        if(StrToInteger(eventEURUSD30P_2[i]) - 0 == 0 - StrToInteger(eventEURUSD30N_2[i])) arrownews(LblarrowEURUSD30_2,"0", 350, ii*30+192);
                       
                        if(StrToInteger(eventEURUSD60P_2[i]) - 0 > 0 - StrToInteger(eventEURUSD60N_2[i])) arrownews(LblarrowEURUSD60_2,"1", 390, ii*30+192);
                        if(StrToInteger(eventEURUSD60P_2[i]) - 0 < 0 - StrToInteger(eventEURUSD60N_2[i])) arrownews(LblarrowEURUSD60_2,"-1", 390, ii*30+192);
                        if(StrToInteger(eventEURUSD60P_2[i]) - 0 == 0 - StrToInteger(eventEURUSD60N_2[i])) arrownews(LblarrowEURUSD60_2,"0", 390, ii*30+192);
                 
             
             
                 
               //3rd Last
             
               TextLabel(LbleventHysDate3, eventHysDate3[i],85,ii*30+170,LightSalmon);
               
                  TextLabel(LbleventEURUSD1P_3, eventEURUSD1P_3[i],30,ii*30+185,Green);
                  TextLabel(LbleventEURUSD5P_3, eventEURUSD5P_3[i],70,ii*30+185,Green);
                  TextLabel(LbleventEURUSD15P_3, eventEURUSD15P_3[i],110,ii*30+185,Green);
                  TextLabel(LbleventEURUSD30P_3, eventEURUSD30P_3[i],150,ii*30+185,Green);
                  TextLabel(LbleventEURUSD60P_3, eventEURUSD60P_3[i],190,ii*30+185,Green);
             
               TextLabel(LbleventEURUSD1N_3, eventEURUSD1N_3[i],30,ii*30+200,Red);
               TextLabel(LbleventEURUSD5N_3, eventEURUSD5N_3[i],70,ii*30+200,Red);
               TextLabel(LbleventEURUSD15N_3, eventEURUSD15N_3[i],115,ii*30+200,Red);
               TextLabel(LbleventEURUSD30N_3, eventEURUSD30N_3[i],150,ii*30+200,Red);
               TextLabel(LbleventEURUSD60N_3, eventEURUSD60N_3[i],190,ii*30+200,Red);
             
                        if(StrToInteger(eventEURUSD1P_3[i]) - 0 > 0 - StrToInteger(eventEURUSD1N_3[i])) arrownews(LblarrowEURUSD1_3,"1", 15, ii*30+195);
                        if(StrToInteger(eventEURUSD1P_3[i]) - 0 < 0 - StrToInteger(eventEURUSD1N_3[i])) arrownews(LblarrowEURUSD1_3,"-1", 15, ii*30+195);
                        if(StrToInteger(eventEURUSD1P_3[i]) - 0 == 0 - StrToInteger(eventEURUSD1N_3[i])) arrownews(LblarrowEURUSD1_3,"0", 15, ii*30+195);
                       
                        if(StrToInteger(eventEURUSD5P_3[i]) - 0 > 0 - StrToInteger(eventEURUSD5N_3[i])) arrownews(LblarrowEURUSD5_3,"1", 55, ii*30+195);
                        if(StrToInteger(eventEURUSD5P_3[i]) - 0 < 0 - StrToInteger(eventEURUSD5N_3[i])) arrownews(LblarrowEURUSD5_3,"-1", 55, ii*30+195);
                        if(StrToInteger(eventEURUSD5P_3[i]) - 0 == 0 - StrToInteger(eventEURUSD5N_3[i])) arrownews(LblarrowEURUSD5_3,"0", 55, ii*30+195);
                       
                        if(StrToInteger(eventEURUSD15P_3[i]) - 0 > 0 - StrToInteger(eventEURUSD15N_3[i])) arrownews(LblarrowEURUSD15_3,"1", 95, ii*30+195);
                        if(StrToInteger(eventEURUSD15P_3[i]) - 0 < 0 - StrToInteger(eventEURUSD15N_3[i])) arrownews(LblarrowEURUSD15_3,"-1", 95, ii*30+195);
                        if(StrToInteger(eventEURUSD15P_3[i]) - 0 == 0 - StrToInteger(eventEURUSD15N_3[i])) arrownews(LblarrowEURUSD15_3,"0", 95, ii*30+195);
                       
                        if(StrToInteger(eventEURUSD30P_3[i]) - 0 > 0 - StrToInteger(eventEURUSD30N_3[i])) arrownews(LblarrowEURUSD30_3,"1", 135, ii*30+195);
                        if(StrToInteger(eventEURUSD30P_3[i]) - 0 < 0 - StrToInteger(eventEURUSD30N_3[i])) arrownews(LblarrowEURUSD30_3,"-1", 135, ii*30+195);
                        if(StrToInteger(eventEURUSD30P_3[i]) - 0 == 0 - StrToInteger(eventEURUSD30N_3[i])) arrownews(LblarrowEURUSD30_3,"0", 135, ii*30+195);
                       
                        if(StrToInteger(eventEURUSD60P_3[i]) - 0 > 0 - StrToInteger(eventEURUSD60N_3[i])) arrownews(LblarrowEURUSD60_3,"1", 175, ii*30+195);
                        if(StrToInteger(eventEURUSD60P_3[i]) - 0 < 0 - StrToInteger(eventEURUSD60N_3[i])) arrownews(LblarrowEURUSD60_3,"-1", 175, ii*30+195);
                        if(StrToInteger(eventEURUSD60P_3[i]) - 0 == 0 - StrToInteger(eventEURUSD60N_3[i])) arrownews(LblarrowEURUSD60_3,"0", 175, ii*30+195);
             
   return(0);  

}


void DiplayClock()
{
 
  TimeNewYork=TimeGMT-5*3600;
  TimeTokyo = TimeGMT + 9*3600;
  TimeSydney = TimeGMT+11*3600;
  ActiveSession();
 
  TextLabels("TimeLocalt", TimeToStr(TimeLocal(),TIME_MINUTES) , 12, 55, 35, LimeGreen );
  TextLabels("TimeLocald", TimeToStr(TimeLocal(),TIME_DATE) , 10, 40, 50, LimeGreen );
  TextLabels("TimeLocals", "Local" , 10, 60, 70, LimeGreen );
 
  TextLabels("TimeCurrt", TimeToStr(TimeCurr,TIME_MINUTES) , 12, 155, 35, Lime);
  TextLabels("TimeCurrd", TimeToStr(TimeCurr,TIME_DATE) , 10, 140, 50, Lime);
  TextLabels("TimeCurrs", "Server" , 10, 155, 70, Lime);
 
  TextLabels("TimeGMTt", TimeToStr(TimeGMT,TIME_MINUTES) , 12, 255, 35, LondonColor);
  TextLabels("TimeGMTd", TimeToStr(TimeGMT,TIME_DATE) , 10, 240, 50, LondonColor);
  TextLabels("TimeGMTs", "London" , 10, 255, 70, LondonColor);
 
  TextLabels("TimeNYt", TimeToStr(TimeNewYork,TIME_MINUTES) , 12, 355, 35, NYColor);
  TextLabels("TimeNYd", TimeToStr(TimeNewYork,TIME_DATE) , 10, 340, 50, NYColor);
  TextLabels("TimeNYs", "New York" , 10, 345, 70, NYColor);
 
  TextLabels("TimeTokyot", TimeToStr(TimeTokyo,TIME_MINUTES) , 12, 455, 35, TokyoColor);
  TextLabels("TimeTokyod", TimeToStr(TimeTokyo,TIME_DATE) , 10, 440, 50, TokyoColor);
  TextLabels("TimeTokyos", "Tokyo" , 10, 460, 70, TokyoColor);
 
  TextLabels("TimeSydneyt", TimeToStr(TimeSydney,TIME_MINUTES) , 12, 555, 35, SydneyColor);
  TextLabels("TimeSydneyd", TimeToStr(TimeSydney,TIME_DATE) , 10, 540, 50, SydneyColor);
  TextLabels("TimeSydneys", "Sydney" , 10, 554, 70, SydneyColor);
}

void ActiveSession()
{



  if(TimeHour(TimeGMT)>6 && TimeHour(TimeGMT)<8)  //Tokyo
  {
      BigBox("BoxTokyo", 430, 20 );
      if(ObjectFind("BoxLondon")>-1) ObjectDelete("BoxLondon");
      if(ObjectFind("BoxNY")>-1) ObjectDelete("BoxNY");
      if(ObjectFind("BoxSydney")>-1) ObjectDelete("BoxSydney");
  }
 
  if(TimeHour(TimeGMT)==8)  //London & Toky0
      {
         BigBox("BoxTokyo", 430, 20 ); BigBox("BoxLondon", 230, 20 );
         if(ObjectFind("BoxNY")>-1) ObjectDelete("BoxNY");
         if(ObjectFind("BoxSydney")>-1) ObjectDelete("BoxSydney");
      }
 
 
  if(TimeHour(TimeGMT)>8 && TimeHour(TimeGMT)<13) //London
  {
      BigBox("BoxLondon", 230, 20 );//London
      if(ObjectFind("BoxTokyo")>-1) ObjectDelete("BoxTokyo");
      if(ObjectFind("BoxNY")>-1) ObjectDelete("BoxNY");
      if(ObjectFind("BoxSydney")>-1) ObjectDelete("BoxSydney");
     
  }
 
  if(TimeHour(TimeGMT)>=13 && TimeHour(TimeGMT)<=16)  //NY and London
      {
         BigBox("BoxNY", 330, 20 ); BigBox("BoxLondon", 230, 20 );
         if(ObjectFind("BoxTokyo")>-1) ObjectDelete("BoxTokyo");
         if(ObjectFind("BoxSydney")>-1) ObjectDelete("BoxSydney");
      }
 
  if(TimeHour(TimeGMT)>13 && TimeHour(TimeGMT)<=21) //NY
  {
      BigBox("BoxNY", 330, 20 );//New York
      if(ObjectFind("BoxTokyo")>-1) ObjectDelete("BoxTokyo");
      if(ObjectFind("BoxLondon")>-1) ObjectDelete("BoxLondon");
      if(ObjectFind("BoxSydney")>-1) ObjectDelete("BoxSydney");
  }
 
 
  if(TimeHour(TimeGMT)>=22 && TimeHour(TimeGMT)<=23) //Sydney
  {
      BigBox("BoxSydney", 530, 20 );//Sydney
      if(ObjectFind("BoxTokyo")>-1) ObjectDelete("BoxTokyo");
      if(ObjectFind("BoxLondon")>-1) ObjectDelete("BoxLondon");
      if(ObjectFind("BoxNY")>-1) ObjectDelete("BoxNY");
  }
 
  if(TimeHour(TimeGMT)>=0 && TimeHour(TimeGMT)<=6)
  {
      BigBox("BoxSydney", 530, 20 );BigBox("BoxTokyo", 430, 20 );
      if(ObjectFind("BoxLondon")>-1) ObjectDelete("BoxLondon");
      if(ObjectFind("BoxNY")>-1) ObjectDelete("BoxNY");
  }
 
  //if(TimeHour(TimeGMT)>=0 && TimeHour(TimeGMT)<=8)  BigBox("BoxTokyo", 430, 20 ); ObjectDelete(id); /tokyo
 
  if(TimeHour(TimeGMT)>=8 && TimeHour(TimeGMT)<=16) BigBox("BoxLondon", 230, 20 );//London
  if(TimeHour(TimeGMT)>=13 && TimeHour(TimeGMT)<=21)BigBox("BoxNY", 330, 20 );//New York
  if(TimeHour(TimeGMT)>=22 && TimeHour(TimeGMT)<=6) BigBox("BoxSydney", 530, 20 );//Sydney
 
 
}
void AskBid()
{
  TextLabels("bid", " Bid = " + DoubleToStr(Bid,Digits) , 10, 500, 97, Coral);
  TextLabels("ask", " Ask = " + DoubleToStr(Ask,Digits) , 10, 250, 97, Coral);
  TextLabels("Spread", "Spread = " + DoubleToStr((Ask-Bid)/Point,0) + " point" , 10, 40, 97, Coral);
 
}

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----


TimeCurr = TimeCurrent();
TimeGMT = TimeCurr-3600*GMTOffset;

FileLoad();
//DisplayNews();
DiplayClock();
AskBid();
ActiveSession();
//nearn();
 
//----
   return(0);
  }
//+------------------------------------------------------------------+



void Header()
{
 TextLabel("Head1","Calender", 720, 140,LightSteelBlue );
 TextLabel("Head4","Last", 535, 126,LightSteelBlue );
 TextLabel("Head5","2nd Last", 308, 126,LightSteelBlue );
 TextLabel("Head6","3rd Last", 97, 126,LightSteelBlue );

 TextLabel("1M1","1M", 455, 150,LightSteelBlue );
 TextLabel("5M1","5M", 495, 150,LightSteelBlue );
 TextLabel("15M1","15M", 535, 150,LightSteelBlue );
 TextLabel("30M1","30M", 575, 150,LightSteelBlue );
 TextLabel("60M1","60M", 615, 150,LightSteelBlue );

 TextLabel("1M2","1M", 245, 150,LightSteelBlue );
 TextLabel("5M2","5M", 285, 150,LightSteelBlue );
 TextLabel("15M2","15M", 320, 150,LightSteelBlue );
 TextLabel("30M2","30M", 360, 150,LightSteelBlue );
 TextLabel("60M2","60M", 400, 150,LightSteelBlue );

 TextLabel("1M3","1M", 30, 150,LightSteelBlue );
 TextLabel("5M3","5M", 70, 150,LightSteelBlue );
 TextLabel("15M3","15M", 110, 150,LightSteelBlue );
 TextLabel("30M3","30M", 150, 150,LightSteelBlue );
 TextLabel("60M3","60M", 190, 150,LightSteelBlue );
}


void Box()
{
   
    int i;
    int y,yy;
   
    Header();
    // Right Vertical
    y=25; yy=15;
 
    for(i=0;i<=5;i++)
    {
       TextLabel1(StringConcatenate("LVBox",i),"|", 621, y+yy*i );
    }
   
    //Sub Box 1 for news history
   
     for(i=0;i<=30;i++)
    {
       TextLabel1(StringConcatenate("SVBox1",i),"|", 220, 90+y+yy*i );
       TextLabel1(StringConcatenate("SVBox2",i),"|", 435, 90+y+yy*i );
       TextLabel1(StringConcatenate("SVBox3",i),"|", 645, 90+y+yy*i );
    }
 
    // Top Hoizontal
   
    TextLabel1("THBox ","------------------------------------------------------------", 10, 20 );
    TextLabel1("THBox1","---------------------------------------------------------------", 310, 20 );
    TextLabel1("HSubBox ","------------------------------------------------------------", 10, 85 );
    TextLabel1("HSub1Box.1","---------------------------------------------------------------", 310, 85 );
    TextLabel("HSubBox2.0","------------------------------------------------------------", 10, 111,LightSteelBlue );
    TextLabel("HSubBox2.1","------------------------------------------------------------", 310, 111,LightSteelBlue );
    TextLabel("HSubBox2.2","-----------------------------------------", 610, 111,LightSteelBlue );
    TextLabel("HSubBox3.0","------------------------------------------------------------", 10, 140,LightSteelBlue );
    TextLabel("HSubBox3.1","------------------------------------------------------------", 310, 140,LightSteelBlue );
    TextLabel("HSubBox3.2","----", 610, 140,LightSteelBlue );
    TextLabel("HSubBox4.0","------------------------------------------------------------", 10, 160,LightSteelBlue );
    TextLabel("HSubBox4.1","------------------------------------------------------------", 310, 160,LightSteelBlue );
    TextLabel("HSubBox4.2","-----------------------------------------", 610, 160,LightSteelBlue );
   
    int st=165-25;

    color separator;
    for(i=0;i<7;i++)
    {
   
      if(i==1) separator = Red;
      if(i!=1) separator = LightSteelBlue;
   
    TextLabel("HSubBox6.0"+StringConcatenate(i,""),"------------------------------------------------------------", 10, i*60+215,separator);
    TextLabel("HSubBox6.1"+StringConcatenate(i,""),"------------------------------------------------------------", 310, i*60+215,separator);
    TextLabel("HSubBox6.2"+StringConcatenate(i,""),"-----------------------------------------", 610, i*60+215,separator);
    }
   
   
   

}

void TextLabel(string object, string Text, int X, int Y, color warna )
  {
//---

   ObjectCreate(object, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(object,Text,9, "Verdana", warna);
   ObjectSet(object, OBJPROP_CORNER, 1);
   ObjectSet(object, OBJPROP_XDISTANCE, X);
   ObjectSet(object, OBJPROP_YDISTANCE, Y);
   WindowRedraw();
   return;
//----
  }
 
void TextLabels(string object, string Text, int Size, int X, int Y, color warna )
  {
//---

   ObjectCreate(object, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(object,Text,Size, "Verdana", warna);
   ObjectSet(object, OBJPROP_CORNER, 1);
   ObjectSet(object, OBJPROP_XDISTANCE, X);
   ObjectSet(object, OBJPROP_YDISTANCE, Y);
   WindowRedraw();
   return;
//----
  }
 
void TextLabel1(string object, string Text, int X, int Y )
  {
//---
//string textstring = Text;
   ObjectCreate(object, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(object,Text,9, "Verdana", Aqua);
   ObjectSet(object, OBJPROP_CORNER, 1);
   ObjectSet(object, OBJPROP_XDISTANCE, X);
   ObjectSet(object, OBJPROP_YDISTANCE, Y);
   WindowRedraw();

//----
  }

  void BigBox(string object, int X, int Y )
  {
//---
//string textstring = Text;
   ObjectCreate(object, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(object,"5",65, "Wingdings 2", Chartreuse);
   ObjectSet(object, OBJPROP_CORNER, 1);
   ObjectSet(object, OBJPROP_XDISTANCE, X);
   ObjectSet(object, OBJPROP_YDISTANCE, Y);
   WindowRedraw();

//----
  }
 
 
 
void ArrowT(string object, string Text, int X, int Y, color warna )
  {
//---
//string textstring = Text;
   ObjectCreate(object, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(object,Text,9, "Wingdings", warna);
   ObjectSet(object, OBJPROP_CORNER, 1);
   ObjectSet(object, OBJPROP_XDISTANCE, X);
   ObjectSet(object, OBJPROP_YDISTANCE, Y);
   WindowRedraw();
//----
  }

void arrownews(string label,string inp, int X, int Y)
{
  if (inp=="0") ArrowT(label, CharToStr(232), X, Y, Yellow );
  if (inp=="1") ArrowT(label, CharToStr(233), X, Y, LimeGreen );
  if (inp=="-1") ArrowT(label, CharToStr(234), X, Y, Red );
  if (inp=="Hi") ArrowT(label, CharToStr(221), X, Y, Red );
  if (inp=="Med") ArrowT(label, CharToStr(220), X, Y, Yellow );
  if (inp=="Lo") ArrowT(label, CharToStr(222), X, Y, LimeGreen );
  if (inp!="-1" && inp !="1" && inp!="0" && inp!="Hi" &&inp!="Med" && inp!="Lo" ) ArrowT(label, CharToStr(179), X, Y, Gold );
 
  return;
     
}