README
¶
GoCryptoTrader Backtester: Kline package

This kline package is part of the GoCryptoTrader codebase.
This is still in active development
You can track ideas, planned features and what's in progress on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.
Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack
Kline package overview
When loading data for the kline, it can come from two sources: candles or trades. In the config they are represented as common.CandleStr
or common.TradeStr
respectively.
Candle data represents the opening, closing, highest, lowest prices of a given timespan (interval) along with the volume (amount traded) during that same period. You can read more about candles here. This data is utilised throughout the GoCryptoTrader Backtester in order to make informed strategic decisions.
Trade data represents the raw trading data on an exchange. Every buy or sell action for the given currency. When trading data is used for the GoCryptoTrader Backtester, it is converted into candle data at the interval you specify. This allows for custom candle intervals not provided by an exchange's API and thus has a greater amount of flexibility in backtesting strategies.
Please click GoDocs chevron above to view current GoDoc information for this package
Contribution
Please feel free to submit any pull requests or suggest any desired features to be added.
When submitting a PR, please abide by our coding guidelines:
- Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
- Code must be documented adhering to the official Go commentary guidelines.
- Code must adhere to our coding style.
- Pull requests need to be based on and opened against the
master
branch.
Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc
Documentation
¶
Index ¶
- type DataFromKline
- func (d *DataFromKline) AppendResults(ki *gctkline.Item)
- func (d *DataFromKline) HasDataAtTime(t time.Time) bool
- func (d *DataFromKline) Load() error
- func (d *DataFromKline) StreamClose() []decimal.Decimal
- func (d *DataFromKline) StreamHigh() []decimal.Decimal
- func (d *DataFromKline) StreamLow() []decimal.Decimal
- func (d *DataFromKline) StreamOpen() []decimal.Decimal
- func (d *DataFromKline) StreamVol() []decimal.Decimal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataFromKline ¶
type DataFromKline struct { data.Base Item gctkline.Item RangeHolder *gctkline.IntervalRangeHolder // contains filtered or unexported fields }
DataFromKline is a struct which implements the data.Streamer interface It holds candle data for a specified range with helper functions
func (*DataFromKline) AppendResults ¶
func (d *DataFromKline) AppendResults(ki *gctkline.Item)
AppendResults adds a candle item to the data stream and sorts it to ensure it is all in order
func (*DataFromKline) HasDataAtTime ¶
func (d *DataFromKline) HasDataAtTime(t time.Time) bool
HasDataAtTime verifies checks the underlying range data To determine whether there is any candle data present at the time provided
func (*DataFromKline) Load ¶
func (d *DataFromKline) Load() error
Load sets the candle data to the stream for processing
func (*DataFromKline) StreamClose ¶
func (d *DataFromKline) StreamClose() []decimal.Decimal
StreamClose returns all Close prices from the beginning until the current iteration
func (*DataFromKline) StreamHigh ¶
func (d *DataFromKline) StreamHigh() []decimal.Decimal
StreamHigh returns all High prices from the beginning until the current iteration
func (*DataFromKline) StreamLow ¶
func (d *DataFromKline) StreamLow() []decimal.Decimal
StreamLow returns all Low prices from the beginning until the current iteration
func (*DataFromKline) StreamOpen ¶
func (d *DataFromKline) StreamOpen() []decimal.Decimal
StreamOpen returns all Open prices from the beginning until the current iteration
func (*DataFromKline) StreamVol ¶
func (d *DataFromKline) StreamVol() []decimal.Decimal
StreamVol returns all Volume prices from the beginning until the current iteration