GetCurrentBidVolume()

View as Markdown

Definition

Returns the current real-time bid volume.

  1. When accessed during State.Historical, the Volume of the evaluated bar series is substituted. To access historical Bid Volumes, please see Developing for Tick Replay.
  2. The GetCurrentBidVolume() 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.

MethoReturn Value

A long value representing the current bid volume.

Syntax

GetCurrentBidVolume()

GetCurrentBidVolume(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 currentBidVolume = GetCurrentBidVolume();
4 Print("The Current Bid volume is: " + currentBidVolume);
5 //The Current Bid volume is: 158
6}
1protected override void OnStateChange()
2{
3 if (State == State.SetDefaults)
4 {
5 Name = "Examples Indicator";
6 }
7 if (State == State.Configure)
8 {
9 //Add MSFT as our additional data series
10 AddDataSeries("MSFT", BarsPeriodType.Minute, 1);
11 }
12}
1protected override void OnBarUpdate()
2{
3 if(BarsInProgress == 0)
4 {
5 long currentBidVolume = GetCurrentBidVolume(0);
6 Print("The Current Bid volume is: " + currentBidVolume);
7 //The Current Bid volume is: 346
8 }
9
10 if(BarsInProgress == 1)
11
12 {
13
14 long msftBidVolume = GetCurrentBidVolume(1);
15
16 Print("MSFT's Current Bid volume is: " + msftBidVolume);
17
18 //MSFT's Current Bid volume is: 1548
19
20 }