Sri Lanka Equity Forum
Dear Reader,

Registration with the Sri Lanka Equity Forum would enable you to enjoy an array of other services such as Member Rankings, User Groups, Own Posts & Profile, Exclusive Research, Live Chat Box etc..

All information contained in this forum is subject to Disclaimer Notice published.


Thank You
Sri Lanka Equity Forum
සිංහල පරිවර්තනය
Poll

SLEF Market Sentiment Indicator

73% 73% [ 1136 ]
27% 27% [ 424 ]

Total Votes : 1560

Latest topics
» Abans in mega Shopping Mall project : Fitch report
by reyaz Today at 4:56 am

» I Quit CSE today and Enter NASDAQ/TDWL
by Chinwi Yesterday at 11:29 pm

» PABC Bank..
by Chinth Yesterday at 9:56 pm

» CSEC and CFVF
by ruwan326 Yesterday at 7:07 pm

» Is AINV.N going to its END
by Teller Yesterday at 5:56 pm

» ABOUT BFL.....
by Deen79 Yesterday at 3:15 pm

» CHOT 62% loss QOQ
by Teller Yesterday at 2:10 pm

» Sri Lanka: Stock Market - Blood Bath on First Day of Ranil's fourth Term lead UNP Government - over 500,000 Investors are awaiting Rs.500,000 per investor Margin Trading promise given in UNP Manifesto amounting to over Rs.250 Billion
by DS Wijesinghe Yesterday at 1:52 pm

» BINARY OPTION TRADING
by samaritan Yesterday at 1:49 pm

» DUTY OF CSE & SEC
by Teller Yesterday at 1:02 pm

» FLCH-First to decalre Div?
by Agape Yesterday at 10:54 am

» COLOMBO SHIT EXCHANGE UNDER YAHAPALANAYA
by samaritan Yesterday at 10:02 am

» sell and exit from CSE
by nigma Yesterday at 8:35 am

» Today ASPI 45 points down???? JKH 160/50
by nigma Yesterday at 8:21 am

» YORK RS. 1.00 DIVIDEND........?
by wisdom79 Yesterday at 7:24 am

» COCR IN TROUBLE?
by Chinwi Yesterday at 7:22 am

» SIRA loss increased by 270℅
by skyfall Yesterday at 2:15 am

» Teller .Equity stars 12123....
by Teller Tue Aug 15, 2017 11:14 pm

» PABC TO BE FINED !
by Teller Tue Aug 15, 2017 11:09 pm

» plantation shares.....
by Captain Tue Aug 15, 2017 11:01 pm

» FLCH Browns Capital
by hanuma Tue Aug 15, 2017 10:31 pm

» COCR profit declined QoQ by 19℅
by Teller Tue Aug 15, 2017 6:13 pm

» Advertise on Sri Lankas' No.1 Stock Market Forum!!
by Teller Tue Aug 15, 2017 6:11 pm

» ABANS FINANCE UNDER INVESTIGATION BY CSE AND SEC?
by Wimal Modawansa Tue Aug 15, 2017 5:24 pm

» KHL 380℅ lost QOQ
by samaritan Tue Aug 15, 2017 5:12 pm

» Open an Account with https://expertoption.com/?refid=10784
by jayasurya1126 Tue Aug 15, 2017 3:46 pm

» COUNTRY HEADED TOWARDS A BOP CRISIS !
by skyfall Tue Aug 15, 2017 11:11 am

» Hemas Profitability drops, CEO Steven Enderby warns tough times ahead but confident of HHL future growth
by reyaz Tue Aug 15, 2017 10:10 am

» PROPERTY BUBBLE IS IMMINENT !
by reyaz Tue Aug 15, 2017 10:05 am

» ELPITIY Good Profit
by visvajith Tue Aug 15, 2017 9:37 am

» භාණ්ඩාගාර බිල්පත් පොළිය තවදුරටත් පහළට
by stockback Mon Aug 14, 2017 10:44 pm

» Plantation Shares...
by Captain Mon Aug 14, 2017 10:12 pm

» watch CTBL & ASIYA
by Teller Mon Aug 14, 2017 9:59 pm

» KZOO.N0000 Will Rise Up
by Wimal Modawansa Mon Aug 14, 2017 4:45 pm

» Will JKH touch Rs. 180
by Miss-Sangeetha Mon Aug 14, 2017 10:28 am

» NOW TALK ABOUT YORK ARKADE PLC
by reyaz Mon Aug 14, 2017 9:59 am

» Ceylon Foreign Trade
by Investor1994 Mon Aug 14, 2017 7:47 am

» Sri Lanka Trade Deficit to widen with more urgent rice imports
by DS Wijesinghe Mon Aug 14, 2017 6:55 am

» More than 100 Annual and interim financial statements will be publish withing next 3 working days...
by Teller Mon Aug 14, 2017 12:54 am

» LIOC is active again
by Teller Mon Aug 14, 2017 12:52 am

» Sri Lanka Govt ready to squeeze credit to property'
by anges Sun Aug 13, 2017 10:12 pm

» DirectFN used by anyone now (Aug 2017)
by prabath Sun Aug 13, 2017 9:46 pm

» COUNTRY HEADING TOWARDS CHAOS....!!!!
by Teller Sun Aug 13, 2017 7:21 pm

» Whats up with ctld?
by Teller Sun Aug 13, 2017 6:51 pm

» Anna Umbalage ekek Yahapalanayata avilla
by Teller Sun Aug 13, 2017 6:18 pm

» ASI now 6500
by Teller Sat Aug 12, 2017 11:40 pm

» AINV.N Starts again ?
by Teller Sat Aug 12, 2017 11:32 pm

» Mattala Airport to be leased to Indian company ----GREAT.... Srilankan Airline is the only problem ...no one is willing to take
by Teller Sat Aug 12, 2017 11:29 pm

» Equity Forum
by Teller Sat Aug 12, 2017 11:17 pm

» If same thing happens in MR era?
by bakapandithaya Fri Aug 11, 2017 3:11 pm

» BOND GATE ........!!!!!!!!
by samaritan Fri Aug 11, 2017 10:38 am

» CENTRAL BANK BOND EXPLOSION ROCKS CSE
by samaritan Fri Aug 11, 2017 10:01 am

» Ravi to resign .....
by Chinwi Fri Aug 11, 2017 9:50 am

» MADU .......
by bakapandithaya Fri Aug 11, 2017 1:09 am

» What will Basil do now?
by bakapandithaya Thu Aug 10, 2017 11:46 pm

» MARKET DOWNSWING
by Ran49 Thu Aug 10, 2017 11:17 pm

» RAL with Max Profit.....
by Teller Thu Aug 10, 2017 11:07 pm

» ECL ECL Surpass 8++ with in next Week
by Teller Thu Aug 10, 2017 11:02 pm

» MALWATTE PLANTATIONS
by Ran49 Thu Aug 10, 2017 10:53 am

» All share RSI 20
by sharemarket Thu Aug 10, 2017 10:30 am

» TOP LISTED FINANCE COMPANIES
by Wimal Modawansa Thu Aug 10, 2017 10:08 am

» 20th AMENDMENT TO THE CONSTITUTION - FOR WHAT?
by Yahapalanaya Thu Aug 10, 2017 8:57 am

» How to invest in foreign stock market?
by Neluka Karannagoda Thu Aug 10, 2017 8:20 am

» LLUB any news?
by thankrishan Wed Aug 09, 2017 12:33 pm

» To beat the heat Chevron seeks better strategies
by DS Wijesinghe Wed Aug 09, 2017 6:51 am

» WHY THIS IS IMPORTANT TO READ NOW
by worthiness Tue Aug 08, 2017 7:54 pm

» GREG,DPL,TAP..........NOW LOLL
by wisdom79 Tue Aug 08, 2017 7:06 pm

» post publish for promoters./.................................
by reyaz Tue Aug 08, 2017 2:14 pm

» ABANS Unfair Offer Price
by Wimal Modawansa Tue Aug 08, 2017 12:46 pm

» Ahoo Kalamazzoooo....
by Wimal Modawansa Tue Aug 08, 2017 12:28 pm

» GRAN profit down by 100℅
by Teller Tue Aug 08, 2017 12:13 pm

» Apple hits all time highs, Dow eyes 22,000, Asia Hopes to Benefit too
by Teller Mon Aug 07, 2017 11:55 pm

» SAMPATH BANK FLYING COLORS
by worthiness Mon Aug 07, 2017 10:24 am

» KZOO WHO IS THE SELLER?
by Elahara Mon Aug 07, 2017 8:26 am

» Foreign purchases account for 81% today
by nigma Sun Aug 06, 2017 6:54 pm

» york.............game...17+++++++++++
by wisdom79 Sat Aug 05, 2017 7:20 pm

» BFN 18+ guaranteed
by worthiness Sat Aug 05, 2017 10:21 am

» WHat is going on FLCH.N
by Chinwi Sat Aug 05, 2017 10:09 am

» Is PCH.N mark its end ?
by Teller Fri Aug 04, 2017 10:55 pm

» I DON'T KNOW WHY.......
by ruwan326 Fri Aug 04, 2017 7:48 pm

» OMG..... FLCH interim report shows remarkable EPS....
by bakapandithaya Fri Aug 04, 2017 6:52 pm

» HEXP must trade above 100/ =
by anges Thu Aug 03, 2017 11:41 pm

» Last day to get LGL for a discount, be lucky to......
by reyaz Thu Aug 03, 2017 4:32 pm

» Laughs gas Actually a worthwhile investment.
by deli Thu Aug 03, 2017 4:21 pm

» One of the TOP Three
by deli Thu Aug 03, 2017 4:19 pm

» India cuts policy rates to lowest since 2010
by DS Wijesinghe Thu Aug 03, 2017 4:13 pm

» BONDGATE - SRI LANKA'S BIGGEST BOND SCANDAL!
by reyaz Thu Aug 03, 2017 3:50 pm

» Central Bank Policy Rates
by plsp1 Thu Aug 03, 2017 10:39 am

» CENTRAL BANK CEILING RATE FOR FIXED DEPOSITS
by worthiness Wed Aug 02, 2017 12:25 pm

» LB Finance VS VFIN
by worthiness Wed Aug 02, 2017 11:14 am

» RWSL good Buy
by MasterD Wed Aug 02, 2017 9:22 am

» MHDL community
by ruwan326 Wed Aug 02, 2017 7:30 am

» LIOC with price formula
by predictor Tue Aug 01, 2017 11:13 pm

» CFT Selling preser over now
by sameboy Tue Aug 01, 2017 10:23 pm

» MRH Give a Chance...........
by Teller Tue Aug 01, 2017 8:10 pm

» SHL community
by ruwan326 Tue Aug 01, 2017 3:09 pm

» impeachment on Ravi K..
by samaritan Tue Aug 01, 2017 12:49 pm

» Mandatory offer Stocks trading under its offer price
by fortuneteller Tue Aug 01, 2017 8:40 am

» Four Directors resigned from AINV.N
by wisdom79 Tue Aug 01, 2017 8:21 am

CSE EOD Data !

Page 3 of 4 Previous  1, 2, 3, 4  Next

View previous topic View next topic Go down

CSE EOD Data !

Post by CubedSol on Sun Jun 05, 2011 11:37 pm

First topic message reminder :

Hi Guys ,

I'm back to the forums scene , Sorry was inactive for a considerable period of time . Nice to see the NEW home has grown to be THE home for all/Majority of the guys who were at other sites.

As some of you guys know I was using AmiBroker and EOD data from the investnow.lk for analysis...But now that the site is down , and yours truly NOT being active there I don't have a way to get the EOD data .

I do have an updated EXCEL/CSV file containing EOD data until 2011/01/11 and I can export the current days data through DFN , But I need to fill the gap .

SO , If anyone can answer the question "How to export the HISTORY data from DFN ?? "" Will be saving my life...

Also pls find the mentioned data file for your reference.

http://www.4shared.com/file/JQ7W8v3v/All_Stocks_Colombo_Stock_Excha.html


Thanks & Best Regards,
CubedSol


Last edited by CubedSol on Mon Jun 06, 2011 10:38 pm; edited 1 time in total (Reason for editing : EOD Data file re-uploaded)
avatar
CubedSol
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 142
Equity Stars : 2741
Reputation : 44
Join date : 2011-02-06
Age : 29
Location : CyberSpace

Back to top Go down


Re: CSE EOD Data !

Post by JennyFunny on Thu Aug 04, 2011 8:48 am

Guys i managed to sought the problem out..the errors we due to incorrect date format.
This is 4th August 2011,should be inserted as 20110804 (yyyymmdd)

JennyFunny
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 452
Join date : 2011-05-20

Back to top Go down

Re: CSE EOD Data !

Post by gayanr600 on Thu Aug 04, 2011 1:44 pm

@CubedSol wrote:Updated files containing data until 03/08/2011 are located below .

Database Backup :

RAR : 2.8MB
http://www.4shared.com/file/wlNnyPsl/MyNewData__Updated_03_08_2011_.html

ZIP : 3.2MB
http://www.4shared.com/file/tEh3Eb9m/MyNewData__Updated_03_08_2011_.html

PS - ASPI & MPI updated until 02/08/2011

It is much grateful, if you can add the "CSE DL.xlsm" file too.

gayanr600
Equity Analytic
Equity Analytic

Posts : 30
Join date : 2011-06-23

Back to top Go down

Re: CSE EOD Data !

Post by CubedSol on Thu Aug 04, 2011 11:52 pm

Dear Gayan ,

No worries I've uploaded the file and you may download the same from the below link .

http://www.4shared.com/file/n_xtQ_DW/CSE_DL.html

PS - IMHO , After going through all the above posts from all our fellow members it seems that the reason for all these errors is because EVERYONE is is using their own DB structure... (Eg - DATE format) . So I thout that it'd be better for everyone IF I upload a MIRROR COPY of my DB daily , So that yall can SIMPLY replace your exsisting DB folder with .

CubedSol
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 142
Join date : 2011-02-06

Back to top Go down

Re: CSE EOD Data !

Post by CubedSol on Fri Aug 05, 2011 12:08 am

Razz thanks for the -REPS given to me.... Razz

CubedSol
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 142
Join date : 2011-02-06

Back to top Go down

Re: CSE EOD Data !

Post by xhora on Fri Aug 05, 2011 12:54 am

@CubedSol wrote:Razz thanks for the -REPS given to me.... Razz

hey keep uploading mate
+ Rep from me

xhora
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 462
Join date : 2011-04-24

Back to top Go down

Re: CSE EOD Data !

Post by smallville on Fri Aug 05, 2011 8:29 am

SanjivFund wrote:Guys i managed to sought the problem out..the errors we due to incorrect date format.
This is 4th August 2011,should be inserted as 20110804 (yyyymmdd)

I've been telling this for many times.. why nobody check it first? Twisted Evil Date format plays a huge role in plotting correct chart movements in Amibroker.. U mess it up u get all ur charts wrong..

Its very easy for me to download the daily file from CSE site and keep uploading it with this 1 minute workout of arranging the fields in Symbol-Date-Open-Hi-low-close-vol and deleting the unnecessary fields.. Its a manual workout daily..Or at least I make sure I download the file and keep it even if I dont update it daily..

Its a great pleasure if someone with programming knowledge with PHP/JS/etc.. can write a script (VB or whatever) to grab the csv file from CSE site and mail it to our mailboxes..
avatar
smallville
Associate Director - Equity Analytics
Associate Director - Equity Analytics

Posts : 4131
Equity Stars : 7667
Reputation : 530
Join date : 2011-02-03
Location : Back on Earth

Back to top Go down

Re: CSE EOD Data !

Post by gayanr600 on Fri Aug 05, 2011 8:42 am

Thanx man,
You r doing a great job.
This is my +rep from me.
avatar
gayanr600
Equity Analytic
Equity Analytic

Posts : 30
Equity Stars : 2295
Reputation : 3
Join date : 2011-06-23
Location : Kiribathgoda

Back to top Go down

Re: CSE EOD Data !

Post by JennyFunny on Fri Aug 05, 2011 9:32 am

ha ha cubes..great uploads thanks for taking the time
+rep from me


JennyFunny
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 452
Equity Stars : 2788
Reputation : 12
Join date : 2011-05-20
Age : 26
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by JennyFunny on Fri Aug 05, 2011 9:33 am

@smallville great idea..can anyone do it?

JennyFunny
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 452
Equity Stars : 2788
Reputation : 12
Join date : 2011-05-20
Age : 26
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by CubedSol on Sat Aug 06, 2011 11:34 am

Updated files containing data until 05/08/2011 are located below .

Database Backup :

RAR : 2.8MB
http://www.4shared.com/file/U_FuFRaT/MyNewData__Updated_05_08_2011_.html

ZIP : 3.2MB
http://www.4shared.com/file/7VRwBobC/MyNewData__Updated_05_08_2011_.html

CSE DL.xlsm
http://www.4shared.com/file/n_xtQ_DW/CSE_DL.html

PS - ASPI & MPI updated until 05/08/2011
avatar
CubedSol
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 142
Equity Stars : 2741
Reputation : 44
Join date : 2011-02-06
Age : 29
Location : CyberSpace

Back to top Go down

Re: CSE EOD Data !

Post by ssuni on Sat Aug 06, 2011 7:54 pm

@CubedSol wrote:

CSE DL.xlsm
http://www.4shared.com/file/n_xtQ_DW/CSE_DL.html

PS - ASPI & MPI updated until 05/08/2011
thanks cube
avatar
ssuni
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 197
Equity Stars : 2560
Reputation : 10
Join date : 2011-04-18

Back to top Go down

Re: CSE EOD Data !

Post by CubedSol on Mon Aug 08, 2011 11:16 pm

Updated files containing data until 08/08/2011 are located below .

Database Backup :

RAR : 2.8MB
http://www.4shared.com/file/145vE99m/MyNewData__Updated_08_08_2011_.html

ZIP : 3.2MB
http://www.4shared.com/file/d6lN-rYu/MyNewData__Updated_08_08_2011_.html

CSE DL.xlsm
http://www.4shared.com/file/n_xtQ_DW/CSE_DL.html

PS - ASPI & MPI updated until 05/08/2011
avatar
CubedSol
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 142
Equity Stars : 2741
Reputation : 44
Join date : 2011-02-06
Age : 29
Location : CyberSpace

Back to top Go down

Re: CSE EOD Data !

Post by webhoundx on Tue Aug 09, 2011 9:13 am

Thanks for the upload CubedSol

@smallville wrote:
Its a great pleasure if someone with programming knowledge with PHP/JS/etc.. can write a script (VB or whatever) to grab the csv file from CSE site and mail it to our mailboxes..

Currently working on this. I have a made a google spreadsheet that will auto update between 3pm-4pm every weekday with CSE site's CSV data. I was planning to test the process this week and let you guys know... Emailing part I'm currently working on. (A bit hard to find time with work and all Sad )

webhoundx
Stock Analytic
Stock Analytic

Posts : 18
Equity Stars : 2394
Reputation : 0
Join date : 2011-02-20

Back to top Go down

Re: CSE EOD Data !

Post by JennyFunny on Tue Aug 09, 2011 9:20 am

thanks..
+rep

JennyFunny
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 452
Equity Stars : 2788
Reputation : 12
Join date : 2011-05-20
Age : 26
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by twimalasuriya on Tue Aug 09, 2011 8:22 pm

@webhoundx wrote:Thanks for the upload CubedSol

@smallville wrote:
Its a great pleasure if someone with programming knowledge with PHP/JS/etc.. can write a script (VB or whatever) to grab the csv file from CSE site and mail it to our mailboxes..

Currently working on this. I have a made a google spreadsheet that will auto update between 3pm-4pm every weekday with CSE site's CSV data. I was planning to test the process this week and let you guys know... Emailing part I'm currently working on. (A bit hard to find time with work and all Sad )

Guys.

I have already developed a similar script that run as a cron job ( a scheduler running on linux ) each day (excluding holidays) , download the EOD, data, convert to excel , and then mail it to csereports@googlegroups.com, so the members of the google group get a copy.

I have another script that hourly runs at 10am till 3pm that gives same data, for the owner of http://samueldaniel7.blogspot.com/

If anyone wants I can easily develop a script to send EOD data in metastock format itself.

If anyone is interested I can share my scripts too. Its written in php.
avatar
twimalasuriya
Senior Equity Analytic
Senior Equity Analytic

Posts : 81
Equity Stars : 2354
Reputation : 6
Join date : 2011-06-28
Age : 40
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by twimalasuriya on Tue Aug 09, 2011 8:37 pm

[quote="smallville"]
SanjivFund wrote:
Its a great pleasure if someone with programming knowledge with PHP/JS/etc.. can write a script (VB or whatever) to grab the csv file from CSE site and mail it to our mailboxes..

@smallville - if you send me a mail to twimalasuriya at gmail dot com, I can add you to the maling list of http://groups.google.com/group/csereports where I already send such a auto generated EOD excel file.
avatar
twimalasuriya
Senior Equity Analytic
Senior Equity Analytic

Posts : 81
Equity Stars : 2354
Reputation : 6
Join date : 2011-06-28
Age : 40
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by webhoundx on Tue Aug 09, 2011 9:29 pm

@twimalasuriya wrote:
Guys.

I have already developed a similar script that run as a cron job ( a scheduler running on linux ) each day (excluding holidays) , download the EOD, data, convert to excel , and then mail it to csereports@googlegroups.com, so the members of the google group get a copy.

I have another script that hourly runs at 10am till 3pm that gives same data, for the owner of http://samueldaniel7.blogspot.com/

If anyone wants I can easily develop a script to send EOD data in metastock format itself.

If anyone is interested I can share my scripts too. Its written in php.

I was searching for a script but couldn't find anything developed for CSE. That's why I came up with a system of my own.
Anyways great news. Really appreciate you willing to share the sources as well Smile
Now if only we can come up with a system to auto import the data to Ami as well... cheers

webhoundx
Stock Analytic
Stock Analytic

Posts : 18
Equity Stars : 2394
Reputation : 0
Join date : 2011-02-20

Back to top Go down

Re: CSE EOD Data !

Post by twimalasuriya on Tue Aug 09, 2011 10:04 pm

@webhoundx wrote:
I was searching for a script but couldn't find anything developed for CSE. That's why I came up with a system of my own.
Anyways great news. Really appreciate you willing to share the sources as well Smile
Now if only we can come up with a system to auto import the data to Ami as well... cheers


I have below files on my host server (3ix), and I run downloadSummary.php as a cron job at 3pm (SL time) to mail this file to me.

By the way, I'm not a php developer but used php for this because its the best suited for the job.

downloadSummary.php

Code:


<?php

require_once ("support_functions.php");

$url = 'http://www.cse.lk/listedcompanies/overview.htm?d-16544-e=2&6578706f7274=1';
$dir = '/home/wimalasu/';
$file_name = 'summary_'.date("Y-m-d").'.tsv' ;
$excel_file_name = 'summary_'.date("Y-m-d").'.xls' ;

if (isholiday() == 0) {

// download tsv
downloadFile($url , $dir , $file_name);


// convert to excel

convertToExcel($dir.$file_name ,$dir.$excel_file_name );

// send it by email.

sendemail($file = $dir.$excel_file_name , 'thiwankaw@gmail.com' , 'cse_summary' , 'application/excel');


}else{

echo 'today is a cse holiday';

}



?>


support_functions.php

Code:


<?php


function sendemail($file,$to,$subject,$contenttype){

// Require Pear Mail Packages
require_once ("/home/wimalasu/php/Mail.php");
require_once ("/home/wimalasu/php/Mail/mime.php");
$recipients  = $to;
// Additional headers
$headers["From"] = 'thiwankaw@gmail.com';
$headers["To"]    = $to;
$headers["Subject"] = $subject;
$crlf = "\n";

$mime = new Mail_mime($crlf);
$mime->addAttachment($file, $contenttype);

$message = $mime->get();
$headers = $mime->headers($headers);
$params["host"]    = 'ssl://smtp.gmail.com';
$params["auth"]    = TRUE; // note: there are *no delimiters*
$params["port"] = 465 ;

// note: there are *no delimiters* for DIGEST-MD5 either.
// If you want to use PLAIN,
// you have to use delimiters like this: 'PLAIN'
// $params["auth"]    = DIGEST-MD5;
$params["username"]    = 'thiwankaw@gmail.com';
$params["password"]    = 'mypassword here because i have to send authenticated email';
//$params["localhost"]= '127.0.0.1';
// Debug so that we see what's happenning for the moment.
$params["debug"]    = "True";
// create the mail object using the Mail::factory method
$mail_message =& Mail::factory('smtp', $params);
$mail_message->send ($recipients, $headers, $message);
}


// this downloads a file to local folder
function downloadFile($url , $dir , $file_name){

    if($file_name == NULL){ $file_name = basename($url);}
    $url_stuff = parse_url($url);
    $port = isset($url_stuff['port']) ? $url_stuff['port'] : 80;

    $fp = fsockopen($url_stuff['host'], $port);
    if(!$fp){ return false;}

    $query  = 'GET ' . $url_stuff['path'] .'?' . $url_stuff['query'] . " HTTP/1.0\n";

    $query .= 'Host: ' . $url_stuff['host'];
    $query .= "\n\n";

    fwrite($fp, $query);

    while ($tmp = fread($fp, 8192))  {
        $buffer .= $tmp;
    }

    preg_match('/Content-Length: ([0-9]+)/', $buffer, $parts);
    $file_binary = substr($buffer, - $parts[1]);
    if($file_name == NULL){
        $temp = explode(".",$url);
        $file_name = $temp[count($temp)-1];
    }
    $file_open = fopen($dir . "/" . $file_name,'w');
    if(!$file_open){ return false;}
    fwrite($file_open,$file_binary);
    fclose($file_open);

}

// check if a given day is a holiday for cse
function isholiday(){

$day_index = date("w");
// it's the weekend
if($day_index == 0 || $day_index == 6) {
  return 1;
}


$handle = @fopen("/home/wimalasu/holidays", "r");
$isholiday = 0;
$today = date("Y-m-d");
if ($handle) {
    while (($buffer = fgets($handle, 4096)) !== false) {

      if ( strcmp($today,trim($buffer)) == 0 ){
          $isholiday = 1;
      }
    }
    if (!feof($handle)) {
        echo "Error: unexpected fgets() fail\n";
    }
    fclose($handle);
}
  return $isholiday;
}


function convertToExcel($inputFileName,$outputFileName) {

require_once 'phpexcel/Classes/PHPExcel.php';


$inputFileType = 'CSV';

/**  Create a new Reader of the type defined in $inputFileType  **/
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
/**  Set the delimiter to a TAB character  **/
$objReader->setDelimiter("\t");
/**  Load the file to a PHPExcel Object  **/
$objPHPExcel = $objReader->load($inputFileName);

/** Freeze pane so that the heading line won't scroll **/
$objPHPExcel->getActiveSheet()->freezePane('A2');



$writer = new PHPExcel_Writer_Excel5($objPHPExcel);
$writer->save($outputFileName);


}




?>



holidays (a list of holidays, so we dont download EOD file for these days)
Code:


2011-01-19
2011-02-04
2011-02-16
2011-02-17
2011-03-02
2011-04-13
2011-04-14
2011-04-15
2011-05-02
2011-05-17
2011-05-18
2011-06-15
2011-07-14
2011-08-31
2011-10-11
2011-10-26
2011-11-10
2011-12-10
2011-12-26




avatar
twimalasuriya
Senior Equity Analytic
Senior Equity Analytic

Posts : 81
Equity Stars : 2354
Reputation : 6
Join date : 2011-06-28
Age : 40
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by JennyFunny on Wed Aug 10, 2011 9:28 am

Great stuff seriously..thanks for the information..

JennyFunny
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 452
Equity Stars : 2788
Reputation : 12
Join date : 2011-05-20
Age : 26
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by Genting on Thu Sep 01, 2011 5:00 pm

can someone pls share latest EOD data for Amibroker

Genting
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 350
Equity Stars : 2848
Reputation : 46
Join date : 2011-02-21

Back to top Go down

Re: CSE EOD Data !

Post by krishaja on Sun Sep 04, 2011 7:40 pm

@twi malasooriy
pl.. tell me where to add these codes?

krishaja
Stock Trader

Posts : 5
Equity Stars : 2195
Reputation : 0
Join date : 2011-08-18

Back to top Go down

Re: CSE EOD Data !

Post by smallville on Sun Sep 04, 2011 7:51 pm

@twimalasuriya wrote:
@webhoundx wrote:
I was searching for a script but couldn't find anything developed for CSE. That's why I came up with a system of my own.
Anyways great news. Really appreciate you willing to share the sources as well Smile
Now if only we can come up with a system to auto import the data to Ami as well... cheers


I have below files on my host server (3ix), and I run downloadSummary.php as a cron job at 3pm (SL time) to mail this file to me.

By the way, I'm not a php developer but used php for this because its the best suited for the job.

downloadSummary.php



Greek to me Wink pardon my ignorance since I hate programming.. he hee.. but great job.. Send u a mail.. pls do the needful.. thanks..
avatar
smallville
Associate Director - Equity Analytics
Associate Director - Equity Analytics

Posts : 4131
Equity Stars : 7667
Reputation : 530
Join date : 2011-02-03
Location : Back on Earth

Back to top Go down

Re: CSE EOD Data !

Post by twimalasuriya on Mon Sep 05, 2011 10:47 am

@krishaja wrote:@twi malasooriy
pl.. tell me where to add these codes?


krishaja , you have two options

1. run these scripts on your server as a scheduled job
2. get a copy of the email i'm generating each day at https://groups.google.com/forum/?hl=en#!forum/csereports

if you want to go for option 1, you might need some php programming knowledge. if you have, and just want some help , then PM me.

if you are happy with option 2, goto https://groups.google.com/forum/?hl=en#!forum/csereports and become a member.

(If you are privacy conscious [understandably], then i suggest you create a new gmail address just for this and add it to the mail group. then just add a filter the the new email address to forward the email to your regular email )

please do not hesitate to PM me if you have any questions.
avatar
twimalasuriya
Senior Equity Analytic
Senior Equity Analytic

Posts : 81
Equity Stars : 2354
Reputation : 6
Join date : 2011-06-28
Age : 40
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by ha_na on Tue Sep 06, 2011 8:58 am

I need 9 February 2011 and 9 may 2011 EOD data for all companies. I have error on those two days. Can someone help me?
Thanks

ha_na
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 117
Equity Stars : 2498
Reputation : 20
Join date : 2011-03-30
Age : 42

Back to top Go down

Re: CSE EOD Data !

Post by twimalasuriya on Tue Sep 06, 2011 9:29 am

@ha_na wrote:I need 9 February 2011 and 9 may 2011 EOD data for all companies. I have error on those two days. Can someone help me?
Thanks

I just copied two files you wanted to the location below

(Symbol Date (YYMMDD) Open High Low Close Vol )

http://wimalasuriya.com/cse/eod/20110209.txt
http://wimalasuriya.com/cse/eod/20110509.txt

These are from a local database I update each day from data taken from cse.lk

I run a sql like below to get the file

Code:


SELECT  share,DATE_FORMAT(date,'%Y%m%d') , open,high,low,close,sharevolume
INTO OUTFILE '/tmp/20110509.txt'
  FIELDS TERMINATED BY '\t'
  LINES TERMINATED BY '\n'
  from ohlc  where date = '2011-5-9' ;



Last edited by twimalasuriya on Tue Sep 06, 2011 9:36 am; edited 1 time in total (Reason for editing : added file format)
avatar
twimalasuriya
Senior Equity Analytic
Senior Equity Analytic

Posts : 81
Equity Stars : 2354
Reputation : 6
Join date : 2011-06-28
Age : 40
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by ha_na on Tue Sep 06, 2011 10:49 am

thanks my dear.
I want excel format as I want to convert it to Metastock. Is it possible?
Thanks.

@twimalasuriya wrote:
@ha_na wrote:I need 9 February 2011 and 9 may 2011 EOD data for all companies. I have error on those two days. Can someone help me?
Thanks

I just copied two files you wanted to the location below

(Symbol Date (YYMMDD) Open High Low Close Vol )

http://wimalasuriya.com/cse/eod/20110209.txt
http://wimalasuriya.com/cse/eod/20110509.txt

These are from a local database I update each day from data taken from cse.lk

I run a sql like below to get the file

Code:


SELECT  share,DATE_FORMAT(date,'%Y%m%d') , open,high,low,close,sharevolume
INTO OUTFILE '/tmp/20110509.txt'
  FIELDS TERMINATED BY '\t'
  LINES TERMINATED BY '\n'
  from ohlc  where date = '2011-5-9' ;


ha_na
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 117
Equity Stars : 2498
Reputation : 20
Join date : 2011-03-30
Age : 42

Back to top Go down

Re: CSE EOD Data !

Post by twimalasuriya on Tue Sep 06, 2011 12:13 pm

@ha_na wrote:thanks my dear.
I want excel format as I want to convert it to Metastock. Is it possible?
Thanks.


pm me a email address, i will send you
avatar
twimalasuriya
Senior Equity Analytic
Senior Equity Analytic

Posts : 81
Equity Stars : 2354
Reputation : 6
Join date : 2011-06-28
Age : 40
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by seyon on Mon Sep 26, 2011 4:57 pm

Thanks

seyon
Assistant Vice President - Equity Analytics
Assistant Vice President - Equity Analytics

Posts : 783
Equity Stars : 3401
Reputation : 119
Join date : 2011-02-01
Location : Colombo

Back to top Go down

Re: CSE EOD Data !

Post by amilaela on Sun Oct 16, 2011 7:56 pm

okk
avatar
amilaela
Senior Manager - Equity Analytics
Senior Manager - Equity Analytics

Posts : 430
Equity Stars : 2760
Reputation : 18
Join date : 2011-10-06
Location : colombo

http://www.facebook.com/profile.php?id=100001851586843

Back to top Go down

Re: CSE EOD Data !

Post by aero on Sat Nov 26, 2011 1:11 am

can someone pls share latest ASPI & MPI EOD data for Amibroker?

aero
Manager - Equity Analytics
Manager - Equity Analytics

Posts : 166
Equity Stars : 2623
Reputation : 4
Join date : 2011-03-12

Back to top Go down

Page 3 of 4 Previous  1, 2, 3, 4  Next

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum
Statistics
We have 20021 registered users
The newest registered user is CooperOr

Our users have posted a total of 326774 messages in 50189 subjects
Who is online?
In total there are 59 users online :: 1 Registered, 1 Hidden and 57 Guests

reyaz

Most users ever online was 541 on Mon Sep 19, 2011 11:29 am
Forum Disclaimer

The information contained in this forum have been submitted by third parties directly without any verification by us. The information available in this forum is not researched or purported to be complete description of the subject matter referred to herein. We do not under any circumstances whatsoever guarantee the accuracy and completeness information contained herein.

www.srilankaequity.com its blogs, forums, subdomains and/or its affiliates and/or its web masters, administrators or moderators shall not in any way be responsible or liable for loss or damage which any person or party may sustain or incur by relying on the contents of this report and acting directly or indirectly in any manner whatsoever.

Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility, www.srilankaequity.com its blogs, forums, subdomains and/or its affiliates and/or its web masters, administrators or moderators shall not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information. The information on this website is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.