Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts MS

Status
Not open for further replies.

ram2010

Well-Known Member
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

@tracer bullet

zero config with spectacular speed, :clapping:

Is it possible to set the bar period from 1 sec to 500 ms.

thanks,
 

TracerBullet

Well-Known Member
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

@tracer bullet

zero config with spectacular speed, :clapping:

Is it possible to set the bar period from 1 sec to 500 ms.

thanks,
No, the minimum resolution is set as 1 second in the import.
We could try milliseconds ( i didnt check how to do it in AB) but the chart itself will have more dots than bars. We dont get that much data in 1 second
 
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

NestVwapBackfill_0.2 (much more elegant than 0.1) along with DeleteRT

Download from here - http://ubuntuone.com/6K3Id280AxbseUIZZpfpIm

It will create .ini file in same folder
Thanks for coming up with an useful tool yet again.

Meanwhile the column order (column 6, in the terminal) differs for this tool and XLS utility(RTD sheet for NEST). Doesn't it affect data feed using XLS, pls confirm.
Also symbols are not populated on the application, getting blank fields (not sure this is because of no live market). Hope you also enable this tool for backfill historical data (via nest plus).
 

josh1

Well-Known Member
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

Thanks for coming up with an useful tool yet again.

Meanwhile the column order (column 6, in the terminal) differs for this tool and XLS utility(RTD sheet for NEST). Doesn't it affect data feed using XLS, pls confirm.

No It won't.

Also symbols are not populated on the application, getting blank fields (not sure this is because of no live market). Hope you also enable this tool for backfill historical data (via nest plus).
If you have multiple Market watch, keep the first /leftmost open.
 

josh1

Well-Known Member
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

@TracerBullet

1>------ Build started: Project: NestRTD, Configuration: Debug Win32 ------
1> Could Not Find .....\My Documents\Visual Studio 2010\Projects\AmiBrokerFeeder\NestRTD\Debug\*.ini
1> Could Not Find .....\My Documents\Visual Studio 2010\Projects\AmiBrokerFeeder\NestRTD\Debug\*.txt
1> Could Not Find .....\My Documents\Visual Studio 2010\Projects\AmiBrokerFeeder\NestRTD\Debug\*.format
1> Could Not Find .....\My Documents\Visual Studio 2010\Projects\AmiBrokerFeeder\NestRTD\Debug\*.bat
1> worker.cpp
1> stdafx.cpp
1> rtd_client.cpp
1> rtd_callback.cpp
1> main.cpp
1> Generating Code...
1> NestRTD.vcxproj -> C:\Documents and Settings..........\NestRTD\NestRTD.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I think project is setup. Can you give me some lead now?

Edit - Arrays in C++ are quite similar to AmiBroker arrays. (AB was written in C++).
1. You are already creating two arrays. 1. Previous 2. Current
2. In Worker::amibrokerPoller()..... // Shared data access start, you fill the current array with data received from RTD Server.
3. You manipulate the Current array O H L C V and OI vis a vis Previous array. Use only Volume_Today of Previous for Volume calculation and ltt to skip quotes of same time (second).
4. Copy Current Array to Previous.
5. Reset Current
6. Send Current to CSV.
is that correct?

Where hove you defined -- topic_id_to_scrip_field_map.at( topic_id )
 
Last edited:

josh1

Well-Known Member

TracerBullet

Well-Known Member
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

@TracerBullet

I think project is setup. Can you give me some lead now?

Edit - Arrays in C++ are quite similar to AmiBroker arrays. (AB was written in C++).
1. You are already creating two arrays. 1. Previous 2. Current
Yes, it maintains O/H/L/C of each scrip. So its one row per scrip
2. In Worker::amibrokerPoller()..... // Shared data access start, you fill the current array with data received from RTD Server.
Worker::poll() waits for message from callback. When it gets one, we call NEST RTD - RefreshData() - to get changed data and update current/previous.
Worker::amibrokerPoller() asynchronously reads this data ( Using Timer whose frequency we set in ini ) and sends it to amibroker if current is different from previous.
Once done, we copy current to previous and reset current to empty to get new O/H/L/C for future reads

3. You manipulate the Current array O H L C V and OI vis a vis Previous array. Use only Volume_Today of Previous for Volume calculation and ltt to skip quotes of same time (second).
If ltt is same we wait for more data. This is to prevent overwrite of bars.
We use almost all fields in previous actually because we compare the two.
((*_current) == (*_prev)) . Here, == will call Worker::ScripState::eek:perator== ( operator overloading ).

4. Copy Current Array to Previous.
5. Reset Current
6. Send Current to CSV.
is that correct?

Where hove you defined -- topic_id_to_scrip_field_map.at( topic_id
)
yes.
topic_id_to_scrip_field_map is just a map of Topic ids for each field.
In RTD, Each combination of Scrip and field has an integer topic id that we decide and pass to Server. In future, all reference to that field is through this ID.

This is set in constructor - Worker::Worker().
We can also do this every call but i just saved it at start to avoid cpu usage.

RTD RefreshData() gives us topic id and its value. We use the map to resolve topic id into Scrip and Field.
We use field position in current/previous as base multiplier and each field is set based on its position in SCRIP_FIELDS ( In worker.h ).

Ex If we have two Scrips A and B in first and second position, then topics 0 to 3 are reserved for Scrip A and topics 4 to 7 are reserved for B.
If we get topic = 6, then it means Scrip id is 6 / 4 = 1 (= B) and field id is 6 % 4 = 2 ( = SCRIP_FIELDS::VOLUME_TODAY )
Its simple , just put some couts if you have doubt.
See inline.
In Summary,
1) main.cpp is the entry point. It also has a cleanup handler for close.
2) Worker.cpp has the two loops to get data from RTD through callback ( poll()) and to feed AB ( amibrokerPoller() -- diff thread ).
3) settings.cpp loads data from ini.
4) rtd_client.cpp makes COM calls to RTD server. rtd_callback.cpp is registered in RTDClient() constructor to get callback from RTD. callback is used by RTD server to notify when data is available. on recieving callback, we fetch data from RTD Server.
5) amibroker_feed.cpp has the COM calls to AB.

You will have to get familar with c++ , RTD , COM.
If you want to push changes to me, also check out git + github ( git is very nice version management tool - i have just started using it )
Below are some links i used.

1) c++ - There are many books. So far i have only read one - This is freely available as ebook. Its a little outdated maybe as it doesnt cover c++11
http://mindview.net/Books/DownloadSites
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list - Big list of good books
http://www.cplusplus.com/reference/ - nice reference - used it for STL ( STL includes Data structures like vector etc )

2) RTD
http://weblogs.asp.net/kennykerr/archive/2008/10/29/excel-rtd-server-in-c.aspx
http://weblogs.asp.net/kennykerr/archive/2008/11/28/Rtd4.aspx
http://weblogs.asp.net/kennykerr/archive/2008/12/02/Rtd5.aspx
http://weblogs.asp.net/kennykerr/archive/2008/12/17/Rtd8.aspx
http://www.codeproject.com/Articles/245265/Guide-to-Writing-Custom-Functions-in-Excel-Part
http://support.microsoft.com/kb/327215

3) COM - Didnt read much theory. Just syntax stuff. Google if needed. I dont have all links now.
https://www.amibroker.com/guide/objects.html
http://www.codeproject.com/Articles/487118/Windows-Development-in-Cplusplus-COM-API-clients
http://www.codeproject.com/Articles/338268/COM-in-C

4) Git + Git hub
http://lifehacker.com/5983680/how-the-heck-do-i-use-github
http://readwrite.com/2013/09/30/understanding-github-a-journey-for-beginners-part-1
http://git-scm.com/book
 
Last edited:

josh1

Well-Known Member
Re: Free RealTime Data NOW Nest ODIN Trade Tiger Google Yahoo to AmiBroker, Fcharts M

Dear Josh,

Any progress in autobackfill from NOW?

Thanks!
NOWVwapBackfill is ready for testing.

Link is here - https://drive.google.com/file/d/0B76gRVAJlKl3TW5yQXVsYXJvLTA/edit?usp=sharing

In NSENOW , Hourly Statistics window opens easily if a scrip is selected in Mktwatch and Ctrl+Shift+h is pressed. Therefore NOWVwapBackfill is working smoothly.

This Ctrl+Shift+h is not working in Nest/Zerodha Trader on my Laptop. May be because I am working on Virtualbox. Therefore NestVwapBackfill is not working smoothly. It has given me lot of Trouble :annoyed::annoyed::annoyed:. Can users of Nest check and give feedback?

Edit- Deleting previous data will not take time if one is starting fresh at any time during the day. It will take time only in case of disconnects during trading hours due to network/Power outages. No solution for network outage but power outage can be resolved by using a laptop with battery life of 3-4 hours.
 
Last edited:
Status
Not open for further replies.

Similar threads