Download MetaTrader 5

Sending Trade Signal Via RSS Feed

10 July 2007, 08:39
chayutra sriboonruang
6
2 459

Introduction

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.


RSS

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, https://www.mql5.com/en/articles/1416.



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.




Conclusion

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 |
HTMLXample.zip (0.44 KB)
rss.gif (1.04 KB)
RSSXample.mq4 (5.82 KB)
test_rss.zip (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
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.

The Basic of Coding A Hedge Expert Advisor The Basic of Coding A Hedge Expert Advisor

An example of hedge Expert Advisor is just presented in this article. The author will choose its very own favorite hedge pair that is EURJPY & GBPJPY. It always moves the same way, easier to set the hedging order type.

ZUP - Universal ZigZag with Pesavento Patterns. Part 1 ZUP - Universal ZigZag with Pesavento Patterns. Part 1

The article gives a short description of ideas underlying indicator ZUP - Universal ZigZag with Pesavento Patterns. The article also describes indicators of ZigZag embedded in ZUP.

Forex Trading ABC Forex Trading ABC

Working on financial markets represents, first of all, trade operations. We all, starting from the very childhood, have an intuitive idea of what is to buy and to sell. But Forex trading is still something special. This article deals with the ideas necessary to explain some terms. We will also consider the MQL 4 functions that correspond with those terms.

Tricolor Indicators and Some Opportunities for Maximal Simplification of Writing Indicators Tricolor Indicators and Some Opportunities for Maximal Simplification of Writing Indicators

In this article the author dwells on some means of increasing indicators' informational value for visual trading. The author analyzes the realization of tricolor indicators, indicators, for building which data from other timeframes is used, and continues to dwell on the library of indicators, described in the article "Effective Averaging Algorithms with Minimal Lag: Use in Indicators"