Skip to content

Commit

Permalink
feat(indicators): complete calculator worker
Browse files Browse the repository at this point in the history
  • Loading branch information
h-varmazyar committed Jan 26, 2024
1 parent 798aa25 commit 90e2b2d
Show file tree
Hide file tree
Showing 23 changed files with 909 additions and 482 deletions.
284 changes: 136 additions & 148 deletions services/indicators/api/proto/configs.pb.go

Large diffs are not rendered by default.

113 changes: 67 additions & 46 deletions services/indicators/api/proto/indicators.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 14 additions & 23 deletions services/indicators/api/proto/src/configs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,33 @@ package indicatorApi;
option go_package = "github.com/h-varmazyar/Gate/services/indicator/api/proto";
import "services/indicators/api/proto/src/misc.proto";

message RsiConfigs{
// @inject_tag: json:"length"
int32 Length = 1;
}

message IndicatorConfigs {
oneof configs{
RsiConfigs rsi = 1;
StochasticConfigs stochastic = 2;
MovingAverageConfigs moving_average = 3;
SMAConfigs sma = 3;
BollingerBandsConfigs bollinger_bands = 4;
}
}

message RsiConfigs{
int32 period = 1;
}

message StochasticConfigs{
// @inject_tag: json:"length"
int32 Length = 1;
// @inject_tag: json:"smooth_k"
int32 SmoothK = 2;
// @inject_tag: json:"smooth_d"
int32 SmoothD = 3;
int32 period = 1;
int32 smooth_k = 2;
int32 smooth_d = 3;
}

message MovingAverageConfigs{
// @inject_tag: json:"length"
int32 Length = 1;
// @inject_tag: json:"source"
Source Source = 2;
message SMAConfigs{
int32 period = 1;
Source source = 2;
}

message BollingerBandsConfigs{
// @inject_tag: json:"length"
int32 Length = 1;
// @inject_tag: json:"deviation"
int32 Deviation = 2;
// @inject_tag: json:"source"
Source Source = 3;
int32 period = 1;
int32 deviation = 2;
Source source = 3;
}

10 changes: 6 additions & 4 deletions services/indicators/api/proto/src/indicators.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ service indicatorService{

message IndicatorRegisterReq{
Type type = 1;
IndicatorConfigs Configs = 2;
string market_id = 2;
string resolution_id = 3;
IndicatorConfigs configs = 4;
}

message IndicatorValuesReq {
string Id = 1;
uint32 id = 1;
uint32 page = 2;
uint32 page_size = 3;
}

message Indicator {
string Id = 1;
uint32 id = 1;
Type type = 2;
IndicatorConfigs Configs = 3;
IndicatorConfigs configs = 3;
}


Expand Down
13 changes: 9 additions & 4 deletions services/indicators/api/proto/src/values.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ message IndicatorValue{
int64 time = 1;
oneof Value{
BollingerBandsValue BollingerBands = 2;
ExponentialMovingAverageValue MovingAverage = 3;
StochasticValue Stochastic = 4;
RSIValue RSI = 5;
SMAValue SMA = 3;
EMAValue EMA = 4;
StochasticValue Stochastic = 5;
RSIValue RSI = 6;
}
}

Expand All @@ -22,7 +23,11 @@ message BollingerBandsValue {
double MA = 3;
}

message ExponentialMovingAverageValue {
message SMAValue {
double value = 1;
}

message EMAValue {
double simple = 1;
double exponential = 2;
}
Expand Down
Loading

0 comments on commit 90e2b2d

Please sign in to comment.