Skip to main content
Version: 1.0.0

Accessing OHCL Data

Your strategy can access various data through the "data" argument provided to your handle_new_bar method.

Bar Data

You can get the current and previous bar. Bars have a few properties.

def handle_new_bar(data, emit, blocks):
data.bar # current bar
data.last_bar # previous bar

Base data

PropertyTypeNotes
closefloat
openfloat
highfloat
lowfloat
vwapfloat
volumeint
tickerstring
datedatetime.datetime
is_greenboolean
is_redboolean
is_dojiboolean
midfloatthe halfway point between open and close
is_tradablebooleandid the bar occur during tradable premarket, normal hours, or tradable postmarket

Methods

Method nameReturn TypeDescription
inner_rangefloatthe percentage move for this bar from open to close