GetPrice

Returns a specific price type for a bar.

Syntax

GetPrice(priceType: TValueType, shift: number): number

Parameters

  • priceType: TValueType representing the type of price to return

  • shift: A number representing the shift from the current bar

Return Value

Returns a number representing the specified price type for the given bar.

Description

The GetPrice method is a versatile function that returns a specific type of price (Open, High, Low, or Close) for a bar at the specified shift from the current bar. It combines the functionality of individual price methods into a single interface.

See TValueType for available price types:

  • OPEN: Opening price of a bar/candle

  • HIGH: Highest price of a bar/candle

  • LOW: Lowest price of a bar/candle

  • CLOSE: Closing price of a bar/candle

  • VOLUME: Trading volume of a bar/candle

Example

Last updated