From 767e40b59dab07c1676a0b8c1af1dd5896b305c4 Mon Sep 17 00:00:00 2001 From: Keivan Ipchi Hagh Date: Thu, 21 Mar 2024 00:18:59 +0330 Subject: [PATCH] doc: update docs --- Makefile | 3 +++ protos/athena/athena.proto | 8 ++++---- protos/athena/athena_struct.proto | 19 +++++++++++++------ protos/candlestick_struct.proto | 22 ++++++++++++---------- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 5236b8c..5ff19c3 100644 --- a/Makefile +++ b/Makefile @@ -2,3 +2,6 @@ build: bash scripts/clean.sh bash scripts/build.sh + +clean: + bash scripts/clean.sh \ No newline at end of file diff --git a/protos/athena/athena.proto b/protos/athena/athena.proto index 5bfe16d..bf88da8 100644 --- a/protos/athena/athena.proto +++ b/protos/athena/athena.proto @@ -5,15 +5,15 @@ package athena.v1; import "athena/athena_struct.proto"; import "candlestick_struct.proto"; -// [Request] GetBacktestRequest -// config: Broker configurations. -// candlesticks: Candlesticks data. +// GetBacktestRequest message GetBacktestRequest { + // Broker configurations. Config config = 1; + // Candlesticks data. Candlestick candlesticks = 2; } -// [Response] GetBacktestResponse +// GetBacktestResponse message GetBacktestResponse { Statistics statistics = 1; } diff --git a/protos/athena/athena_struct.proto b/protos/athena/athena_struct.proto index 155178d..f4d2f4b 100644 --- a/protos/athena/athena_struct.proto +++ b/protos/athena/athena_struct.proto @@ -1,22 +1,29 @@ syntax = "proto3"; +import "google/protobuf/timestamp.proto"; + package athena.v1; // 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 Config { + // Commission rate charged by the broker for each trade. float commission = 1; + // Initial balance for trading. float cache = 2; + // Capital risk limit imposed by the broker. float capital_risk = 3; + // Indicates whether to trade on open or close. bool trade_on_close = 4; + // Indicates whether the broker accepts exclusive orders. bool exclusive_orders = 5; } // Statistics message Statistics { - int64 id = 1; + // The timestamp for when the backstart is started + google.protobuf.Timestamp start = 1; + // The timestamp for when the backstart is ended + google.protobuf.Timestamp end = 2; + // Number of trades + int64 n_trades = 3; } \ No newline at end of file diff --git a/protos/candlestick_struct.proto b/protos/candlestick_struct.proto index b9f96ef..620b10e 100644 --- a/protos/candlestick_struct.proto +++ b/protos/candlestick_struct.proto @@ -2,24 +2,26 @@ syntax = "proto3"; import "google/protobuf/timestamp.proto"; -// Open, high, Low, Close, and Volume data for a single candlestick. -// open: Candlestick's opening price. -// high: Candlestick's high price. -// low: Candlestick's low price. -// close: Candlestick's closing price. -// volume: Traded volume. +// Ohlcv +// Represents open, high, low, close, and volume. message Ohlcv { + // Candlestick's opening price. float open = 1; + // Candlestick's high price. float high = 2; + // Candlestick's low price. float low = 3; + // Candlestick's closing price. float close = 4; + // Traded volume. float volume = 5; } -// A candlestick containing OHLCV data for a financial instrument at a specific timestamp. -// timestamp: Candlestick's Timestamp. -// ohlcv: Candlestick's open, high, low, close and volume data. -message Candlestick { +// Candlestick +// 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; }