tbapi.api.models.price_marker

 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 PriceMarker as _PriceMarker
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9
10@tb_class(_PriceMarker)
11class PriceMarker():
12    """Represents settings for displaying a price marker on the Y-axis"""
13
14    @overload
15    @staticmethod
16    def new(formatter: Func = None) -> "PriceMarker":
17        """Constructor overload with arguments: formatter"""
18        ...
19    @staticmethod
20    def new(*args, **kwargs):
21        """Generic factory method for PriceMarker. Use overloads for IDE type hints."""
22        return PriceMarker(*args, **kwargs)
23
24    @property
25    def formatter(self) -> Func:
26        """Gets a function that formats the displayed value.      The function takes a bar index as input and returns a formatted string."""
27        val = self._value.Formatter
28        return val
29    @formatter.setter
30    def formatter(self, val: Func):
31        tmp = self._value
32        tmp.Formatter = val
33        self._value = tmp
@tb_class(_PriceMarker)
class PriceMarker:
18@tb_class(_PriceMarker)
19class PriceMarker():
20    """Represents settings for displaying a price marker on the Y-axis"""
21
22    @overload
23    @staticmethod
24    def new(formatter: Func = None) -> "PriceMarker":
25        """Constructor overload with arguments: formatter"""
26        ...
27    @staticmethod
28    def new(*args, **kwargs):
29        """Generic factory method for PriceMarker. Use overloads for IDE type hints."""
30        return PriceMarker(*args, **kwargs)
31
32    @property
33    def formatter(self) -> Func:
34        """Gets a function that formats the displayed value.      The function takes a bar index as input and returns a formatted string."""
35        val = self._value.Formatter
36        return val
37    @formatter.setter
38    def formatter(self, val: Func):
39        tmp = self._value
40        tmp.Formatter = val
41        self._value = tmp

Represents settings for displaying a price marker on the Y-axis

PriceMarker(*args, **kwargs)
162        def __init__(self, *args, **kwargs):
163            pass
@staticmethod
def new(*args, **kwargs):
27    @staticmethod
28    def new(*args, **kwargs):
29        """Generic factory method for PriceMarker. Use overloads for IDE type hints."""
30        return PriceMarker(*args, **kwargs)

Generic factory method for PriceMarker. Use overloads for IDE type hints.

formatter: 'Func'
32    @property
33    def formatter(self) -> Func:
34        """Gets a function that formats the displayed value.      The function takes a bar index as input and returns a formatted string."""
35        val = self._value.Formatter
36        return val

Gets a function that formats the displayed value. The function takes a bar index as input and returns a formatted string.