Skip to content

Commit

Permalink
feat: add Trade and Order
Browse files Browse the repository at this point in the history
  • Loading branch information
keivanipchihagh committed Mar 20, 2024
1 parent 767e40b commit b623936
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
5 changes: 5 additions & 0 deletions protos/athena/athena.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ message GetBacktestRequest {

// GetBacktestResponse
message GetBacktestResponse {
// Backtest statistics
Statistics statistics = 1;
// Backtest orders' history
repeated Order orders = 2;
// Backtest trades' history
repeated Trade trades = 3;
}

service Athena {
Expand Down
38 changes: 35 additions & 3 deletions protos/athena/athena_struct.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,44 @@ message Config {
bool exclusive_orders = 5;
}

// Order
// Represents a single order data.
message Order {
// Order size (positive for long, negative for short).
float size = 1;
// Limit order price.
float limit = 2;
// Stop order price.
float stop = 3;
// Stop-loss price.
float stop_loss = 4;
// Take-profit price.
float take_profit = 5;
}

// Trade
// Represents a single trade data.
message Trade {
// Size for the assets.
float size = 1;
// The entry price of the trade.
float entry_price = 2;
// The entry time of the trade.
float entry_time = 3;
// The exit price of the trade.
float exit_price = 4;
// The exit time of the trade.
float exit_time = 5;
}

// Statistics
message Statistics {
// The timestamp for when the backstart is started
// The timestamp for when the backstart is started.
google.protobuf.Timestamp start = 1;
// The timestamp for when the backstart is ended
// The timestamp for when the backstart is ended.
google.protobuf.Timestamp end = 2;
// Number of trades
// Number of trades made.
int64 n_trades = 3;
// Win rate ratio.
float win_rate = 4;
}
4 changes: 2 additions & 2 deletions protos/candlestick_struct.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ message Ohlcv {
}

// Candlestick
// Represents a single candlestick bar with timestamp and other properties
// Represents a single candlestick bar with timestamp and other properties.
message Candlestick {
// Candlestick's Timestamp.
google.protobuf.Timestamp timestamp = 1;
// Candlestick's open, high, low, close and volume data.
repeated Ohlcv ohlcv = 2;
repeated Ohlcv ohlcvs = 2;
}

0 comments on commit b623936

Please sign in to comment.