Accessing last "N" T&S records - for any chart type

Questions about MultiCharts .NET and user contributed studies.
vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Accessing last "N" T&S records - for any chart type

Postby vking » 06 Jan 2014

Hello - Can anyone post a sample code to access the last "N" T&S records for an instrument? Preferably would like to use it on a scanner/chart combination. Main intention is to get access this T&S array - irrespective of the chart type used ( independent of the bar they belong to. Appreciate any input on this.

information needed :
- Time, Price, Volume & Trade type ( ask/bid/below bid/above offer/other)

Thanks in advance.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Accessing last "N" T&S records - for any chart type

Postby Henry MultiСharts » 07 Jan 2014

Hello vking,

If you want to operate with the Time and Sales data then you need to utilize the Volume Profile data collection. Here is how to do that: 4.7.6_Volume_Profile

franky
Posts: 24
Joined: 25 Nov 2012
Has thanked: 4 times
Been thanked: 4 times

Re: Accessing last "N" T&S records - for any chart type

Postby franky » 29 Jan 2014

Hi Henry,
I understand that the volume profile data collection need to be used for getting an accurate time & sales instead of the Bars.UpTicksValue and Bars.DownTickValue but I have problem getting the info timewise. Would it be possible to get a sample code to see in realtime the time & sales ? I think it would help a lot of people.
Thanks a lot.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Accessing last "N" T&S records - for any chart type

Postby Henry MultiСharts » 31 Jan 2014

Hi Henry,
I understand that the volume profile data collection need to be used for getting an accurate time & sales instead of the Bars.UpTicksValue and Bars.DownTickValue but I have problem getting the info timewise. Would it be possible to get a sample code to see in realtime the time & sales ? I think it would help a lot of people.
Thanks a lot.
Attached is a sample indicator that plots the last time & sales value in realtime. You need to have the Volume Profile enabled for the data series the indicator is based on.
Image
Attachments
T&S.png
(54.08 KiB) Downloaded 3324 times
Plot_T&S.wsp
(119.87 KiB) Downloaded 937 times
Test_Plot_T&S.pln
(1.13 KiB) Downloaded 965 times

franky
Posts: 24
Joined: 25 Nov 2012
Has thanked: 4 times
Been thanked: 4 times

Re: Accessing last "N" T&S records - for any chart type

Postby franky » 31 Jan 2014

Volume for any tick is easy to know ... but how to know if it was done on the bid or the ask.... ? Comparing the tick volume with the bid and ask time series gives some problems. It would be nice to get a volume based on the bid/ask like Bars.askticksvalue & Bars.bidticksvalue or bars.volumeside ....

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Accessing last "N" T&S records - for any chart type

Postby Henry MultiСharts » 04 Feb 2014

Volume for any tick is easy to know ... but how to know if it was done on the bid or the ask.... ? Comparing the tick volume with the bid and ask time series gives some problems. It would be nice to get a volume based on the bid/ask like Bars.askticksvalue & Bars.bidticksvalue or bars.volumeside ....
franky, please find attached the code that plots "Price, Volume, Filled at Ask/Bid" values.

Image
Attachments
T&S.png
(29.44 KiB) Downloaded 3286 times
Test_T_and_S_ab_traded.pln
(1.73 KiB) Downloaded 1045 times

ssander
Posts: 1
Joined: 11 May 2016

Re: Accessing last "N" T&S records - for any chart type

Postby ssander » 11 May 2016

Hi Henry,

that is a fine piece of code and nearly what i am currently looking for, if it would also print the current bid/ask depth (would need both regardless of trade direction) on every trade made. I spent two days to implement this myself but failed, maybe you could provide an update?

Something like that would be awesome:
Price(1,769.75) / Volume(9) / FilledAt(Ask) /CurrentBidDepth(435 = lmt-orders on bid) / CurrentAskDepth(50 = lmt-orders on ask)

Thanks a lot for your time in advance.
Stefan


Return to “MultiCharts .NET”