diff --git a/.gitignore b/.gitignore index 4dda365..68bc17f 100644 --- a/.gitignore +++ b/.gitignore @@ -158,6 +158,3 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ - -# other -protos/**/*.py \ No newline at end of file diff --git a/protos/src/python/athena_pb2.py b/protos/src/python/athena_pb2.py new file mode 100644 index 0000000..c0500ad --- /dev/null +++ b/protos/src/python/athena_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: athena.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import athena_struct_pb2 as athena__struct__pb2 +import candlestick_struct_pb2 as candlestick__struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x61thena.proto\x12\tathena.v1\x1a\x13\x61thena_struct.proto\x1a\x18\x63\x61ndlestick_struct.proto\"b\n\x12GetBacktestRequest\x12(\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x18.athena.v1.Configuration\x12\"\n\x0c\x63\x61ndlesticks\x18\x02 \x03(\x0b\x32\x0c.Candlestick\"\x84\x01\n\x13GetBacktestResponse\x12)\n\nstatistics\x18\x01 \x01(\x0b\x32\x15.athena.v1.Statistics\x12 \n\x06orders\x18\x02 \x03(\x0b\x32\x10.athena.v1.Order\x12 \n\x06trades\x18\x03 \x03(\x0b\x32\x10.athena.v1.Trade2V\n\x06\x41thena\x12L\n\x0bGetBacktest\x12\x1d.athena.v1.GetBacktestRequest\x1a\x1e.athena.v1.GetBacktestResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'athena_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_GETBACKTESTREQUEST']._serialized_start=74 + _globals['_GETBACKTESTREQUEST']._serialized_end=172 + _globals['_GETBACKTESTRESPONSE']._serialized_start=175 + _globals['_GETBACKTESTRESPONSE']._serialized_end=307 + _globals['_ATHENA']._serialized_start=309 + _globals['_ATHENA']._serialized_end=395 +# @@protoc_insertion_point(module_scope) diff --git a/protos/src/python/athena_pb2_grpc.py b/protos/src/python/athena_pb2_grpc.py new file mode 100644 index 0000000..c47976e --- /dev/null +++ b/protos/src/python/athena_pb2_grpc.py @@ -0,0 +1,66 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +import athena_pb2 as athena__pb2 + + +class AthenaStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetBacktest = channel.unary_unary( + '/athena.v1.Athena/GetBacktest', + request_serializer=athena__pb2.GetBacktestRequest.SerializeToString, + response_deserializer=athena__pb2.GetBacktestResponse.FromString, + ) + + +class AthenaServicer(object): + """Missing associated documentation comment in .proto file.""" + + def GetBacktest(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_AthenaServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetBacktest': grpc.unary_unary_rpc_method_handler( + servicer.GetBacktest, + request_deserializer=athena__pb2.GetBacktestRequest.FromString, + response_serializer=athena__pb2.GetBacktestResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'athena.v1.Athena', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Athena(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def GetBacktest(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/athena.v1.Athena/GetBacktest', + athena__pb2.GetBacktestRequest.SerializeToString, + athena__pb2.GetBacktestResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/protos/src/python/athena_struct_pb2.py b/protos/src/python/athena_struct_pb2.py new file mode 100644 index 0000000..352c4a6 --- /dev/null +++ b/protos/src/python/athena_struct_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: athena_struct.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x61thena_struct.proto\x12\tathena.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb1\x01\n\rConfiguration\x12\x12\n\ncommission\x18\x01 \x01(\x01\x12\x0c\n\x04\x63\x61sh\x18\x02 \x01(\x01\x12\x14\n\x0c\x63\x61pital_risk\x18\x03 \x01(\x01\x12\x32\n\x0etrade_on_close\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x34\n\x10\x65xclusive_orders\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x9b\x01\n\x05Order\x12\x0c\n\x04size\x18\x01 \x01(\x01\x12\r\n\x05limit\x18\x02 \x01(\x01\x12\x0c\n\x04stop\x18\x03 \x01(\x01\x12\x11\n\tstop_loss\x18\x04 \x01(\x01\x12\x13\n\x0btake_profit\x18\x05 \x01(\x01\x12\x31\n\ris_contingent\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x0c\n\x04hash\x18\x07 \x01(\t\"\x8f\x01\n\x05Trade\x12\x0c\n\x04size\x18\x01 \x01(\x01\x12\x13\n\x0b\x65ntry_price\x18\x02 \x01(\x01\x12\x12\n\nentry_time\x18\x03 \x01(\x01\x12\x12\n\nexit_price\x18\x04 \x01(\x01\x12\x11\n\texit_time\x18\x05 \x01(\x01\x12\n\n\x02pl\x18\x06 \x01(\x01\x12\x0e\n\x06pl_ptc\x18\x07 \x01(\x01\x12\x0c\n\x04hash\x18\x08 \x01(\t\"\x84\x01\n\nStatistics\x12)\n\x05start\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08n_trades\x18\x03 \x01(\x03\x12\x10\n\x08win_rate\x18\x04 \x01(\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'athena_struct_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_CONFIGURATION']._serialized_start=100 + _globals['_CONFIGURATION']._serialized_end=277 + _globals['_ORDER']._serialized_start=280 + _globals['_ORDER']._serialized_end=435 + _globals['_TRADE']._serialized_start=438 + _globals['_TRADE']._serialized_end=581 + _globals['_STATISTICS']._serialized_start=584 + _globals['_STATISTICS']._serialized_end=716 +# @@protoc_insertion_point(module_scope) diff --git a/protos/src/python/candlestick_struct_pb2.py b/protos/src/python/candlestick_struct_pb2.py new file mode 100644 index 0000000..0d348df --- /dev/null +++ b/protos/src/python/candlestick_struct_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: candlestick_struct.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import enums_struct_pb2 as enums__struct__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x63\x61ndlestick_struct.proto\x1a\x12\x65nums_struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x05Ohlcv\x12\x0c\n\x04open\x18\x01 \x01(\x01\x12\x0c\n\x04high\x18\x02 \x01(\x01\x12\x0b\n\x03low\x18\x03 \x01(\x01\x12\r\n\x05\x63lose\x18\x04 \x01(\x01\x12\x0e\n\x06volume\x18\x05 \x01(\x01\"l\n\x0b\x43\x61ndlestick\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\x05ohlcv\x18\x02 \x01(\x0b\x32\x06.Ohlcv\x12\x17\n\x06signal\x18\x03 \x01(\x0b\x32\x07.Signal\"\xa5\x01\n\x06Signal\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x08position\x18\x02 \x01(\x0e\x32\t.Position\x12\x13\n\x04side\x18\x03 \x01(\x0e\x32\x05.Side\x12\x13\n\x0btake_profit\x18\x04 \x01(\x01\x12\x11\n\tstop_loss\x18\x05 \x01(\x01\x12\x12\n\nconfidence\x18\x06 \x01(\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'candlestick_struct_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_OHLCV']._serialized_start=81 + _globals['_OHLCV']._serialized_end=160 + _globals['_CANDLESTICK']._serialized_start=162 + _globals['_CANDLESTICK']._serialized_end=270 + _globals['_SIGNAL']._serialized_start=273 + _globals['_SIGNAL']._serialized_end=438 +# @@protoc_insertion_point(module_scope) diff --git a/protos/src/python/enums_struct_pb2.py b/protos/src/python/enums_struct_pb2.py new file mode 100644 index 0000000..240c929 --- /dev/null +++ b/protos/src/python/enums_struct_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: enums_struct.proto +# Protobuf Python Version: 4.25.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x65nums_struct.proto*5\n\x08Position\x12\x14\n\x10UNKNOWN_POSITION\x10\x00\x12\x08\n\x04LONG\x10\x01\x12\t\n\x05SHORT\x10\x02*+\n\x04Side\x12\x10\n\x0cUNKNOWN_SIDE\x10\x00\x12\x07\n\x03\x42UY\x10\x01\x12\x08\n\x04SELL\x10\x02\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'enums_struct_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _globals['_POSITION']._serialized_start=22 + _globals['_POSITION']._serialized_end=75 + _globals['_SIDE']._serialized_start=77 + _globals['_SIDE']._serialized_end=120 +# @@protoc_insertion_point(module_scope)