Any C++ programmers willing to help modify RTDMan?

josh1

Well-Known Member
#31
Good, i did Versioning with git ( which keeps track of code changes in files).
Git is cool and also has GUI, it may have VS plugins but i didnt use them as it has simple command interface for basic usage. It can be used to track versions of any project.

Visual studio project folder does not need to change - i keep it in AmibrokerFeeder\RTDMan.

git helps when multiple people work together on common code, although i have not used it as such as we had different stuff in my old workplace.
If you dont want to deal with git, you can simply copy the output and rename folder. But if there is any plan for more stuff, esp with multiple people, maybe learn it when free ( esp will need to learn how branches work - i am not familiar either).

btw i did some minor changes too + added option to ring bell when rtd becomes inactive - ZT stops it many times these days.
Well, you have removed your project from Git and I am too tired to learn it right now. I shall upload it tomorrow in my link google drive as RTDMan_1.0. I have made invasive changes in worker.cpp and worker.h and small change in settings. Rest of it is same. However, code has reduced.

I am yet to solve the issue of the tick of 15:29 that we get in the morning from RTD Server. VC++10 has removed the function 'strptime' from ctime.h. It is a headache to convert string from '%H:%M:%S' to time format. Apparantly, RTD server is sending time in bstr format only.

I don't have plan for multiple people. (in last one year, only rmike has worked on it besides you and me.)
 

TracerBullet

Well-Known Member
#32
Well, you have removed your project from Git and I am too tired to learn it right now. I shall upload it tomorrow in my link google drive as RTDMan_1.0. I have made invasive changes in worker.cpp and worker.h and small change in settings. Rest of it is same. However, code has reduced.

I don't have plan for multiple people. (in last one year, only rmike has worked on it besides you and me.)
github and git are different. github is just an online place for git repos but you dont need it. I have already uploaded git data ( .git stuff) and anyone can continue. Without git ( or other version management tool), collaborating will be tedious, but yes we dont need it now.

I am happy with current code state so will probably only do minor changes that i need and keep it stable. You can takeover and maintain versions as you wish. If you want, ill upload whatever minor stuff i may do and merge it.
My Future plan is basically to stop using and probably move on to icharts or similar.

Note - There is a possible bug (although it could be Nest too)- volume pushed to AB is sometimes negative ( very rare ). I need to put some debug statements to check why it happens - but i dont see volume much so didnt bother and volume is still close enough even when it happens.

I am yet to solve the issue of the tick of 15:29 that we get in the morning from RTD Server. VC++10 has removed the function 'strptime' from ctime.h. It is a headache to convert string from '%H:%M:%S' to time format. Apparantly, RTD server is sending time in bstr format only.
i dont get this problem, never get yesterdays quote after small fix - Now we only push ticks after Nest notifies of update and never on its own.
I do start rtd after 09:00.

strptime seems non-standard. Look at this. You can look at ctime reference instead.

You can simply extract the time components from the string yourself as we know the format. I have already handled the BSTR stuff so in worker.cpp you should not have to mess with it. It should be std:string in the bar object. Or use Util::getString() that takes BSTR from Variant. Later, You can use Util::splitString() helper.
 

TracerBullet

Well-Known Member
#33
RTDMan with small changes + Notification Bell when inactive. So far working ok for a week.
Exe here with sample audio file taken from another source - replace with any wav file.
Source here. Does not have wav file - will need to put something freely available or let user add their own.

The bell code is two simple functions in worker. I had also renamed some files to more saner names before but didnt publish. Since ABBackFill shares the some files, the rename also needed changes in ABBackFill.vcxproj.
 

mastermind007

Well-Known Member
#34
Well, you have removed your project from Git and I am too tired to learn it right now. I shall upload it tomorrow in my link google drive as RTDMan_1.0. I have made invasive changes in worker.cpp and worker.h and small change in settings. Rest of it is same. However, code has reduced.

I am yet to solve the issue of the tick of 15:29 that we get in the morning from RTD Server. VC++10 has removed the function 'strptime' from ctime.h. It is a headache to convert string from '%H:%M:%S' to time format. Apparantly, RTD server is sending time in bstr format only.

I don't have plan for multiple people. (in last one year, only rmike has worked on it besides you and me.)
josh1,

As far as I've understood, IMHO, The 15:29 price that you receive neither an error nor an oversight at exchange end.

See this thread http://www.traderji.com/equities/6761-confused-todays-close-ltp.html

Firstly, it provides you with a confirmation that you are connected to feed server and it is sort of acknowledgement that your connection was secured correctly.

Secondly, In most scrips, it usually contains the Adjusted values of Open High Low and Close of the earlier trading session

If you can save that record, you can have more accurate drawing of daily (or higher) charts made off minute or tick data.
 

josh1

Well-Known Member
#35
@mastermind007

As far as I've understood, IMHO, The 15:29 price that you receive neither an error nor an oversight at exchange end.


It is not an error but it is implicit nature of RTD Server that whenever connected, it sends data which is already there. Whichever scrips have Last Traded Price stored there, it is pushed to the RTD Client. Problem occurs because RTDServer does not give date so it is treated as close of current day. Amibroker charts go for a toss. I have to delete that quote whenever it occurs.

Secondly, In most scrips, it usually contains the Adjusted values of Open High Low and Close of the earlier trading session


Yes it is be adjusted value of close for average of last half an hours' trading price.

If you can save that record, you can have more accurate drawing of daily (or higher) charts made off minute or tick data.

This price is readily available in Bhavcopy. I have separate application which downloads daily bhavcopy and uploads in Amibroker.

Anyway, I have uploaded the code as RTDMan_1.0.zip. The code is reduced and become much simpler. I have also given lot of explanation in comments.
I ran the application from 11:30 to 15:30 today. Backfilled data from 9:15 to 11:29:59. This was the result at 15:30. (Compare volumes for the day)

Graphs are compressed for daily. Actual bars are for 1 min.

@tracerbullet,
I was not able to combine Bell notification when server is idle. VC++ complained too much. You have also changed names of many source files.

Now I need code for the following-
Data from RTD server comes as Bstr in the format "%H:%M:%S". There is no date. I am able to remove the colons. I want to ignore quote if current time is less than say 093000 and current bar LTT is greater than 151500. May be converting to integer will be easier than converting it to time.

Edit- Okay a dirty workaround is to remove all characters after %H. Ignore quote if LTT is "15" and current time is "9".
 
Last edited:

TracerBullet

Well-Known Member
#36
@tracerbullet,
I was not able to combine Bell notification when server is idle. VC++ complained too much. You have also changed names of many source files.

Now I need code for the following-
Data from RTD server comes as Bstr in the format "%H:%M:%S". There is no date. I am able to remove the colons. I want to ignore quote if current time is less than say 093000 and current bar LTT is greater than 151500. May be converting to integer will be easier than converting it to time.

Edit- Okay a dirty workaround is to remove all characters after %H. Ignore quote if LTT is "15" and current time is "9".
1) Without a version management tool, merging is painful. You can use a comparison tool like winmerge or beyond compare to compare folders and files within them. Dont compare manually.
Only the util and AB file name was changed i think - Its not necessary. There is a project file change needed that i mentioned before + some includes and class reference will change. I changed them as original names are a bit odd.

For Bell code, if you want to merge, i think you only need to merge some worker.cpp stuff ( 2 functions + its defn in header + called from 2 places )

2) yes, that should do. btw, String to int if needed - stoi() maybe. I dont get this problem with Nifty Future though.
 

josh1

Well-Known Member
#37
1)For Bell code, if you want to merge, i think you only need to merge some worker.cpp stuff ( 2 functions + its defn in header + called from 2 places )

2) yes, that should do. btw, String to int if needed - stoi() maybe. I dont get this problem with Nifty Future though.
1) Last error. Rest is solved.
worker.obj : error LNK2001: unresolved external symbol __imp__PlaySoundW@12
C:\RTDMan_0.1.4_2\Source\AmibrokerFeeder\Release\RTDMan\RTDMan.exe : fatal error LNK1120: 1 unresolved externals

Code:
/**
2)Did not opt for stoi(). below code is working
[CODE]	cur_tm			 = MiscUtil::getTime("%H"); //

std::string bar_ltt = newdata.ltt.substr(0,2);			//get time hour from newdata.ltt
if(cur_tm == "09" && bar_ltt == "15"){				// Compare with current hour. If yesterdays's tick in the morning,
	newdata.reset();								//skip
	continue;
}
 
Last edited:

TracerBullet

Well-Known Member
#38
1) Last error. Rest is solved.
worker.obj : error LNK2001: unresolved external symbol __imp__PlaySoundW@12
C:\RTDMan_0.1.4_2\Source\AmibrokerFeeder\Release\RTDMan\RTDMan.exe : fatal error LNK1120: 1 unresolved externals
Thats linker error - merge RTDMan.vcxproj that will link with winmm.lib.
Or you can just add it yourself in project properties - Linker > Input > Additional Dependencies ( Edit and add winmm.lib ). Make sure to do it for All configurations ( In Configuration Dropdown above )
 

josh1

Well-Known Member
#39
Thats linker error - merge RTDMan.vcxproj that will link with winmm.lib.
Or you can just add it yourself in project properties - Linker > Input > Additional Dependencies ( Edit and add winmm.lib ). Make sure to do it for All configurations ( In Configuration Dropdown above )
Huh...... That solved it..! :):cool:

I did not change any file names though. Too tired for that.
 
Last edited:

Similar threads