GBDecisionMachine

Description

Manages GreedyBoy decisions history, it creates, stores and retrieves data about them.

Decisions Table representation

Date

Price

Amount

Order

1619222453.181015

0.523

13000

buy

1619226521.475621

0.553

13000

sell

Decisions CSV representation

Date,Price,Amount,Order
1619222453.181015,0.523,13000,B
1619226521.475621,0.553,13000,S

Code

class GBDecisionMachine. GBDecisionMachine ( data : pandas.core.generic.NDFrame )
append ( epochTime : float , price : float , amount : float , order : str )

Appends new (epochTime, price) into the Dataframes.

Parameters
  • epochTime ( float ) – timestamp of the price

  • price ( float ) – price

convertForGraphicViews ( )

Convert data and format it for GraphViewer .

Returns

(DataFrame containing decision data)

Return type

(pandas.DataFrame)

classmethod fromDataframe ( data : pandas.core.generic.NDFrame )

Constructor starting from a filename.

Parameters
  • data ( gen.NDFrame ) – Structure containing prices and dates.

  • interval ( int ) – Time gap between each price (in min).

  • movingAverageSize ( int ) – Number of data taken into account to calculate a moving average.

classmethod fromFilename ( fileName : str )

Constructor starting from a filename.

Parameters
  • fileName ( str ) – Name of the file containing the data.

  • interval ( int ) – Time gap between each price (in min).

  • movingAverageSize ( int ) – Number of data taken into account to calculate a moving average.