GetCurrentAskVolume()

View as Markdown

Definition

Returns the current real-time ask volume.

  1. When accessed during State.Historical, the Volume of the evaluated bar series is substituted. To access historical Ask Volumes, please see Developing for Tick Replay.
  2. The GetCurrentAskVolume() method runs on the bar series currently updating determined by the BarsInProgress property. For multi-instrument scripts, an additional int “barsSeriesIndex” parameter can be supplied which forces the method to run on a supplementary bar series.

Method Return Value

A long value representing the current ask volume.

Syntax

GetCurrentAskVolume()

GetCurrentAskVolume(int barsSeriesIndex)

Parameters

ParameterDescription
barsSeriesIndexAn int value determining the bar series the method runs. Note: This optional parameter is reserved for multi-instrument scripts

Examples

1protected override void OnBarUpdate()
2{
3 long currentAskVolume = GetCurrentAskVolume();
4 Print("The Current Ask volume is: " + currentAskVolume);
5 //The Current Ask volume is: 158
6}
7
8protected override void OnStateChange()
9{
10 if (State == State.SetDefaults)
11 {
12 Name = "Examples Indicator";
13 }
14 if (State == State.Configure)
15 {
16 //Add MSFT as our additional data series
17 AddDataSeries("MSFT", BarsPeriodType.Minute, 1);
18 }
19}
20protected override void OnBarUpdate()
21{
22 if(BarsInProgress == 0)
23 {
24 long currentAskVolume = GetCurrentAskVolume(0);
25 Print("The Current Ask volume is: " + currentAskVolume);
26 //The Current Ask volume is: 346
27 }
28
29 if(BarsInProgress == 1)
30
31 {
32
33 long msftAskVolume = GetCurrentAskVolume(1);
34
35 Print("MSFT's Current Ask volume is: " + msftAskVolume);
36
37 //MSFT's Current Ask volume is: 1548
38
39 }