GetBid()

View as Markdown

Definition

Returns the bid price value at a selected absolute bar index value.

  • This method does NOT return the current real-time bid price, but rather the historical / real-time bid price at the desired index. For obtaining the current real-time bid price, please use GetCurrentBid().

  • This method returns expected values when 1 tick bid / ask stamped data is used and available from your provider.

Method Return Value

A double value that represents the bidding price at the desired bar index.

Syntax

Bars.GetBid(int index)

Parameters

ParameterDescription
indexThe absolute bar index value used

Examples

1protected override void OnBarUpdate()
2{
3 // If the Highs of the two most recent bars are falling, place a long stop market order
4 // at the Ask price
5 if (Low[0] > Low[1] && Low[1] < Low[2])
6 {
7 EnterShortStopMarket(Bars.GetBid(CurrentBar));
8 }
9}