MarketSeries.TickVolume

Created at 20 Apr 2015, 22:16
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KE

Kevin

Joined 05.12.2013

MarketSeries.TickVolume
20 Apr 2015, 22:16


I'm trying to limit my trading, so I only trade when the TickVolume is below a certain value (yet to be determined, but for sake of example, perhaps 400)

 

Can someone help please as I've spent ages scouring the forum but am struggling to not get errors. Thanks


@Kevin
Replies

lec0456
21 Apr 2015, 08:30

 you just need to check the tick volume in the OnTick or OnBar event.  Its MarketSeries.TickVolume.LastValue;


@lec0456

Lávio_Pareschi
14 Oct 2015, 22:01

Yes, that was I did.

BUT... the last value tick volume in the OnBar() event is 1 or zero!

The same code in the OnTick() event returns the right tick volume.

Just a code like this:

                 d = vpfactor * VPike(nrange); // threshold
                Print("VOL: {0}, Threshold: {1}", MarketSeries.TickVolume.Last(0), d);

Where Vpike() is just a calculation of the tick volume based on previous bars.

VPike returns ok, because I use MarketSeries.TickVolume.Last(i) with i from 1 to nrage. Not zero, the last value for the current bar.

But the VOL {0} in the Print that whould be the last value tick volume from the current bar... returns usually 1 ... and sometimes 0 if this code is in the OnBar() event.

And now, what is wrong on this?

Lavio

 

 

 


@Lávio_Pareschi

Spotware
15 Oct 2015, 00:48

Dear Trader,

The MarketSeries.TickVolume.Last(0) method returns the tick volume on the latest bar.

When the new bar (latest bar) is created the OnBar() method gets triggered.

If you call MarketSeries.TickVolume.Last(0) in the OnBar() method, it will probably return only 0 or 1 because the actual tick volume of the new bar (latest bar) was at that time 0 or 1.

 


@Spotware