Skip to content

Commit

Permalink
feat: convert floats to decimals to increase accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
keivanipchihagh committed Mar 22, 2024
1 parent 2b458e4 commit 454b34e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
32 changes: 16 additions & 16 deletions protos/athena/athena_struct.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ package athena.v1;
// Represents the configurations for the backtest.
message Configuration {
// Commission rate charged by the broker for each trade.
float commission = 1;
double commission = 1;
// Initial balance for trading.
float cash = 2;
double cash = 2;
// Capital risk limit imposed by the broker.
float capital_risk = 3;
double capital_risk = 3;
// Indicates whether to trade on open or close.
google.protobuf.BoolValue trade_on_close = 4;
// Indicates whether the broker accepts exclusive orders.
Expand All @@ -24,15 +24,15 @@ message Configuration {
// Represents a single order data.
message Order {
// Order size (positive for long, negative for short).
float size = 1;
double size = 1;
// Limit order price.
float limit = 2;
double limit = 2;
// Stop order price.
float stop = 3;
double stop = 3;
// Stop-loss price.
float stop_loss = 4;
double stop_loss = 4;
// Take-profit price.
float take_profit = 5;
double take_profit = 5;
// Is order contingent.
google.protobuf.BoolValue is_contingent = 6;
// Hash.
Expand All @@ -43,19 +43,19 @@ message Order {
// Represents a single trade data.
message Trade {
// Size for the assets.
float size = 1;
double size = 1;
// The entry price of the trade.
float entry_price = 2;
double entry_price = 2;
// The entry time of the trade.
float entry_time = 3;
double entry_time = 3;
// The exit price of the trade.
float exit_price = 4;
double exit_price = 4;
// The exit time of the trade.
float exit_time = 5;
double exit_time = 5;
// Profit/loss in units.
float pl = 6;
double pl = 6;
// Profit/loss in percentage.
float pl_ptc = 7;
double pl_ptc = 7;
// Hash.
string hash = 8;
}
Expand All @@ -69,5 +69,5 @@ message Statistics {
// Number of trades made.
int64 n_trades = 3;
// Win rate ratio.
float win_rate = 4;
double win_rate = 4;
}
16 changes: 8 additions & 8 deletions protos/candlestick_struct.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import "google/protobuf/timestamp.proto";
// Represents open, high, low, close, and volume.
message Ohlcv {
// Candlestick's opening price.
float open = 1;
double open = 1;
// Candlestick's high price.
float high = 2;
double high = 2;
// Candlestick's low price.
float low = 3;
double low = 3;
// Candlestick's closing price.
float close = 4;
double close = 4;
// Traded volume.
float volume = 5;
double volume = 5;
}

// [message] Candlestick
Expand All @@ -39,9 +39,9 @@ message Signal {
// Side: Buy or sell
Side side = 4;
// Take-profit price
float take_profit = 5;
double take_profit = 5;
// Stop-loss price
float stop_loss = 6;
double stop_loss = 6;
// Confidence percentage [0-1]
float confidence = 7;
double confidence = 7;
}

0 comments on commit 454b34e

Please sign in to comment.