Download MetaTrader 5

Sending Trade Signal Via RSS Feed

10 July 2007, 08:39
chayutra sriboonruang
2 028


I'm going to give an idea of sending the trade signal from your best indicator or expert advisors to anyone of your community members via rss feed.
Now a day RSS is a very famous way to stay connected with community members.
As you can see , many professional websites have got the RSS symbol shown on the right of your address bar.
Not only that orange symbol but also some where easily seen inside the web content.
Many people think that to get this RSS symbol shown on your site need to be done by a web expert.
But in fact creating RSS is very easy. Let me show you how.


Before we start, let's be briefly informed about rss below.

From Wikipedia, the free encyclopedia

For other meanings of RSS, see RSS (disambiguation).

For RSS feeds from Wikipedia, see Wikipedia:Syndication.

RSS is a family of web feed formats used to publish frequently updated content such as blog entries, news headlines or podcasts. An RSS document, which is called a "feed," "web feed," or "channel," contains either a summary of content from an associated web site or the full text. RSS makes it possible for people to keep up with their favorite web sites in an automated manner that's easier than checking them manually.

RSS content can be read using software called a "feed reader" or an "aggregator." The user subscribes to a feed by entering the feed's link into the reader or by clicking an RSS icon in a browser that initiates the subscription process. The reader checks the user's subscribed feeds regularly for new content, downloading any updates that it finds.

The initials "RSS" are used to refer to the following formats:

  • Really Simple Syndication (RSS 2.0)

  • RDF Site Summary (RSS 1.0 and RSS 0.90)

  • Rich Site Summary (RSS 0.91)

RSS formats are specified using XML, a generic specification for the creation of data formats.

Read more here.

Something Needed

To get your own RSS sent to your community. You will need only a few simple things that are
  1. your own website or blog with ftp access allowed
  2. a little knowledge about file's function on mq4
  3. your own BUY/SELL text
Now let's start with your website first.

The only one thing you need to do with this part is to adjust all strings above to what you belong.
Without these string text, your RSS will not be completed. Assume you finished them. Let's go next step.

Working with File in MT4 is not so hard to play with.

By following my easy step below you will be able to send rss to your members easily.

Let's go.

Step 1. Declare your rss file.

Before your rss file to be declared , check for its existing first.

int handlerss = FileOpen("test.rss", FILE_READ, ';');//check for the existing test.rss

If your rss file is already exist the value of "handlerss " above should be 1. But if not, don't worry. You can create it. Just by placing this code below.

if(handlerss < 0)//means there is no any "test.rss" exist
    handlerss = FileOpen("test.rss", FILE_WRITE, ';');//now declare it .
    handlerss = FileOpen("test.rss", FILE_READ, ';');//and then check it again for future reference

Now your rss file was created and the value of "handlerss" should be 1. You can check it in the "Program Files\MetaTrader 4\experts\files" folder.

Next, your BUY and SELL text signal need to set. Please see step 2 below.

Step 2. Setup your BUY & SELL signal words.

string BuyStrrss = "GBPJPY 1.0 lots @  "
                   + DoubleToStr(MarketInfo("GBPJPY", MODE_BID), 
                   MarketInfo("GBPJPY", MODE_DIGITS))
                   + " || "
    , SellStrrss = "EURJPY 1.5 lots @ "
                   + DoubleToStr(MarketInfo("EURJPY", MODE_BID), 
                   MarketInfo("EURJPY", MODE_DIGITS))
                   + " || ";

Above is an example of my signal. You can change them to any words you wish.

After you have finished your own signal text , it's the time to see what you are waiting for " Your own RSS file".

Step 3. Your RSS File .

Please be sure to read the comment syntax to understand how to work it.

That's all for the RSS part. And your test.rss is now waiting for you in the "Program Files\MetaTrader 4\experts\files" directory.

You can check it easily by open it with any browser you love, and it will look like this.

Now it's time to send your signal.

Step 4. Send it to your sever.
SendFTP("test.rss", NULL);

To learn more about how to setup your ftp parameters please click here,

Step 5. Link it on your site.

There is no way your members can find out that you have got the rss signal service unless you let them know.

In this step you have 2 ways to let your members know that your RSS service is now available.

1. Link it directly on your webpage.

Insert the code above anywhere your wish it to appear, but inside the "BODY" tag.
And it will look like this.

2. Let the smart browser knows and detect your rss itself , then the RSS icon will be appeared automatically on the right of the address bar.

Insert the code above anywhere inside the "HEAD" part . Then the orange rss symbol will automatically appear on the right of the address bar.
Like this.

Now your members and visitors are be able to know that you give away the signal through the RSS service.

And when they click on that symbol or link on your webpage , they will lead your visitors to the subscription page automatically.

Your RSS subscription page will look like this. (This page will be appeared when the file "*anyname.rss" has been hosted on your web server only. )
Let's take a look.


All above are the step by step explaining how you can generate your own RSS service using MT4 indicator(s) or expert advisor(s).

All the thing you need to do are

  1. Copy the sample code from the RSSXample.mq4 attached below into any indicator/EA you wish, any where you prefer.
  2. Modify the XML header string your what you are belonging. Located here.
  3. Setup your BUY/SELL signal text. Located here.
  4. Send it. Check out here.
  5. Link it. Check how here.

That's all.

Now providing your own RSS service is not so hard to do anymore. Hope this helps at least one of you readers. Enjoy your new signal style.

Attached files | (0.44 KB)
rss.gif (1.04 KB)
RSSXample.mq4 (5.82 KB) (0.38 KB)
Last comments | Go to discussion (6)
Foreign Partners International
Shawn OConnor | 26 Jul 2008 at 21:32
could you take a look at my account and write this rss feed for me. i have tried to use these instructions and I am stilled not able to do this. I am not very experienced so maybe you could help me more? Thanks, Shawn OConnor
MQL4 Comments
MQL4 Comments | 22 Jul 2009 at 14:30
Hi, I have tried your RSS FEED program, it works very well, however, after a while I get this error: Fileopen-too many opened files. How do I fix the problem?
Karlsruher | 1 Mar 2010 at 03:34
Could you post how to make an EA that actually imports the Trades to MetaTrader from an RSS page?
MQL4 Comments
MQL4 Comments | 6 May 2010 at 02:12
Been looking for something like this forever, thanks!.

Best Forex Robot

Forex Robot
MQL4 Comments
MQL4 Comments | 20 Oct 2011 at 10:18

Dear all the links above are dead now - please re attach.

Step on New Rails: Custom Indicators in MQL5 Step on New Rails: Custom Indicators in MQL5

I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.

Here Comes the New MetaTrader 5 and MQL5 Here Comes the New MetaTrader 5 and MQL5

This is just a brief review of MetaTrader 5. I can't describe all the system's new features for such a short time period - the testing started on 2009.09.09. This is a symbolical date, and I am sure it will be a lucky number. A few days have passed since I got the beta version of the MetaTrader 5 terminal and MQL5. I haven't managed to try all its features, but I am already impressed.

False trigger protection for Trading Robot False trigger protection for Trading Robot

Profitability of trading systems is defined not only by logic and precision of analyzing the financial instrument dynamics, but also by the quality of the performance algorithm of this logic. False trigger is typical for low quality performance of the main logic of a trading robot. Ways of solving the specified problem are considered in this article.

Using text files for storing input parameters of Expert Advisors, indicators and scripts Using text files for storing input parameters of Expert Advisors, indicators and scripts

The article describes the application of text files for storing dynamic objects, arrays and other variables used as properties of Expert Advisors, indicators and scripts. The files serve as a convenient addition to the functionality of standard tools offered by MQL languages.