Page 1 of 1

Calculating Turnover from Tick Data

Posted: Jan 04 2015
by avme
Hi all,

I want to use esignal real time tick data to reconstruct the turnover in Market Scanner.
I can show date, time, Last and tradevolume separately in Market Scanner. So the reception is working in real time. But when I try to show this:

Code: Select all

Var: Turnover(0);
Turnover = Last * Tradevolume;
Market Scanner shows "Not verified".

I googled for "multicharts turnover" and it showed very few results.
Is turnover calculation not possible in Multicharts?

Re: Calculating Turnover from Tick Data

Posted: Jan 05 2015
by JoshM

Code: Select all

Var: Turnover(0);
Turnover = Last * Tradevolume;
Market Scanner shows "Not verified".
Such a message is separate from being able to calculate turnover from tick data. Instead, it suggests something in your script is off. Did compiling the indicator went okay?

Is this code your complete indicator? If so, a `Plot` is needed to display data in the Market Scanner. Like so:

Code: Select all

Var: Turnover(0);

Turnover = Last * Tradevolume;
Plot1(Turnover, "Turnover");

Re: Calculating Turnover from Tick Data

Posted: Jan 05 2015
by avme
Hi Josh,

I did have the plot syntax as you suggested. But I have a mistake in the code provided. My previous code is for the trade size (i.e. last * tradevolume) which can be calculated and shown correctly. But when I try to cumulate the trade size for turnover. The "not verified" error occurred in Market Scanner. The right code should be:

Code: Select all

Var: Turnover(0);
Turnover = Turnover + Last * Tradevolume;
Plot1(Turnover, "Turnover");
Welcome to any comments and suggestions.

Re: Calculating Turnover from Tick Data

Posted: Jan 05 2015
by JoshM
I cannot replicate that error on MultiCharts64 Version 9.0 Release (Build 10014); your code runs fine here.

If I adjust your code to see if the indicator receives the correct data (by comparing it to the other Market Scanner columns), it seems to work correctly:

Image

Code: Select all

Variables:
IntraBarPersist Turnover(0);

if (LastBarOnChart_s) then
Turnover = Turnover + (Last * Tradevolume);

Plot1(Last, "Last");
Plot2(TradeVolume, "Size");
Plot3(Turnover, "Turnover");

Re: Calculating Turnover from Tick Data

Posted: Jan 05 2015
by avme
Strange enough. I cannot replicate the error myself....Thanks Josh. Really appreciate your help.

I have got a follow-up.
What I learnt is that all real time data are stored in the cache. So it is not possible to look back the data until it is stored in the QuoteManager. So if I start multicharts one hour after the market opens, how can I force MC to calculate the previous one hour turnover so that I can get the latest turnover of the day?

Thanks

Re: Calculating Turnover from Tick Data

Posted: Jan 05 2015
by JoshM
What I learnt is that all real time data are stored in the cache. So it is not possible to look back the data until it is stored in the QuoteManager. So if I start multicharts one hour after the market opens, how can I force MC to calculate the previous one hour turnover so that I can get the latest turnover of the day?
You can't, because Last and TradeVolume are quote fields (meaning, they are only available with real-time data).

If you set the data series in the Market Scanner to 1 tick, you can however calculate it on historical data. Then you could use Close for the closing price (instead of Last) and Ticks for the volume accompanying that tick (instead of TradeVolume).

Of course, this will also work on other historical time frames (like 30 seconds), but then it's less accurate since there is no keyword for the average price of a bar.

Re: Calculating Turnover from Tick Data  [SOLVED]

Posted: Jan 05 2015
by avme
Your answer gives me a good start. Thanks again Josh.