Skip to content

CustomBars

Summary

Represents a mutable collection of OHLC bars that will be used for a custom time frame / symbol.

Signature

1
public abstract interface CustomBars

Namespace

cAlgo.API

See Also

Methods

AppendBar

Summary

Appends a new bar to the end of bars collection.

Remarks

Append will fail with an exception if new bar time is not after last bar time.

Signature

1
public abstract void AppendBar(CustomBar bar)

Parameters

Name Type Description
bar CustomBar New bar

Return Value

void

AppendBars

Summary

Appends a collection of bars to the end of bars collection.

Remarks

Append will fail with an exception if first new bar time is not after last bar time.

Signature

1
public abstract void AppendBars(IEnumerable<CustomBar> bars)

Parameters

Name Type Description
bars IEnumerable New bars

Return Value

void

PrependBar

Summary

Prepends a new bar to the start of bars collection.

Remarks

Prepend will fail with an exception if new bar time is not before first bar time.

Signature

1
public abstract void PrependBar(CustomBar bar)

Parameters

Name Type Description
bar CustomBar New bar

Return Value

void

PrependBars

Summary

Prepends a collection of bars to the start of bars collection.

Remarks

Prepend will fail with an exception if last new bar time is not before first bar time.

Signature

1
public abstract void PrependBars(IEnumerable<CustomBar> bars)

Parameters

Name Type Description
bars IEnumerable New bars

Return Value

void

UpdateLastBar

Summary

Updates the last bar.

Remarks

Update will fail with an exception if collection is empty.

Signature

1
public abstract void UpdateLastBar(double open, double high, double low, double close, long volume)

Parameters

Name Type Description
open double Open price
high double High price
low double Low price
close double Close price
volume long Volume amount

Return Value

void

Properties

Symbol

Summary

Gets symbol of custom bars.

Signature

1
public abstract Symbol Symbol {get;}

Return Value

Symbol

TimeFrame

Summary

Gets timeframe of custom bars.

Signature

1
public abstract TimeFrame TimeFrame {get;}

Return Value

TimeFrame

Bars

Summary

Gets readonly bars.

Signature

1
public abstract Bars Bars {get;}

Return Value

Bars

Related Tutorials

IsLoaded

Summary

Gets IsLoaded status, If true it means custom bars is being used and can't be removed.

Signature

1
public abstract bool IsLoaded {get;}

Return Value

bool

Events

NeedsMore

Summary

Occurs when user scrolls back on a custom bars chart.

Remarks

Use this event to prepend more bars.

Signature

1
public abstract event Action<CustomBarsNeedsMoreEventArgs> NeedsMore;