Trading Volume of last hour

Created at 25 Sep 2023, 10:29
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!
YS

ys2310

Joined 03.12.2021

Trading Volume of last hour
25 Sep 2023, 10:29


I'm trying to get the total trading volume of last hour using the following code

MarketData.GetBars(TimeFrame.Hour, Symbol.Name).TickVolumes.LastValue

But, for some reason, this code always returns “2”. 

What's wrong in this case and how correctly I can access to the trading volume?

 


@ys2310
Replies

PanagiotisChar
26 Sep 2023, 05:21

Hi there,

Try Last(1) instead of LastValue.

 


@PanagiotisChar