Show / Hide Table of Contents

Class Bar

Container class holding all fields of a single bar, most notably time stamps and price information. Bar objects are read-only in nature, therefore all values need to be provided during object construction.

Inheritance
object
Bar
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public class Bar

Constructors

| Improve this Doc View Source

Bar(string, DateTime, double, double, double, double, long, bool, double, double, long, long, bool, DateTime, double, bool)

Create and initialize a bar object.

Declaration
public Bar(string ticker, DateTime time, double open, double high, double low, double close, long volume, bool hasOHLC, double bid, double ask, long bidVolume, long askVolume, bool hasBidAsk, DateTime optionExpiry, double optionStrike, bool optionIsPut)
Parameters
Type Name Description
string ticker

ticker, most often same as symbol

System.DateTime time

Initializer for Time field

double open

Initializer for Open field

double high

Initializer for High field

double low

Initializer for Low field

double close

Initializer for Close field

long volume

Initializer for Volume field

bool hasOHLC

Initializer for HasOHLC field

double bid

Initializer for Bid field

double ask

Initializer for Ask field

long bidVolume

Initializer for BidVolume field

long askVolume

Initializer for AskVolume field

bool hasBidAsk

Initializer for HasBidAsk field

System.DateTime optionExpiry

Initializer for OptionExpiry field

double optionStrike

Initializer for OptionStrike field

bool optionIsPut

Initializer for OptionIsPut field

Fields

| Improve this Doc View Source

Ask

Asking price.

Declaration
public readonly double Ask
Field Value
Type Description
double
| Improve this Doc View Source

AskVolume

Ask volume.

Declaration
public readonly long AskVolume
Field Value
Type Description
long
| Improve this Doc View Source

Bid

Bid price.

Declaration
public readonly double Bid
Field Value
Type Description
double
| Improve this Doc View Source

BidVolume

Bid volume.

Declaration
public readonly long BidVolume
Field Value
Type Description
long
| Improve this Doc View Source

Close

Close price.

Declaration
public readonly double Close
Field Value
Type Description
double
| Improve this Doc View Source

HasBidAsk

Flag indicating availability of Bid/ Ask pricing.

Declaration
public readonly bool HasBidAsk
Field Value
Type Description
bool
| Improve this Doc View Source

HasOHLC

Flag indicating availability of Open/ High/ Low/ Close pricing.

Declaration
public readonly bool HasOHLC
Field Value
Type Description
bool
| Improve this Doc View Source

High

High price.

Declaration
public readonly double High
Field Value
Type Description
double
| Improve this Doc View Source

IsOption

Flag indicating validity of option fields.

Declaration
public readonly bool IsOption
Field Value
Type Description
bool
| Improve this Doc View Source

Low

Low price.

Declaration
public readonly double Low
Field Value
Type Description
double
| Improve this Doc View Source

Open

Open price.

Declaration
public readonly double Open
Field Value
Type Description
double
| Improve this Doc View Source

OptionExpiry

Only valid for options: Option expiry date.

Declaration
public readonly DateTime OptionExpiry
Field Value
Type Description
System.DateTime
| Improve this Doc View Source

OptionIsPut

Only valid for options: true for puts, false for calls.

Declaration
public readonly bool OptionIsPut
Field Value
Type Description
bool
| Improve this Doc View Source

OptionStrike

Only valid for options: Option strike price.

Declaration
public readonly double OptionStrike
Field Value
Type Description
double
| Improve this Doc View Source

Symbol

Fully qualified instrument symbol. Examples are AAPL, or XSP080119C00152000.

Declaration
public readonly string Symbol
Field Value
Type Description
string
| Improve this Doc View Source

Time

Time stamp, with date and time

Declaration
public readonly DateTime Time
Field Value
Type Description
System.DateTime
| Improve this Doc View Source

Volume

Trading volume.

Declaration
public readonly long Volume
Field Value
Type Description
long

Methods

| Improve this Doc View Source

NewOHLC(string, DateTime, double, double, double, double, long)

Create new OHLC bar.

Declaration
public static Bar NewOHLC(string ticker, DateTime t, double o, double h, double l, double c, long v)
Parameters
Type Name Description
string ticker
System.DateTime t
double o
double h
double l
double c
long v
Returns
Type Description
Bar
| Improve this Doc View Source

NewValue(string, DateTime, double)

Create new OHLC bar, with the same value copied to the open, high, low, and close fields. This method is typically used by algorithms that act as data sources.

Declaration
public static Bar NewValue(string ticker, DateTime t, double v)
Parameters
Type Name Description
string ticker

ticker symbol

System.DateTime t

time stamp

double v

value

Returns
Type Description
Bar

OHLC bar

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2011-2023, Bertram Enterprises LLC dba TuringTrader.com