Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created September 14, 2018 17:23
Show Gist options
  • Save marketcalls/cd55ff5a4416e766803a13c078a08b88 to your computer and use it in GitHub Desktop.
Save marketcalls/cd55ff5a4416e766803a13c078a08b88 to your computer and use it in GitHub Desktop.
Moneycontrol News Snippets
// Coded by Rajandran R
// Coded Date : 14-09-2018
// Author - Maketcalls (www.marketcalls.in )
// Co-Founder - Traderscafe (www.traderscafe.in)
//Supports Amibroker Version 6.17 or higher version
Version(6.17);
_SECTION_BEGIN("MoneyControl News");
SetChartOptions(0 , chartShowArrows | chartShowDates);
SetChartBkColor(colorBlack);
show = ParamToggle("Candle","SHOW|HIDE",0);
list = ParamList("News","Latest News|Brokerage Recos|Buzzing Stocks|Economy|Market Reports|GlobalMarkets|IPO News|Market Outlook|Technicals|Commodity News|Results News|Currency News|Current Affairs");
ih=Null;
if(show)
{
Plot(Close,"Candle", colorDefault, styleCandle);
}
//ih = InternetOpenURL("http://www.moneycontrol.com/rss/buzzingstocks.xml" );
if(list=="Latest News")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/latestnews.xml" );
if(list=="Brokerage Recos")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/brokeragerecos.xml" );
if(list=="Buzzing Stocks")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/buzzingstocks.xml" );
if(list=="Economy")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/economy.xml" );
if(list=="Market Reports")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/marketreports.xml" );
if(list=="GlobalMarkets")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/internationalmarkets.xml" );
if(list=="Market Outlook")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/marketoutlook.xml" );
if(list=="Technicals")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/technicals.xml" );
if(list=="Commodity News")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/commodities.xml" );
if(list=="Results News")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/results.xml" );
if(list=="Currency News")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/currency.xml" );
if(list=="Current Affairs")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/currentaffairs.xml" );
if(list=="IPO News")
ih = InternetOpenURL("http://www.moneycontrol.com/rss/iponews.xml" );
count = 0;
x = 50;
y= 50;
color = 20;
str1=Null;
str2=Null;
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetBkMode( 1 );
Title = "Moneycontrol "+list + "\nwww.marketcalls.in";
if( ih )
{
while( ( str = InternetReadString( ih ) ) != "" )
{
if((StrFind(str,"<pubDate>") or StrFind(str,"<title>"))
and !StrFind(str,"Moneycontrol"))
{
GfxSetTextColor(ColorRGB( 200, color, color ));
if(StrFind(str,"<title>"))
{
str1= str;
str1 = StrTrim(str1,"\t");
str1 = StrTrim(str1,"");
str1 = StrTrim(str1,"<title>");
str1 = StrTrim(str1,"</");
}
if(StrFind(str,"<pubDate>"))
{
str2 = str;
str2 = StrTrim(str2,"\t");
str2 = StrTrim(str2,"");
str2 = StrTrim(str2,"<pubDate>");
str2 = StrTrim(str2,"</");
str2 = " - "+str2;
}
count = count+1;
if(count % 2 ==0)
{
GfxTextOut( str1 + str2, x, y );
y = y+30;
color = color+10;
}
}
}
InternetClose( ih );
}
_SECTION_END();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment