18
Realtime data from NOW, NEST, ZERODHA Trader TO Excel AMIBROKER, FCHARTS, 1Preface.............................................................2 2System Requirements.................................................2 3Setup...............................................................3 4Setup for AmiBroker Users-..........................................3 5GETTING REAL TIME DATA FEED TO EXCEL................................4 6NSENOW/ NestTrader To EXCEL – RTNOW.................................4 7Getting Realtime Feed to AMIBroker..................................6 8Realtime feed to FCharts............................................6 Backfill.............................................................7 9Backfill with NOWBackfill...........................................7 10Backfill with NOWHSBackfill.......................................13 11Troubleshooting...................................................14

NOW-Nest-Zerodha Trader to Excel to AmiBroker

Embed Size (px)

DESCRIPTION

amibroker

Citation preview

Realtime data from NOW, NEST, ZERODHA Trader TO Excel AMIBROKER, FCHARTS, 1Preface22System Requirements23Setup34Setup for AmiBroker Users-35GETTING REAL TIME DATA FEED TO EXCEL46NSENOW/ NestTrader To EXCEL RTNOW47Getting Realtime Feed to AMIBroker68Realtime feed to FCharts..........6Backfill.........79Backfill with NOWBackfill710Backfill with NOWHSBackfill1311Troubleshooting14Preface1. This utility was originally developed to feed real time quotes from NOW (Neat on Web) to Amibroker and distributed it freely with source code. After using it for some period, it was realised that with some further coding, it can be used to feed real time quotes from NEST, ODIN, Trade Tiger, Google and Yahoo to charting applications like Amibroker, Fcharts Qtstalker and Metastock also. This utility was upgraded to various versions. and now it has become stable. 2. The utility gives RT quotes in Ami from the time you click on- Start. It does not give RT from beginning of the day. So start RT and then open backfill. Copy data upto the time you logged in into Backfill. When backfills warns you, save database and do backfill. Your data will be current.3. You do not have to record any excel macro.4. Since you are reading this, it means you have downloaded the zip file containing the utility and extracted it. This help file is accompanied by following files. Use the files appropriate for your setup.

RTNOW.xlsm Real time feed from NSENOWRTNest.xlsm Real time feed from NestNowBackfil.xlsm Backfill from NOW/Nest TraderNowHSbackfil.xlsm - Backfill from NOW/Nest Trader Hourly Statistics/VWapNest3.format This file is used by Amibroker to import backfill dataRTG3.format This file is used by Amibroker to import real time data

System Requirements1. Minimum requirement is Excel 2007 32 bit and Windows XP or above.2. Tested on Windows XP and Windows 2003 x64 Server, Windows 8 , Windows 7.3. If you get N/A in RTNOW/Nest after Link to Excel - For those who are using windows 7 and above, installing excel, Amibroker and NEST(or NOW) in D: drive folders allows one to start programs as normal user and get data feed with Josh utilities with out admin privileges.

In normal installation, C:\Program Files folder is used. That needs admin privileges to access. (Originally Posted by lvgandhi). You will have to open Nest Trader as well as Excel as administrator. To open them as administrator, Right/Click on these programs and then click on Run as. Alternately, click on Properties. In the Properties dialog box, click the Compatibility tab. select the- Run This Program As An Administrator check box, and then click OK. See below site for details. http://technet.microsoft.com/en-us/magazine/ff431742.aspxhttp://www.snaphow.com/4543/make-programs-run-as-administrator-by-default-in-windows-7

4. For NOW/Nest Trader Users - OS may be 64 bit but MSOffice must be 32 bit. 64 bit MS Office does not support RTD function as yet. It will not work until Microsoft enables RTD.Setup1. There are two stages involved in getting real time charts with this utility.

First - Getting the realtime feed from Trading software or Google/Yahoo to Excel.

Second - Getting the realtime feed from Excel to Charting software.

2. Files of type *.xlsm can be kept anywhere in a separate folder. However, I recommend keeping them wherever your Trading Software/application resides. Users of NOW should move them to C:\Program Files\NOW or C:\Program Files (x86)\NOW depending upon your version of windows. Users of Nest Trader should move them to C:\Program Files\Omnesys or C:\Program Files (x86)\Omnesys depending upon your version of windows. Users of Trade Tiger should move them to C:\Program Files\TradeTiger3. Files of type *.format ( Nest3.format and RTG3.format ) should be moved to 'Your\Path\to\Amibroker\format folder' since Amibroker requires them there.4. Open Excel. Click on the Office icon on top left 5. Click on Excel Options- Trust Center - Trusted Locations - Add New Location and give the path of folder where your Trading Software resides. Also give the path of folder where you kept the *.xlsm files. For example, if you have kept the excel files on 'desktop\RTNOW' folder, then include that folder in trusted loactions. This way, excel will open the .xlsm file with macros enabled. Otherwise, you will have to enable macros every time.

Setup for AmiBroker Users- 1. Before trying anything in AmiBroker, create new database e.g. C:\AmiBroker\RTdata.2. Give database folder path to create database. Thereafter, do all the settings as shown above. Those who want to combine EOD data should check against -Allow mixed EOD/Intraday data in Intraday settings.3. GoTO Tools Preferences-Do settings in preferences as shown below.

GETTING REAL TIME DATA FEED TO EXCEL NSENOW/ NestTrader To EXCEL RTNOW

1. Request your Broker to activate RTD feature for your account. If RTD is not activated, you will get "RTD attribute not licensed" error......2. Always open applications in this order1. NOW or Nest 2. RTNOW or RTNest3. If you open excel first, you will see #N/A in all cells because it cannot find referenced quotations.4. Open NOW - > Right click In market watch, reposition columns OR (Shift + R) , get the following columns- Trading Symbol | Last Traded Time | Last Traded Price | Volume Traded Today |Open Interest | Symbol 5. Order of the columns is not important. However, if you keep the same order, it will become convenient to paste in Excel. 6. Save the columns.7. Select the scrips you want in Marketwatch by Shift+click 8. Right Click Marketwatch and navigate to Link to Excel . See figure below-

9. Click All Items or selected items.10. Paste in RTNOW.xlsm in Cell A7 in the Sheet "RTD".11. You will see Realtime feed in Excel. The prices and time will be changing.12. Link the cells in Sheet NOW OR Nest to the appropriate cells in sheet RTD . Do not change order of the fields in Sheet Nowor Nest else you will not get live charts in AmiBroker.13. You are free to add/delete/change the scrips given in original Sheet once you are comfortable with it. Users should note that Nifty Spot data is not available in NSENOW.14. Some times, realtime feed stops when Excel Sheet is tinkered with. Just save the book, close excel and reopen. RT feed will start.15. NSE NOW seems to have a limit of 55 scrips at a time. Hence you will get error in NOW if you exceed that number and RT feed will not start for excess scrips. 16. Do not change the order of columns. For ease of linking, keep the order of columns same in NOW or NEST TRADER.17. You can add/delete columns if you wish. You will have to edit the RTG3.format file. However first four columns are mandatary.18. Check the database path in cell B1. If your database is at a different location, enter that in cell B1. In my case, it is on H drive.

Getting Realtime Feed to AMIBroker1. Once you start getting realtime quotes in Excel, next step is to get them in AmiBroker and see the charts moving. Your source can be any of NOW, Odin. Trade Tiger, Yahoo or Google. Method of feeding data to AmiBroker is similar. Here is a snapshot of RTNOW.xlsm. 2. If you installed RAM drive, then give Drive Letter in Cell B2 other wise leave it blank . If you are not sure what is RAM Drive, keep this field blank3. Give Your\Database\Path in cell B1.4. Click on Start RT Data.5. AmiBroker Should open automatically and you will see live charts moving

Realtime feed to FCharts..........

1. FCharts is another application for stock charting. There are two versions of this application. 1. FChartSE is free for all users and 2. FChartPRO is paid versions. I had used the free version about two years ago. I found some discrepancies in weekly charts. That is why and also because I had money to spend, I bought AmiBroker. I installed the latest free version about a month ago. It seems to have improved a lot and added some excellent facilities in two years. New Traders are advised to use this application. FchartSE is very easy for intraday charts.2. All the files of type *.xlsm work out of the box with FCHARTSE the free charting software.3. Those who are not getting Last Traded time in data feed(diet ODIN) will have to click on "Start RT Data" to get current time. All others just have to start data feed application like NOW or NEST and get realtime feed to FChartSE.4. Open NOW or Nest or which ever software5. Open RTNOW/RTNest/RTGoogle/RTYahoo/RTODIN/RTTiger.xlsm whichever you want and check whether rates are changing. (Trust Centre settings to be done as given earlier in this thread) 6. We will have to add Date Column since it needs that. Do not add any column. Use the "Symbol" column instead. Erase its contents and type "=Today()" without quotes against each scrip in that column.7. Open FChartSE8. Click on Intraday and select Excel as source.9. Click on Refil List and It will show the name of excel file.10. Column settings as given in the image. They are self explanatory.11. 1st Data Row in our case is 7.12. Click on Start. You can see one minute bars getting updated live in FCharts.

Backfill.........Backfill with NOWBackfill 1. Approx. 15 days 1 min. OHLC data is available from NOW/Nest plus/Nest Trader. These can be used for FnO and index. I am not aware what is offered by Trade Tiger. Users of TT will have to explore.2. For Cash scrips, Data Downloader by Joydeep can be still used. It can download 10 days 1 min. OHLC data from Google. Good for bulk backfill.Operating Instructions3. If you want to have backfill from Now, activate the Launch Plus Radio Button. Login in to Now. You have to be registerd on Omnesys Nestplus portal.4. Right Click on any of the scrips or press Shift+P - select Plugin commands Select Plus Chart.

5. If Nest Plus has not started, following window will open. Login into Nest Plus.6. Nest plus will start and intraday chart will be seen. If chart does not appear, repeat previous step.7. Click on the chart and select Data Table or press Ctrl+D.

8. Data window will open. This contains intraday data of last fifteen days. Click on any row. Press Ctrl+A to select all rows.

9. All rows will become blue. Press Ctrl+C to copy data.

10. Open separate instance of MSExcel by clicking on Start - Programs in Windows and then open NowBackfil.xlsm from File -- open Menu in Excel. Do not open by double-click on the file. Click on the Masters Sheet. Correct the Database Path in cell C1 to Your\Database\Path. Save file.

11. Go to the Sheet1. Press Ctrl+V into cell A1 of Sheet1. If Coloumn B shows ###### instead of date, increase its width and you will see date time. You are ready to backfill data. 12. See image below. Look at the Column B, Excel recognised date time and right aligned it. If it is left aligned, there may be problem.13. Click on the Push button "Click me to backfil".14. A pop-up window will warn you to save database if Realtime feed is running. Go to AmiBroker and save database by Clicking on File and then on Save Database. Thereafter, come back in NowBackfil and click on OK or press Enter.15. Another Pop-up window will ask you whether you want to split Date and Time into separate columns. Click on "Yes" if they are combined and "No" if Excell has already put them in separate columns.16. Backfil will be done and you will get message "Data imported".17. Do not save changes to the file when closing.18. You can use Alias in Scrip info to backfil correct scrips

19. You can Change Scrip Name in RTNest while linking to Nest sheet so that it matches with name in Data Downloader. I have given sample formulae in RTNest for that. See all formulae.20. Use simple find replace for scrips where name does not match. Backfill with NOWHSBackfill 1. This file is used to backfill current days data from Hourly statistics of NOW or VWap statisticks from Nest.

2. The whole process will take about 10 seconds for each scrip. It can be used for FnO scrips for upto 10 scrips and more if you do not get fatigued by pressing Ctrl+P and Ctrl+D. For Cash scrips or for bulk backfill, you may use Data Downloader by Joydeep that gives 10 days data from Google.3. Note: If scrip name in NestPlus is different than your scrip name, you will have to merge the two scrips in AmiBroker to integrate the data. For example in my case Nifty future will be backfilled as NIFTYYMMMFUT. So after running NOWBackfil I find a new scrip NIFTY12MAYFUT in the database. I have to merge NIFTY with NIFTY12MAYFUT in AmiBroker. This can be done from Symbol-Merge menu of AmiBroker. Target is NIFTY and mrge with NIFTY12MATFUT. Overwrite Duplicate Quotes. 4. Working in Excel on other applications while realtime feed is running....5. You will have to open separate instance of Excel from Start--Programs--MSOffice--Excel. do not open any file by double clicking on it. Troubleshooting1. I am not too good in computer related stuff, please help me.You need not be good in computers to follow this. Follow all the instructions. If you do not understand any instruction, ask me. Sorry, I cannot do spoon feeding. Please help yourself first and thereafter I will help you.2. I did everything as per instructions but I am not getting charts. Please help.What do you mean by that. I cannot help you with one line information. Check whether you followed all the steps as given. Give me the exact step where you are not getting desired results and ask specific question.3. Backfill is not happening.What do you mean by that. I cannot help you like that. Check whether you followed all the steps as given and ask specific question. You do database setting only once. Be sure that you give same database path to RT utility and Backfill utility.4. Microsoft visual basic Run -Time error '429' ActiveX component can't create object" Solution- This error occurs because of missing system files or registry entries. See these sites for repairinghttp://www.errorsupport.org/blog/visual+basic+runtime+error+429.htmlhttp://windowserrorfixpro.com/runtime-error-429-fix-guides-to-repair-runtime-error-429/

5. I did everything as per instructions but I am not getting data from NOW/Nest to Excel.This utility may not work on Windows 7 since there are some permission issues on Windows7. If you get N/A in RTNOW/Nest after Link to Excel and Paste in Windows7, nothing can be done.6. In RTXXXX.xlsm the rates are changing. Symbols appear in AMIBoker but I am not getting charts.This in most cases occurs due to incorrect date setting. Date format should be dd/mm/yyyy. Either correct date format of your PC in regional settings or open RTG3.format file and change Date_DMY to Date_MDY in $Format line.That file should be in AMIBroker\Format folder7. AmiBroker does not open automatically when I click on Start.Your macros may not be enabled, enable it. When you open RTxxxx.xlsm, excel asks you whether macros should be enabled. Also copy RTxxxx.xlsm in to your Trading program folder and do Trust Center Settings.8. When I click on start RT data, AmiBroker opens up, but blank and no symbols in it. It gives me an error: formula file not found or empty- no chart to display.Copy RTG3.format and Nest3.format file into "formats" folder below AmiBroker.broker.newcharts This file is created by Amibroker in your database folder. File containing references between chart layouts and formula files used. If you delete it you will see "formula file empty or can not be found" in your charts because reference between chart ID and formula is lost. You will NOT however lose your formulas because formulas are separate. You will be able to reinsert them into your charts.9. I got a message from nest trader that "scrip RTD attribute is not licensed"This means you are not allowed take live quotes. Contact your broker and tell him to activate RTD feature for your account. Nothing can be done before that.10. Amibroker does not open correct database. Every time I have to choose data folder where past data is saved !!!!!!!!!!!!!!!This means you have not given correct database path. Open database settings of correct database and give the same path in RTxxxx.xlsm.11. Run time error 76 path not found, when asked to debug, following line is highlightedSet a = fs.CreateTextFile(FileName, True) 'Here we create the file MyCSV.csvYou have to keep cell B2 empty if you have not installed RAM Disk. Otherwise you are bound to get that error. If it is empty, then try to create folder RT on C: drive manually. You can also give some path their to create temporary file.12. Run time error 1004 (If you work in another Excel book while getting Real time Data Feed)This error occurs when you open another spreadsheet from the same instance. Do not open another spreadsheet from same instance or by double-clicking on it.If you want to work in another Excel book while getting Real time Data Feed; Open Excel by clicking Start-Programs-Microsoft Office-Excel2007. Then Click on Office Icon and open another spreadsheet from that instance.13. Run-time error '-2147024770 (8007007e) Automation error. The specified module could not be foundThis error occurs when some DLLs in windows are unregistered. This is solved by registering the DLL module in Windows.Try Windows -> Run command, type: regsvr32 %windir%\system32\scrrun.dll and press Enter.

14. I am getting #N/A in RTNOW/RTNest after doing Link to Excel.

You did not read System Requirements . Please read it fully and follow in toto.

15. I get error saying limit exceeded in RTNow/RTNestThis will invariably happen if you add scrips during runtime. Whenever you add scrips, you will have to close all apps and restart. That is a bug with Nest/NOW.

16. Amibroker hangs while closing/throws exception errorClose Amibroker directly after saving and then close RTNest with/without saving, this sequence is working well without leaving any instance or process of Ami.17. I cannot open any other Excel sheet while RTxxx.xlsm is running. My charts get messed up.Always open Excel in a new instance by clicking on StartPrograms Microsoft Office- Excelxxx. Thereafter you can open your desired worksheet and work in it.18. RTNest/RTNow hangs while closing. I have to close it by Ctrl+Alt+Del and end process. Some times I loose my data in Amibroker.Always close applications in reverse order of opening. That is Amibroker RTNow/RTNest/RTOdin/RTTiger Nest/Now/ZT/Odin/TT. Save Amibroker Database while closing.