Skip to content

Commit

Permalink
feat: update protos
Browse files Browse the repository at this point in the history
  • Loading branch information
keivanipchihagh committed Mar 19, 2024
1 parent b5774af commit 87a9659
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
20 changes: 10 additions & 10 deletions protos/athena/athena.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ package athena.v1;
import "athena/athena_struct.proto";
import "candlestick_struct.proto";

// [Request] RequestBacktest
// broker: Broker properties.
// historicals: Historical data.
message RequestBacktest {
Broker broker = 1;
Historical historicals = 2;
// [Request] GetBacktestRequest
// config: Broker configurations.
// candlesticks: Candlesticks data.
message GetBacktestRequest {
Config config = 1;
Candlestick candlesticks = 2;
}

// [Response] ResponseBacktest
message ResponseBacktest {
int64 id = 1;
// [Response] GetBacktestResponse
message GetBacktestResponse {
Statistics statistics = 1;
}

service Athena {
rpc Backtest (RequestBacktest) returns (ResponseBacktest);
rpc GetBacktest (GetBacktestRequest) returns (GetBacktestResponse);
}
9 changes: 7 additions & 2 deletions protos/athena/athena_struct.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ syntax = "proto3";

package athena.v1;

// Broker configuration.
// Config
// commission: Commission rate charged by the broker for each trade.
// cache: Initial balance for trading.
// capital_risk: Capital risk limit imposed by the broker.
// trade_on_close: Indicates whether to trade on open or close.
// exclusive_orders: Indicates whether the broker accepts exclusive orders.
message Broker {
message Config {
float commission = 1;
float cache = 2;
float capital_risk = 3;
bool trade_on_close = 4;
bool exclusive_orders = 5;
}

// Statistics
message Statistics {
int64 id = 1;
}
8 changes: 1 addition & 7 deletions protos/candlestick_struct.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,5 @@ message Ohlcv {
// ohlcv: Candlestick's open, high, low, close and volume data.
message Candlestick {
google.protobuf.Timestamp timestamp = 1;
Ohlcv ohlcv = 2;
}

// Historical candlesticks data
// candlestick: Array of candlesticks
message Historical {
repeated Candlestick candlestick = 1;
repeated Ohlcv ohlcv = 2;
}
Empty file modified scripts/build.sh
100644 → 100755
Empty file.
Empty file modified scripts/clean.sh
100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions scripts/rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

./scripts/clean.sh
echo "Clean complete."

./scripts/build.sh
echo "Build complete."

0 comments on commit 87a9659

Please sign in to comment.