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

Status
Not open for further replies.

TracerBullet

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

Hi TracerBullet,

Do we need to type all script name manually in NestRTD settings file. Whats the procedure to change symbol or add new symbol?

Isn't it possible to automate backfilling process without copy and paste data to Data Table?

Trying to do settings with NOW. Will check it during market hours.

Thanks!
Yes you need to set the scrip names. Its a text file just change symbol when you need. The field names will remain same.

So, If you work with a fixed set of stocks, you only need to set it once.
For future/options you will need to edit every month.

Backfill - i dont know how to do it. There is no such api i think in nest to fetch quotes and anyway it will require some work to figure out what is missing in amibroker.

No. It did not work with NOW. I have extracted IDL for NOW.
Will it work if IDL for Nest is replaced by IDL for NOW and compiled?

BTW. Did you notice that the IDL exposes interface IPlusapi : IDispatch..? It is possible to place/modify/cancel/get status of orders with it.
What error did it give after changing RTDServerProgID to Now.ScripRTD?
IDL compilation will give a header file which has the interface.
We can use it to call COM without having to bother with IDispatch stuff.
If the interface is exactly same, it should have worked.

Yes i saw the ordering api but didnt see it in detail. We might be able to do it.
But testing it will be a problem as we dont have simulator mode.
Ideally i would love to order and modify from AB chart in future.

But right now i want to focus on becoming a trader ( have not started live :) )
I have examples of calling using IDispatch in Amibroker class if you need.

Zero configuration with blazing speed. Thanks a ton.

But still some queries?

I need trading symbol name instead of nifty_f1, since data table contains trading symbol name.
Just set the symbol name in ini. Its sent exactly as it is to AB.
Trading Symbols dont change, so i think its better to just set it once rather than asking NEST for it.
 

TracerBullet

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

@TracerBullet,

// TODO
// 1. Nest RTD Server stops updating (in Excel too) Nifty Index after restarting Feeder few times.
Could not understand this.
// 2. Nest sometimes starts giving 30 max scrip error - Maybe caused by disconnects?
This is from Broker's end. Zerodha increased my limit to 100 scrips.
Even after that, you may get this error. Say, you have 10 scrips in your client and Nest gives max scrip error. That is bug in Nest Trader.
Solution is to close RTD client, delete all market watches, and recreate them. Thereafter start RTD Client

// No import when db changed? - Maybe AB settings
Could not understand this.

VWAP Backfill is not working. It does backfill but reverts to original and AmiBroker closes. Probably, object(Amibroker) is getting released or being taken over by another thread before saving database.
I just make TODO list in main and handle it. These are minor things that i left for now as they are not that imp.

1. I have two scrips - Nifty Fut and Nifty Spot. Many times while debugging and closing app, Nest Server stops updating Nifty Spot. Once this happens excel also does not update (So its server issue). Nifty Future continues to update. Have to restart Nest to fix it.

2. This may have stopped if we dont disconnect Topics. Was not sure so for now i still disconnect topics.

Neither is big problem for me. I only open it once and leave it for the day.

3. I tried to open a not-default db by calling load database. I could not manage to make import work after that. Could be due to db settings.
i didnt put much time to it though as i dont use it. i think it should work if db settings is ok. just need to test.


VWAP Backfill is working for me. Used it many times. It is supposed to save the db before exit. i always use it with the feeder also running. So there should be no problem in mixing them.

1. Do you get any error? Error will be in Errorlog.txt ( or just run command using cmd to keep console alive )

2. I always have AB already open before running any command to avoid close. See if this works. If it does, need to check why it did not save when its not open.

Can you debug it? Install VC++ 2010. Also add atl headers and libs.

To add ATL - copy include and lib folders to .../Microsoft Visual Studio 10.0/VC/atlmfc/
The project should be already setup to pick them up.

https://www.dropbox.com/s/m82apiq7fmcrku8/add_me_to_path.7z
 

ram2010

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

Zero issues.

rt data, backfill everything happening in a flash.

:thumb:
 

josh1

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

Backfill - i dont know how to do it. There is no such api i think in nest to fetch quotes and anyway it will require some work to figure out what is missing in amibroker.
There is no API. I have been doing it in RTNOW. I am developing it in Autoit
currently.
There is one problem though. You have made two separate apps. It would be good to have single app so that instance of the object remains same. If another app takes over running instance of AmiBroker, it loads database from disk and all the data after last "save database" is lost. If we create second instance, then first instance will continue with current feed and second will have backfill.
AmiBroker can import data files into scrip if name of the file is exactly same as that of scrip. If NestRTD is modified to pickup such files from CSV Folder Path and send to AmiBroker, I shall be able to pull data from VWAP and create files there. In that case, backfill will be done in running instance.

What error did it give after changing RTDServerProgID to Now.ScripRTD?
If the interface is exactly same, it should have worked.
Server Status : 1872
NIFTY14MARFUT
Topic Connection failed - nse_fo|NIFTY14MARFUT | LTP
Topic Connection failed - nse_fo|NIFTY14MARFUT | LTT
.................... and so on for all topics.

Yes i saw the ordering api but didnt see it in detail. We might be able to do it.
But testing it will be a problem as we dont have simulator mode.
Ideally i would love to order and modify from AB chart in future.
But right now i want to focus on becoming a trader ( have not started live :) )
:thumb: Keep it for future. Whatever you did in short time is very good.

I have examples of calling using IDispatch in Amibroker class if you need.
:lol: Let me digest this one first.
 

josh1

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

VWAP Backfill is working for me. Used it many times. It is supposed to save the db before exit. i always use it with the feeder also running. So there should be no problem in mixing them.

1. Do you get any error? Error will be in Errorlog.txt ( or just run command using cmd to keep console alive )
There is no error.

2. I always have AB already open before running any command to avoid close. See if this works. If it does, need to check why it did not save when its not open.
Tried that. Backfill happens and reverts.

Can you debug it? Install VC++ 2010. Also add atl headers and libs.

To add ATL - copy include and lib folders to .../Microsoft Visual Studio 10.0/VC/atlmfc/
The project should be already setup to pick them up.
I shall try this
My replies in blue
 

TracerBullet

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

There is one problem though. You have made two separate apps. It would be good to have single app so that instance of the object remains same. If another app takes over running instance of AmiBroker, it loads database from disk and all the data after last "save database" is lost. If we create second instance, then first instance will continue with current feed and second will have backfill.
AmiBroker can import data files into scrip if name of the file is exactly same as that of scrip. If NestRTD is modified to pickup such files from CSV Folder Path and send to AmiBroker, I shall be able to pull data from VWAP and create files there. In that case, backfill will be done in running instance.
Question - Did you set the AB database in settings. I didnt not really test it with that. This must be the root cause as load database happens without saving existing state
I dont have it. So, AB uses the default db for both functions and i dont get any problem.
1. Try without setting DB. Why do you need it anyway ? I just copied your logic, so had option to load db but we dont need it if default is set.
2. Fix should be simply to call save DB before load DB. 2nd Program will have access to same AB window. calling save should save its data and then load wont discard those changes.
So one line code. Ill create a test binary tomorrow. Get you VC++ setup done so you can do it too :)

Server Status : 1872
NIFTY14MARFUT
Topic Connection failed - nse_fo|NIFTY14MARFUT | LTP
Topic Connection failed - nse_fo|NIFTY14MARFUT | LTT
.................... and so on for all topics.
1. So, Server Creation was successful (1872) but topic connection failed
Just to check, is the scrip id and field id correct for NOW. Verify.
2. We can compare the IDLs to check for any difference. Can you upload it.


:lol: Let me digest this one first.
I meant that you can look at Amibroker class when you want. It already has code to call using dispatch.
MS COM stuff is very very annoying api ...

Edit - Autoit - I am not familiar with it , but how will you figure out the start and end time for bars ?
Or will it be to get all data from day start to last entry and RTD feeder will be started only after its done ( which is what i do most of the time )
If its all data, we will need to modify backfill to ignore all data before market hours since index has some garbage before it.
 
Last edited:

josh1

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

Question - Did you set the AB database in settings. I didnt not really test it with that. This must be the root cause as load database happens without saving existing state
I dont have it. So, AB uses the default db for both functions and i dont get any problem.
1. Try without setting DB. Why do you need it anyway ? I just copied your logic, so had option to load db but we dont need it if default is set.
2. Fix should be simply to call save DB before load DB. 2nd Program will have access to same AB window. calling save should save its data and then load wont discard those changes.
So one line code. Ill create a test binary tomorrow. Get you VC++ setup done so you can do it too :)

You have a valid point there. I shall try it but currently, I am struggling to get your backfill working. If your logic above holds, I should be able to backfill with my app made in Autoit concurrently with feeder.
I have setup VC++


1. So, Server Creation was successful (1872) but topic connection failed
Just to check, is the scrip id and field id correct for NOW. Verify.
They are a bit different-
"Trading Symbol" "Last Trade Time" "Last Traded Price" "Volume Traded Today" "Open Interest" "Symbol"


2. We can compare the IDLs to check for any difference. Can you upload it.
Code:
// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: Now.exe

[
  uuid(D2F45C54-F024-4D5B-B048-045D62B68F59),
  version(1.0),
  helpstring("NESTClient 1.0 Type Library"),
  custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 117441067),
  custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1392813166),
  custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, "Created by MIDL version 7.00.0555 at Wed Feb 19 18:02:44 2014
")

]
library NESTClientLib
{
    // TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
    importlib("stdole2.tlb");

    // Forward declare all types defined in this typelib
    interface IScripRTD;
    interface IRTDUpdateEvent;
    interface IPlusapi;

    [
      uuid(A04A3240-D051-4B4C-B004-CA92151F11E5),
      helpstring("ScripRTD Class")
    ]
    coclass ScripRTD {
        [default] interface IScripRTD;
    };

    [
      odl,
      uuid(EC0E6191-DB51-11D3-8F3E-00C04F3651B8),
      helpstring("IScripRTD Interface"),
      dual,
      nonextensible,
      oleautomation
    ]
    interface IScripRTD : IDispatch {
        [id(0x0000000a)]
        HRESULT ServerStart(
                        [in] IRTDUpdateEvent* callback, 
                        [out, retval] long* result);
        [id(0x0000000b)]
        HRESULT ConnectData(
                        [in] long topicId, 
                        [in] SAFEARRAY(VARIANT)* strings, 
                        [in, out] VARIANT_BOOL* newValues, 
                        [out, retval] VARIANT* values);
        [id(0x0000000c)]
        HRESULT RefreshData(
                        [in, out] long* topicCount, 
                        [out, retval] SAFEARRAY(VARIANT)* data);
        [id(0x0000000d)]
        HRESULT DisconnectData([in] long topicId);
        [id(0x0000000e)]
        HRESULT Heartbeat([out, retval] long* result);
        [id(0x0000000f)]
        HRESULT ServerTerminate();
    };

    [
      odl,
      uuid(A43788C1-D91B-11D3-8F39-00C04F3651B8),
      dual,
      oleautomation
    ]
    interface IRTDUpdateEvent : IDispatch {
        [id(0x0000000a)]
        HRESULT UpdateNotify();
        [id(0x0000000b), propget]
        HRESULT HeartbeatInterval([out, retval] long* value);
        [id(0x0000000b), propput]
        HRESULT HeartbeatInterval([in] long value);
        [id(0x0000000c)]
        HRESULT Disconnect();
    };

    [
      uuid(91741D4F-948B-46A0-A2CC-0B925C4F5E17),
      helpstring("Plusapi Class")
    ]
    coclass Plusapi {
        [default] interface IPlusapi;
    };

    [
      odl,
      uuid(5C07F918-033B-4B72-8B6A-F1DB173CE8B1),
      helpstring("IPlusapi Interface"),
      dual,
      nonextensible,
      oleautomation
    ]
    interface IPlusapi : IDispatch {
        [id(0x00000001), helpstring("method PlaceOrder")]
        HRESULT PlaceOrder(
                        [in] BSTR bsTransType, 
                        [in] BSTR bsUniqueRefNo, 
                        [in] BSTR bsExchange, 
                        [in] BSTR bsTradingSymbol, 
                        [in] BSTR bsValidity, 
                        [in] BSTR bsOrderType, 
                        [in] long lQty, 
                        [in] double dPrice, 
                        [in] double dTriggerPrice, 
                        [in] long lDiscQty, 
                        [in] BSTR bsProductType, 
                        [in] BSTR bsClientID);
        [id(0x00000002), helpstring("method ModifyOrder")]
        HRESULT ModifyOrder(
                        [in] BSTR bsOrderRefNo, 
                        [in] BSTR bsValidity, 
                        [in] BSTR bsOrderType, 
                        [in] long lQty, 
                        [in] double dPrice, 
                        [in] double dTriggerPrice, 
                        [in] long lDiscQty);
        [id(0x00000003), helpstring("method CancelOrder")]
        HRESULT CancelOrder([in] BSTR bsOrderRefNum);
        [id(0x00000004), helpstring("method SetObjectName")]
        HRESULT SetObjectName([in] BSTR bsObjectName);
        [id(0x00000005), helpstring("method GetOrderStatus")]
        HRESULT GetOrderStatus(
                        [in] BSTR bsOrderRefNo, 
                        [out] BSTR* bsStatus, 
                        [out] long* lFillQty, 
                        [out] double* dFillPrice);
        [id(0x00000006), helpstring("method GetPlusVersion")]
        HRESULT GetPlusVersion([out] BSTR* bsVersion);
    };
};
I meant that you can look at Amibroker class when you want. It already has code to call using dispatch.
MS COM stuff is very very annoying api ...
Yes... I would like to do it someday in future.

Edit - Autoit - I am not familiar with it , but how will you figure out the start and end time for bars ?
Or will it be to get all data from day start to last entry and RTD feeder will be started only after its done ( which is what i do most of the time )
If its all data, we will need to modify backfill to ignore all data before market hours since index has some garbage before it.
[/QUOTE]
It will be from day start. to last entry. Current data from day start to be deleted immediately before uploading to take care of volume. Let the feeder run concurrently. It is easy with 1 min candles as there are are only 375 per day. With 1 sec candles, it is too slow since AmiBroker iterates thru each quote in quotations array. I did not find any method for bulk deletion of elements in array.
Autoit .. Professional developer like you will be able to learn it over week end. Believe me, it is awesome. You can develop GUI in 1/10 th time of C++
 

TracerBullet

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

1. There is problem when using load db. I tested it now and i see that Backfill does not work. Saving before load will avoid loosing data but Backfill still doesnt work.

I dont fully understand what AB does when it gets multiple calls to loadDatabase() . If i dont call it in Backfill tool it loads fine.

Anyway, i am not sure what the use case is here, i dont need it. I dont want to check it now, so i am removing that option from ABBackfill.
It will load data into currently open window ( if not open it will use the default db)

Remove the DB path and it will work for you too.

2. NOW - so obviously the field id set is incorrect. Please set it in settings.ini and retest. If you copy NEST links in excel and open NOW it should not work either. IDL looks same on first look, so it should work. let me know.

3. I dont want to learn it. i have so many things to do :) and i want to avoid windows specific stuff. i know people love autohotkey and this looks similar.
QT is very good for c++, but anyway i am happy with console app.

Edit - Backfill + loadDatabase does not work even without having NestRTD running. So its not because of multiple objects.
Its a bug for another day. Will check it if we ever need this.

Updated with option removed - https://github.com/SpiffSpaceman/Am...wnload/0.1.1/AmibrokerFeeder_0.1.1_binary.zip
 
Last edited:

gambler

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

Hi TracerBullet,

I tried to use it but following error is coming.. can you look into this? Please guide!

Error Image:-



Setting file



Excel file view








Thanks


1. There is problem when using load db. I tested it now and i see that Backfill does not work. Saving before load will avoid loosing data but Backfill still doesnt work.

I dont fully understand what AB does when it gets multiple calls to loadDatabase() . If i dont call it in Backfill tool it loads fine.

Anyway, i am not sure what the use case is here, i dont need it. I dont want to check it now, so i am removing that option from ABBackfill.
It will load data into currently open window ( if not open it will use the default db)

Remove the DB path and it will work for you too.

2. NOW - so obviously the field id set is incorrect. Please set it in settings.ini and retest. If you copy NEST links in excel and open NOW it should not work either. IDL looks same on first look, so it should work. let me know.

3. I dont want to learn it. i have so many things to do :) and i want to avoid windows specific stuff. i know people love autohotkey and this looks similar.
QT is very good for c++, but anyway i am happy with console app.

Edit - Backfill + loadDatabase does not work even without having NestRTD running. So its not because of multiple objects.
Its a bug for another day. Will check it if we ever need this.

Updated with option removed - https://github.com/SpiffSpaceman/Am...wnload/0.1.1/AmibrokerFeeder_0.1.1_binary.zip
 

TracerBullet

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

It wasnt tested with NOW, maybe it needs code changes to work with it. The interface is same so i thought it might work.
The COM error code seems to state that the input is incorrect.

1. Just for reference, can you copy the link to excel line here. ( ie what you copy in excel for RTD )

2. I dont have any account with NOW so i cant test it.
If someone can provide me a login with RTD i can try to check.
Or you will have to wait untill i try out a broker that has NOW. Code is open - any one can try to fix it.
btw can we have Nest/ZT and NOW both installed together?
 
Status
Not open for further replies.

Similar threads