tbapi.api.bases.iindicator
1from __future__ import annotations 2from typing import TYPE_CHECKING 3from tbapi.common.decorators import tb_interface 4from tbapi.common.converters import to_python_datetime, to_net_datetime 5from datetime import datetime 6from Tickblaze.Scripts.Api.Bases import IIndicator as _IIndicator 7from typing import Any, overload 8from abc import ABC, abstractmethod 9from tbapi.api.interfaces.iscript import IScript 10if TYPE_CHECKING: 11 from tbapi.api.series import Series 12 13@tb_interface(_IIndicator) 14class IIndicator(IScript): 15 """Represents an indicator script that can be overlaid on a chart or displayed on a separate indicator panel.""" 16 17 @property 18 def is_overlay(self) -> bool: 19 """Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel.""" 20 val = self._value.IsOverlay 21 return val 22 @property 23 def is_percentage(self) -> bool: 24 """Indicates whether the indicator is a percentage indicator. The default value is false.""" 25 val = self._value.IsPercentage 26 return val 27 @property 28 def auto_rescale(self) -> bool: 29 """Indicates whether this instance automatically rescales the chart or not.""" 30 val = self._value.AutoRescale 31 return val 32 @auto_rescale.setter 33 def auto_rescale(self, val: bool): 34 tmp = self._value 35 tmp.AutoRescale = val 36 self._value = tmp 37 @property 38 def apply_background_color_to_all_panels(self) -> bool: 39 """Indicates whether a background color should be applied to all panels.""" 40 val = self._value.ApplyBackgroundColorToAllPanels 41 return val 42 @apply_background_color_to_all_panels.setter 43 def apply_background_color_to_all_panels(self, val: bool): 44 tmp = self._value 45 tmp.ApplyBackgroundColorToAllPanels = val 46 self._value = tmp 47 @property 48 def scale_precision(self) -> int | None: 49 """The number of decimals displayed on the price scale of the indicator panel.""" 50 val = self._value.ScalePrecision 51 return val 52 @property 53 def background_color(self) -> Series: 54 """Sets the background color of the chart panel.""" 55 val = self._value.BackgroundColor 56 return val
19@tb_interface(_IIndicator) 20class IIndicator(IScript): 21 """Represents an indicator script that can be overlaid on a chart or displayed on a separate indicator panel.""" 22 23 @property 24 def is_overlay(self) -> bool: 25 """Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel.""" 26 val = self._value.IsOverlay 27 return val 28 @property 29 def is_percentage(self) -> bool: 30 """Indicates whether the indicator is a percentage indicator. The default value is false.""" 31 val = self._value.IsPercentage 32 return val 33 @property 34 def auto_rescale(self) -> bool: 35 """Indicates whether this instance automatically rescales the chart or not.""" 36 val = self._value.AutoRescale 37 return val 38 @auto_rescale.setter 39 def auto_rescale(self, val: bool): 40 tmp = self._value 41 tmp.AutoRescale = val 42 self._value = tmp 43 @property 44 def apply_background_color_to_all_panels(self) -> bool: 45 """Indicates whether a background color should be applied to all panels.""" 46 val = self._value.ApplyBackgroundColorToAllPanels 47 return val 48 @apply_background_color_to_all_panels.setter 49 def apply_background_color_to_all_panels(self, val: bool): 50 tmp = self._value 51 tmp.ApplyBackgroundColorToAllPanels = val 52 self._value = tmp 53 @property 54 def scale_precision(self) -> int | None: 55 """The number of decimals displayed on the price scale of the indicator panel.""" 56 val = self._value.ScalePrecision 57 return val 58 @property 59 def background_color(self) -> Series: 60 """Sets the background color of the chart panel.""" 61 val = self._value.BackgroundColor 62 return val
Represents an indicator script that can be overlaid on a chart or displayed on a separate indicator panel.
is_overlay: bool
23 @property 24 def is_overlay(self) -> bool: 25 """Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel.""" 26 val = self._value.IsOverlay 27 return val
Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel.
is_percentage: bool
28 @property 29 def is_percentage(self) -> bool: 30 """Indicates whether the indicator is a percentage indicator. The default value is false.""" 31 val = self._value.IsPercentage 32 return val
Indicates whether the indicator is a percentage indicator. The default value is false.
auto_rescale: bool
33 @property 34 def auto_rescale(self) -> bool: 35 """Indicates whether this instance automatically rescales the chart or not.""" 36 val = self._value.AutoRescale 37 return val
Indicates whether this instance automatically rescales the chart or not.
apply_background_color_to_all_panels: bool
43 @property 44 def apply_background_color_to_all_panels(self) -> bool: 45 """Indicates whether a background color should be applied to all panels.""" 46 val = self._value.ApplyBackgroundColorToAllPanels 47 return val
Indicates whether a background color should be applied to all panels.
scale_precision: int | None
53 @property 54 def scale_precision(self) -> int | None: 55 """The number of decimals displayed on the price scale of the indicator panel.""" 56 val = self._value.ScalePrecision 57 return val
The number of decimals displayed on the price scale of the indicator panel.