Skip to content

Instantly share code, notes, and snippets.

@trungv0
Created October 13, 2015 05:11
Show Gist options
  • Save trungv0/ccb46b2952377e0e503a to your computer and use it in GitHub Desktop.
Save trungv0/ccb46b2952377e0e503a to your computer and use it in GitHub Desktop.
Sample stock messages
var util = require('util');
var stocks = ['AAA','ACB','ADC','ALT','ALV','AMC','AME','AMV','APG','API','APP','APS','ARM','ASA','B82','BAM','BBS','BCC','BDB','BED','BHT','BII','BKC','BLF','BPC','BSC','BST','BTS','BVS','BXH','C92','CAN','CAP','CCM','CEO','CID','CJC','CKV','CMC','CMI','CMS','CPC','CSC','CT6','CTA','CTB','CTC','CTN','CTS','CTX','CVN','CVT','CX8','D11','DAC','DAD','DAE','DBC','DBT','DC2','DC4','DCS','DGC','DHP','DHT','DID','DIH','DL1','DLR','DNC','DNM','DNP','DNY','DPC','DST','DXP','DZM','EBS','ECI','EFI','EID','FDT','FIT','GGG','GLT','GMX','HAD','HAT','HBE','HBS','HCC','HCT','HDA','HDO','HEV','HGM','HHC','HHG','HJS','HLC','HLD','HLY','HMH','HNM','HOM','HPC','HPS','HST','HTC','HTP','HUT','HVT','ICG','IDJ','IDV','INC','INN','ITQ','IVS','KHB','KHL','KKC','KLF','KLS','KMT','KSD','KSK','KSQ','KST','KTS','KTT','L14','L18','L35','L43','L44','L61','L62','LAS','LBE','LCD','LCS','LDP','LHC','LIG','LM3','LM7','LO5','LTC','LUT','MAC','MCC','MCF','MCO','MDC','MEC','MHL','MIM','MKV','MMC','MNC','NAG','NBC','NBP','NDF','NDN','NDX','NET','NFC','NGC','NHA','NHC','NPS','NST','NTP','NVB','OCH','ONE','ORS','PCG','PCT','PDC','PEN','PFL','PGS','PGT','PHC','PID','PIV','PJC','PLC','PMC','PMS','POT','PPE','PPG','PPP','PPS','PRC','PSC','PSD','PSI','PTI','PTM','PTS','PV2','PVA','PVB','PVC','PVE','PVG','PVI','PVL','PVR','PVS','PVV','PVX','PXA','QCC','QHD','QNC','QST','QTC','RCL','S12','S55','S74','S91','S96','S99','SAF','SAP','SCJ','SCL','SCR','SD1','SD2','SD4','SD5','SD6','SD7','SD9','SDA','SDB','SDC','SDD','SDE','SDG','SDH','SDN','SDP','SDT','SDU','SDY','SEB','SED','SFN','SGC','SGD','SGH','SHA','SHB','SHN','SHS','SIC','SJ1','SJC','SJE','SJM','SLS','SMT','SPI','SPP','SQC','SRA','SRB','SSG','SSM','STC','STL','STP','SVN','TAG','TBX','TC6','TCS','TCT','TDN','TET','TH1','THB','THS','THT','TIG','TJC','TKC','TKU','TMC','TMX','TNG','TPH','TPP','TSB','TST','TTC','TTZ','TV2','TV3','TV4','TVC','TVD','TXM','UNI','V12','V15','V21','VAT','VBC','VBH','VC1','VC2','VC3','VC5','VC6','VC7','VC9','VCC','VCG','VCM','VCR','VCS','VDL','VDS','VE1','VE2','VE3','VE4','VE8','VE9','VFR','VGP','VGS','VHH','VHL','VIE','VIG','VIT','VIX','VKC','VLA','VMC','VMI','VNC','VND','VNF','VNN','VNR','VNT','VPC','VTC','VTH','VTL','VTS','VTV','VXB','WCS','WSS','YBC','PHP','PMP','PSW','HVA','SMN','TTB','CTT','HKB','DPS','KVC','PCE','PDB','E1SSHN30','ACM','NHP','PBP','PSE','TA9','DP3','FID','G20','PMB'];
// var message = JSON.stringify({
// data: '10|1444709390474|11:09:50|SSI|CT CP CHUNG KHOAN SAI GON|S|47006368.4|23986610.5|24.6|24.4|0|0|0|24.7|24.4|26.3|22.9|0|0|24.6|1000|24600|0|24.5|18932|24.4|25474|24.3|24470|24.6|4549|24.7|19606|24.8|23365|29.875|121649|26177|0|24.4|50132|',
// type: 'STOCK'
// });
// bid3
var data_template = '02|1444709390474|11:09:50|%s|CT CP CHUNG KHOAN SAI GON|S|47006368.4|23986610.5|24.6|24.4|0|0|0|24.7|24.4|26.3|22.9|0|0|24.6|1000|24600|0|24.5|18932|24.4|25474|%d|24470|24.6|4549|24.7|19606|24.8|23365|29.875|121649|26177|0|24.4|50132|';
var message;
var counter = 0;
stocks.forEach(function(stock) {
var data = util.format(data_template, stock, counter);
message = JSON.stringify({data: data, type: 'STOCK'});
counter++;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment