tbapi.api.models.bar_series_info
1from __future__ import annotations 2from typing import TYPE_CHECKING 3from tbapi.common.decorators import tb_class, tb_interface 4from tbapi.common.converters import to_python_datetime, to_net_datetime 5from datetime import datetime 6from Tickblaze.Scripts.Api.Models import BarSeriesInfo as _BarSeriesInfo 7from typing import Any, overload 8from abc import ABC, abstractmethod 9from tbapi.api.bar_series_event import BarSeriesEvent 10from Tickblaze.Scripts.Api import BarSeriesEvent as _BarSeriesEvent 11if TYPE_CHECKING: 12 from tbapi.api.models.bar_period import BarPeriod 13 from tbapi.api.models.symbol_info import SymbolInfo 14 from tbapi.api.bases.bar_type import BarType 15 16@tb_class(_BarSeriesInfo) 17class BarSeriesInfo(): 18 19 @overload 20 @staticmethod 21 def new() -> "BarSeriesInfo": 22 """Constructor overload with arguments: """ 23 ... 24 @staticmethod 25 def new(*args, **kwargs): 26 """Generic factory method for BarSeriesInfo. Use overloads for IDE type hints.""" 27 return BarSeriesInfo(*args, **kwargs) 28 29 @property 30 def is_eth(self) -> bool | None: 31 val = self._value.IsETH 32 return val 33 @is_eth.setter 34 def is_eth(self, val: bool | None): 35 tmp = self._value 36 tmp.IsETH = val 37 self._value = tmp 38 @property 39 def period(self) -> BarPeriod: 40 from tbapi.api.models.bar_period import BarPeriod 41 val = self._value.Period 42 return BarPeriod(_existing=val) 43 @period.setter 44 def period(self, val: BarPeriod): 45 tmp = self._value 46 tmp.Period = val._value 47 self._value = tmp 48 @property 49 def start_time_utc(self) -> datetime | None: 50 val = self._value.StartTimeUtc 51 return to_python_datetime(val) 52 @start_time_utc.setter 53 def start_time_utc(self, val: datetime | None): 54 tmp = self._value 55 tmp.StartTimeUtc = to_net_datetime(val) 56 self._value = tmp 57 @property 58 def end_time_utc(self) -> datetime: 59 val = self._value.EndTimeUtc 60 return to_python_datetime(val) 61 @end_time_utc.setter 62 def end_time_utc(self, val: datetime): 63 tmp = self._value 64 tmp.EndTimeUtc = to_net_datetime(val) 65 self._value = tmp 66 @property 67 def update_event(self) -> BarSeriesEvent: 68 val = int(self._value.UpdateEvent) 69 return BarSeriesEvent(val) 70 @update_event.setter 71 def update_event(self, val: BarSeriesEvent): 72 tmp = self._value 73 tmp.UpdateEvent = _BarSeriesEvent(val.value if hasattr(val, "value") else int(val)) 74 self._value = tmp 75 @property 76 def symbol_info(self) -> SymbolInfo: 77 """The symbol to find. If left null, the script's symbol will be used.""" 78 from tbapi.api.models.symbol_info import SymbolInfo 79 val = self._value.SymbolInfo 80 return SymbolInfo(_existing=val) 81 @symbol_info.setter 82 def symbol_info(self, val: SymbolInfo): 83 tmp = self._value 84 tmp.SymbolInfo = val._value 85 self._value = tmp 86 @property 87 def bar_type(self) -> BarType: 88 from tbapi.api.bases.bar_type import BarType 89 val = self._value.BarType 90 return BarType(_existing=val) 91 @bar_type.setter 92 def bar_type(self, val: BarType): 93 tmp = self._value 94 tmp.BarType = val._value 95 self._value = tmp
@tb_class(_BarSeriesInfo)
class
BarSeriesInfo:
24@tb_class(_BarSeriesInfo) 25class BarSeriesInfo(): 26 27 @overload 28 @staticmethod 29 def new() -> "BarSeriesInfo": 30 """Constructor overload with arguments: """ 31 ... 32 @staticmethod 33 def new(*args, **kwargs): 34 """Generic factory method for BarSeriesInfo. Use overloads for IDE type hints.""" 35 return BarSeriesInfo(*args, **kwargs) 36 37 @property 38 def is_eth(self) -> bool | None: 39 val = self._value.IsETH 40 return val 41 @is_eth.setter 42 def is_eth(self, val: bool | None): 43 tmp = self._value 44 tmp.IsETH = val 45 self._value = tmp 46 @property 47 def period(self) -> BarPeriod: 48 from tbapi.api.models.bar_period import BarPeriod 49 val = self._value.Period 50 return BarPeriod(_existing=val) 51 @period.setter 52 def period(self, val: BarPeriod): 53 tmp = self._value 54 tmp.Period = val._value 55 self._value = tmp 56 @property 57 def start_time_utc(self) -> datetime | None: 58 val = self._value.StartTimeUtc 59 return to_python_datetime(val) 60 @start_time_utc.setter 61 def start_time_utc(self, val: datetime | None): 62 tmp = self._value 63 tmp.StartTimeUtc = to_net_datetime(val) 64 self._value = tmp 65 @property 66 def end_time_utc(self) -> datetime: 67 val = self._value.EndTimeUtc 68 return to_python_datetime(val) 69 @end_time_utc.setter 70 def end_time_utc(self, val: datetime): 71 tmp = self._value 72 tmp.EndTimeUtc = to_net_datetime(val) 73 self._value = tmp 74 @property 75 def update_event(self) -> BarSeriesEvent: 76 val = int(self._value.UpdateEvent) 77 return BarSeriesEvent(val) 78 @update_event.setter 79 def update_event(self, val: BarSeriesEvent): 80 tmp = self._value 81 tmp.UpdateEvent = _BarSeriesEvent(val.value if hasattr(val, "value") else int(val)) 82 self._value = tmp 83 @property 84 def symbol_info(self) -> SymbolInfo: 85 """The symbol to find. If left null, the script's symbol will be used.""" 86 from tbapi.api.models.symbol_info import SymbolInfo 87 val = self._value.SymbolInfo 88 return SymbolInfo(_existing=val) 89 @symbol_info.setter 90 def symbol_info(self, val: SymbolInfo): 91 tmp = self._value 92 tmp.SymbolInfo = val._value 93 self._value = tmp 94 @property 95 def bar_type(self) -> BarType: 96 from tbapi.api.bases.bar_type import BarType 97 val = self._value.BarType 98 return BarType(_existing=val) 99 @bar_type.setter 100 def bar_type(self, val: BarType): 101 tmp = self._value 102 tmp.BarType = val._value 103 self._value = tmp
@staticmethod
def
new(*args, **kwargs):
32 @staticmethod 33 def new(*args, **kwargs): 34 """Generic factory method for BarSeriesInfo. Use overloads for IDE type hints.""" 35 return BarSeriesInfo(*args, **kwargs)
Generic factory method for BarSeriesInfo. Use overloads for IDE type hints.
update_event: tbapi.api.bar_series_event.BarSeriesEvent
symbol_info: tbapi.api.models.symbol_info.SymbolInfo
83 @property 84 def symbol_info(self) -> SymbolInfo: 85 """The symbol to find. If left null, the script's symbol will be used.""" 86 from tbapi.api.models.symbol_info import SymbolInfo 87 val = self._value.SymbolInfo 88 return SymbolInfo(_existing=val)
The symbol to find. If left null, the script's symbol will be used.