TakeProfit logo CommunityPlatform

Library reference



Package indie

Main package of Indie language.
 

  • CONTENTS

Algorithm @algorithm() algorithms @band() Color color Context @fill() Fill format @indicator() IndieError @level() line_style MainContext MutSeries MutSeriesF Optional param @param_ref() @plot() Plot plot_style @sec_context() SecContext Series SeriesF source SymbolInfo tf() TimeFrame

 


Types

 


Algorithm

type

Base class for the classes that perform some processing of series data.
 

  • MEMBERS

__init__() ctx

  • SEE ALSO

MainContext SecContext

 



Color

type

Data type to represent color.
 

  • MEMBERS

__call__()

  • SEE ALSO

Plot Fill color

 



Context

type

Data type that represents an instrument with OHLCV series values and other related information.
 

  • MEMBERS

bar_count bar_index calc_on() close high hl2 hlc3 info is_last_bar is_last_history_bar is_realtime low new_mut_series_f() ohlc4 open time time_frame volume

  • SEE ALSO

MainContext SecContext SymbolInfo Series[T]

 



Fill

type

Class that represents a fill object.
 

  • MEMBERS

__init__()

  • SEE ALSO

@fill() Plot

 



IndieError

type

Data type for Indie errors.
 

  • MEMBERS

__init__()

 



MainContext

type

Base class for the class that represents main context.
 

  • PARENTS

Context

  • MEMBERS

bar_count bar_index calc_on() close high hl2 hlc3 info is_last_bar is_last_history_bar is_realtime low new_mut_series_f() ohlc4 open time time_frame volume

  • SEE ALSO

SecContext Algorithm

 



MutSeriesF

type

Data type that represents read-write series of float values like prices of some instrument. Type MutSeriesF is nothing but an alias for type MutSeries[float].
 

  • PARENTS

Series[float]

  • MEMBERS

__getitem__() __len__() __setitem__() calc() get() new() request_size()

  • SEE ALSO

Series[T] SeriesF MutSeries[T] Context

 



MutSeries[T]

type

Generic data type that represents read-write series of values of type T. Type T could be float, int, str, or almost any other type.
 

  • PARENTS

Series[T]

  • MEMBERS

__getitem__() __len__() __setitem__() calc() get() new() request_size()

  • SEE ALSO

Series[T] SeriesF MutSeriesF Context

 



Optional[T]

type

Builtin Indie type (similar to Python's typing.Optional).
 

  • MEMBERS

__bool__() value() value_or()

 



Plot

type

Class that represents a plot object.
 

  • MEMBERS

__init__()

  • SEE ALSO

@plot() Fill

 



SecContext

type

Base class for the classes that represent additional contexts besides the main one.
 

  • PARENTS

Context

  • MEMBERS

bar_count bar_index calc_on() close high hl2 hlc3 info is_last_bar is_last_history_bar is_realtime low new_mut_series_f() ohlc4 open time time_frame volume

  • SEE ALSO

MainContext Algorithm

 



SeriesF

type

Data type that represents read only series of float values like prices of some instrument. Type SeriesF is nothing but an alias for type Series[float].
 

  • MEMBERS

__getitem__() __len__() get() request_size()

  • SEE ALSO

Series[T] MutSeries[T] MutSeriesF Context

 



Series[T]

type

Generic data type that represents read only series of values of type T. Type T could be float, int, str, or almost any other type.
 

  • MEMBERS

__getitem__() __len__() get() request_size()

  • SEE ALSO

SeriesF MutSeries[T] MutSeriesF Context

 



SymbolInfo

type

Data type to represent information about the context's instrument.
 

  • MEMBERS

exchange_aliases exchange_code marketdata_timezone price_precision tick_size ticker

  • SEE ALSO

Context

 



TimeFrame

type

Data type that represents time frame.
 

  • MEMBERS

to_minutes()

  • REMARKS

Use tf() to create TimeFrame instances.

  • SEE ALSO

tf()

 



format

type

Enum-like class with constants that determine how to format the indicator value on the price scale.
 

  • MEMBERS

INHERITED PRICE VOLUME

  • SEE ALSO

@indicator()

 



line_style

type

Enum-like class with constants of line styles.
 

  • MEMBERS

DASHED DOTTED SOLID

 



param

type

Class with decorators of indicator input parameters of various types.
 

  • MEMBERS

@bool() @float() @int() @source() @string() @time_frame()

  • SEE ALSO

@indicator()

 



plot_style

type

Enum-like class with constants of plot styles.
 

  • MEMBERS

COLUMNS HISTOGRAM LINE STEPS

 



source

type

Enum-like class with constants for various price sources (it is used in @indie.param.source).
 

  • MEMBERS

CLOSE HIGH HL2 HLC3 LOW OHLC4 OPEN VOLUME

  • SEE ALSO

@indicator()

 


Decorators

 


@algorithm()

decorator

Decorates a function, making it a series processor algorithm. Such algorithms are specifically designed to process series of data, like close prices of an instrument of a candle chart. One way of using such an algorithm is to call new static method, read more here.
 

  • SIGNATURES
@algorithm() -> NoneType
  • REMARKS

Most of the functions in the indie.algorithms package are decorated with @indie.algorithm decorator. Read more about it in Series processors chapter.

  • SEE ALSO

SeriesF Context Algorithm

 



@band()

decorator

Use this decorator to add a band (two horizontal lines usually with a semi-transparent fill in between them) to indicator.
 

  • SIGNATURES
@band(
  value1: float,
  value2: float,
  title: indie.Optional[str] = None,
  fill_color: indie.Color = indie.color.GREEN(0.05),
  line_color: indie.Color = indie.color.GRAY(0.5),
  line_style: int = indie.line_style.DASHED,
  line_width: int = 1
) -> NoneType
  • PARAMETERS

    • value1 — Value of the first horizontal line of a band on a vertical scale of an indicator.

    • value2 — Value of the second horizontal line of a band on a vertical scale of an indicator.

    • title — Human readable title which is visible in the indicator's Settings panel.

    • fill_color — Color of the background.

    • line_color — Color of the line.

    • line_style — Style of the line. It is represented as enum value of type line_style.

    • line_width — Width of the line.

  • EXAMPLE

@indicator('Band example')
@band(145, 155, line_color=color.RED, line_width=4)
def Main(self):
    return self.close[0]
  • SEE ALSO

@indicator() @level()

 



@fill()

decorator

Declares attributes of a fill between some two plots of an indicator. Could be applied only to the Main entry point of the indicator. Example of an indicator with a single colored fill is Bollinger Bands (BB), of a multicolored fill — Ichimoku Cloud. When applied, it must match with the result of the Main indicator entry point.
 

  • SIGNATURES
@fill(
  id1: str,
  id2: str,
  id: indie.Optional[str] = None,
  title: indie.Optional[str] = None,
  color: indie.Optional[indie.Color] = None
) -> NoneType
  • PARAMETERS

    • id1 — Identifier of the first plot to which the fill is applied.

    • id2 — Identifier of the second plot to which the fill is applied.

    • id — Identifier of the fill (auto generated).

    • title — Human readable title which is visible in the indicator's Settings panel.

    • color — Color of the fill on a chart. This color can be overwritten if the fill is a multicolored one.

  • EXAMPLE

@plot('one')
@plot('two')
@fill('one', 'two', color=color.GREEN)
def Main(self):
    return self.high[0], self.low[0], Fill()
  • REMARKS

More info about fills (for example about multicolored ones) could be found in Fills, levels and bands chapter.

  • SEE ALSO

@plot() Fill

 



@indicator()

decorator

Decorator that should be applied to the Main entry point of any indicator.
 

  • SIGNATURES
@indicator(
  abbrev_title: str,
  overlay_main_pane: bool = False,
  format: int = indie.format.INHERITED,
  precision: indie.Optional[int] = None
) -> NoneType
  • PARAMETERS

    • abbrev_title — Abbreviated title of the indicator.

    • overlay_main_pane — Whether or not to overlay the indicator over the main pane of the chart. The main pane of a chart is the one with the main instrument on it.

    • format — Formatting style of indicator output values represented as enum value of type format.

    • precision — Number of digits after floating point for indicator output values.

 



@level()

decorator

Decorator that is used to create a level (horizontal line) in an indicator.
 

  • SIGNATURES
@level(
  value: float,
  title: indie.Optional[str] = None,
  line_color: indie.Color = indie.color.GRAY(0.5),
  line_style: int = indie.line_style.DASHED,
  line_width: int = 1
) -> NoneType
  • PARAMETERS

    • value — Value of the level on a vertical scale of an indicator.

    • title — Human readable title which is visible in the indicator's Settings panel.

    • line_color — Color of the line.

    • line_style — Style of the line. It is represented as enum value of type line_style.

    • line_width — Width of the line.

  • EXAMPLE

@indicator('Level example')
@level(150, line_color=color.RED, line_width=4)
def Main(self):
    return self.close[0]
  • SEE ALSO

@indicator() @band()

 



@param.bool()

decorator

Declares a bool input parameter of indicator. Values of input parameters can be changed in indicator's Settings panel. Input parameters are used in combination with corresponding parameter declaration in Main entry point.
 

  • SIGNATURES
@bool(
  id: str,
  default: bool,
  title: indie.Optional[str] = None
) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.

    • default — Default value for the parameter in settings pane.

    • title — Human readable title which is visible in the indicator's Settings panel.

  • EXAMPLE

@param.bool('is_something_enabled', default=False)
def Main(self, is_something_enabled):
    # Use is_something_enabled variable...
  • SEE ALSO

@indicator() param

 



@param.float()

decorator

Declares a float input parameter of indicator. Values of input parameters can be changed in indicator's Settings panel. Input parameters are used in combination with corresponding parameter declaration in Main entry point.
 

  • SIGNATURES
@float(
  id: str,
  default: float,
  min: float = -1000000.0,
  max: float = 1000000.0,
  step: float = 0.1,
  title: indie.Optional[str] = None
) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.

    • default — Default value for the parameter in settings pane.

    • min — Minimum value of the parameter.

    • max — Maximum value of the parameter.

    • step — Step between values of the parameter.

    • title — Human readable title which is visible in the indicator's Settings panel.

  • EXAMPLE

@param.float('speed_of_light', default=299_792.458)
def Main(self, speed_of_light):
    # Use speed_of_light variable...
  • SEE ALSO

@indicator() param

 



@param.int()

decorator

Declares an integer input parameter of indicator. Values of input parameters can be changed in indicator's Settings panel. Input parameters are used in combination with corresponding parameter declaration in Main entry point.
 

  • SIGNATURES
@int(
  id: str,
  default: int,
  min: int = -1000000,
  max: int = 1000000,
  step: int = 1,
  title: indie.Optional[str] = None
) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.

    • default — Default value for the parameter in settings pane.

    • min — Minimum value of the parameter.

    • max — Maximum value of the parameter.

    • step — Step between values of the parameter.

    • title — Human readable title which is visible in the indicator's Settings panel.

  • EXAMPLE

@param.int('meaning_of_life', default=42)
def Main(self, meaning_of_life):
    # Use meaning_of_life variable...
  • SEE ALSO

@indicator() param

 



@param.source()

decorator

Declares a source input parameter of indicator. Values of input parameters can be changed in indicator's Settings panel. Input parameters are used in combination with corresponding parameter declaration in Main entry point.
 

  • SIGNATURES
@source(
  id: str,
  default: int = source.CLOSE,
  options: indie.Optional[list[int]] = None,
  title: indie.Optional[str] = None
) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.

    • default — Default value for the parameter in settings pane.

    • options — List of the possible values of the parameter.

    • title — Human readable title which is visible in the indicator's Settings panel.

  • EXAMPLE

@param.source('src', default=source.CLOSE, options=[source.CLOSE, source.HL2, source.HLC3, source.OHLC4])
def Main(self, src):
    # Use src variable...
  • REMARKS

Even if options parameter is not used then in Settings panel nevertheless there will be a combobox widget with all possible values from the source enum.

  • SEE ALSO

@indicator() param source

 



@param.string()

decorator

Declares a string input parameter of indicator. Values of input parameters can be changed in indicator's Settings panel. Input parameters are used in combination with corresponding parameter declaration in Main entry point.
 

  • SIGNATURES
@string(
  id: str,
  default: str,
  options: indie.Optional[list[str]] = None,
  title: indie.Optional[str] = None
) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.

    • default — Default value for the parameter in settings pane.

    • options — List of the possible values of the parameter.

    • title — Human readable title which is visible in the indicator's Settings panel.

  • EXAMPLE

@param.string('name', default='Bart', options=['Homer', 'Marge', 'Bart', 'Lisa', 'Maggie'])
def Main(self, name):
    # Use name variable...
  • REMARKS

If options parameter is used then in Settings panel there will be a combobox widget for changing value of this input.

  • SEE ALSO

@indicator() param

 



@param.time_frame()

decorator

Declares a time frame input parameter of indicator. Values of input parameters can be changed in indicator's Settings panel. Input parameters are used in combination with corresponding parameter declaration in Main entry point.
 

  • SIGNATURES
@time_frame(
  id: str,
  default: str,
  options: indie.Optional[list[str]] = None,
  title: indie.Optional[str] = None
) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.

    • default — Default value for the parameter in settings pane.

    • options — List of the possible values of the parameter.

    • title — Human readable title which is visible in the indicator's Settings panel.

  • EXAMPLE

@param.time_frame('time_frame', default='30m', options=['1m', '30m', '1h', '4h', '1D', '1W', '1M', '1Y'])
def Main(self, time_frame):
    # Use time_frame variable...
  • REMARKS

The type of time_frame in the example variable will be TimeFrame. But please note, that for the convenience, default value has str type. String representation of TimeFrame has a form of <number>[m|h|D|W|M|Y] where suffixes mean: m - minutes, h - hours, D - days, W - weeks, M - months, Y - years.

If options parameter is used then in Settings panel there will be a combobox widget for changing value of this input.

  • SEE ALSO

@indicator() param TimeFrame tf()

 



@param_ref()

decorator

Declares an input parameter for @sec_context function that is linked to the input parameter of Main by id.
 

  • SIGNATURES
@param_ref(id: str) -> NoneType
  • PARAMETERS

    • id — Name of Main function or class parameter bound to the input parameter.
  • EXAMPLE

@sec_context
@param_ref('referenced_param')
def SecMain(self, referenced_param) -> float:
    # Use referenced_param variable...

@indicator('Referenced param example')
@param.int('referenced_param', default=50)
class Main(MainContext):
    def __init__(self):
        self._calc_on_result = self.calc_on(time_frame=tf('1D'), sec_context=SecMain)

    def calc(self):
        return self._calc_on_result[0]
  • SEE ALSO

@indicator() param

 



@plot()

decorator

Declares attributes of a plot of an indicator. Could be applied only to the Main entry point of the indicator. It is optional, so may be omitted in some simple use cases and plot will be rendered using defaults. When applied, it must match with the result of the Main indicator entry point.
 

  • SIGNATURES
@plot(
  id: indie.Optional[str] = None,
  title: indie.Optional[str] = None,
  color: indie.Optional[indie.Color] = None,
  style: int = indie.plot_style.LINE,
  line_style: indie.Optional[int] = None,
  line_width: indie.Optional[int] = None,
  continuous: indie.Optional[bool] = None,
  base_value: indie.Optional[float] = None,
  rel_width: indie.Optional[float] = None
) -> NoneType
  • PARAMETERS

    • id — A unique identifier of plot which is used in cases when a @fill() should be applied between some of the two plots of an indicator.

    • title — Human readable title which is visible in the indicator's Settings panel.

    • color — Color of the plot on a chart. This color could be overwritten if the plot is a multicolored one. Example of an indicator with a multicolored plot is Awesome Oscillator (AO).

    • style — Determines how the plot data is rendered. It is represented as enum value of type plot_style.

    • line_style — Style of the line. Could be only used in combination with plot_style.LINE. It is represented as enum value of type line_style.

    • line_width — Width of the line. Could be only used in combination with plot_style.LINE, plot_style.STEPS or plot_style.HISTOGRAM.

    • continuous — Whether the plot should be continuous when the indicator has NaN values. Could be only used in combination with plot_style.LINE.

    • base_value — Base value. Could be only used in combination with plot_style.HISTOGRAM or plot_style.COLUMNS.

    • rel_width — Relative width. Could be only used in combination with plot_style.COLUMNS.

  • EXAMPLE

@plot()
@plot()
@plot(style=plot_style.HISTOGRAM)
# @plot() - for the fourth plot could be omitted
def Main(self):
    return self.open[0], self.high[0], self.low[0], self.close[0]
  • SEE ALSO

@fill() Plot

 



@sec_context()

decorator

Decorates a function, making it a secondary Main entry point for additional instrument of an indicator. Additional instruments are requested with the help of Context.calc_on function and this decorator.
 

  • SIGNATURES
@sec_context() -> NoneType
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator, sec_context, param

@sec_context
def Main2(self):
    return self.high[0], self.low[0]

@indicator('Minimal calc_on example', overlay_main_pane=True)
@param.time_frame('sec_time_frame', default='1D')
class Main(MainContext):
    def __init__(self, sec_time_frame):
        self._sec_high, self._sec_low = self.calc_on(time_frame=sec_time_frame, sec_context=Main2)

    def calc(self):
        return self._sec_high[0], self._sec_low[0]
  • REMARKS

More info on this topic you can find in Request additional instruments chapter.

  • SEE ALSO

@indicator() Context Context.calc_on()

 


Functions

 


Algorithm.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Algorithm

 



Color.__call__()

method

Creates a new Color instance with the given transparency applied to the existing color.
 

  • SIGNATURES
__call__(alpha: float) -> indie.Color
  • PARAMETERS

    • alpha — Alpha channel (component) of color which ranges from 0.0 (fully transparent) to 1.0 (fully opaque).
  • EXAMPLE

half_transparent_red = color.RED(0.5)  # This implicitly calls `color.RED.__call__(0.5)`
  • REMARKS

Method __call__ should never be called directly, instead color_obj(value) syntax should be used.

  • SEE ALSO

color Color

 



Context.calc_on()

method

Requests additional instrument (creates a secondary context object for it) for indicator and returns one or more SeriesF objects which match with the arity of values that sec_context function returns. All the returned series values are merged into the timescale of current context's instrument.
 

  • SIGNATURES
calc_on(
  sec_context: typing.Type[indie.SecContext],
  exchange: indie.Optional[str] = None,
  ticker: indie.Optional[str] = None,
  time_frame: indie.Optional[indie.TimeFrame] = None,
  lookahead: bool = False
) -> indie.SeriesF | tuple[indie.SeriesF, ...]
  • PARAMETERS

    • sec_context — Function decorated with @indie.sec_context. This function has the same semantics as Indie Main, but for additional instrument (not the main one).

    • exchange — Alias for exchange of additional instrument. If omitted, then the exchange of the current context's instrument will be used.

    • ticker — Ticker of an additional instrument. If omitted, then the ticker of the current context's instrument will be used.

    • time_frame — Time frame of additional instrument. If omitted, then the time frame of current context's instrument will be used. At the moment it is allowed to request only time frames which are higher or equal to the time frame of current context's instrument.

    • lookahead — If this flag is true, then when calculating history, the bars of the secondary context are merged with the bars of the current context based on their opening time. Such a data merge strategy may result in unintended use of data from future history.

  • REMARKS

At least one of optional arguments (exchange, ticker or time_frame) must be provided. More info about this function as well as code examples you may find in Request additional instruments chapter.

  • SEE ALSO

@sec_context() Context

 



Context.new_mut_series_f()

method

Creates a MutSeriesF (an alias for MutSeries[float]) object, which is a container for float values in Indie code. The main feature of the MutSeriesF container is its ability to store (or 'remember') the historical values of a variable. These values can be accessed later using the square brackets operator (via the __getitem__ method).
 

  • SIGNATURES
new_mut_series_f(
  size: indie.Optional[int] = None,
  default: indie.Optional[float] = None
) -> indie.MutSeries[float]
  • PARAMETERS

    • size — Number of elements that MutSeriesF object should store in memory. Default and possible minimum size is 2, which means that series of size = 2 stores in memory value at the time of the last candle and value at the time of previous candle. Size is automatically expanded during history calculation of an indicator. MutSeriesF objects also have a method request_size(new_size: int) which can be used to expand the size explicitly.

    • default — Default value that will be used if an element at the specified index cannot be extracted.

  • SEE ALSO

MutSeries[T].new() Context

 



Fill.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(
  offset: int = 0,
  color: indie.Optional[indie.Color] = None
) -> NoneType
  • PARAMETERS

    • offset — Offset (in bars) of the fill during its rendering.

    • color — Color to overwrite the default one (that was set in a @fill() decorator).

  • SEE ALSO

Fill

 



IndieError.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(msg: str) -> NoneType
  • PARAMETERS

    • msg — Error message.
  • SEE ALSO

IndieError

 



MutSeries[T].__setitem__()

method

Sets value of MutSeries[T] object at the specified index.
 

  • SIGNATURES
__setitem__(int, T) -> NoneType
  • PARAMETERS

    • <unnamed param> — Index to assign value at.

    • <unnamed param> — New value.

  • EXAMPLE

ms = MutSeries[float].new(init=0)
ms[0] = 42  # This implicitly calls `ms.__setitem__(0, 42)`
  • REMARKS
  1. The index must be equal to 0 (because historical values cannot be updated), otherwise the function will raise an error at runtime. Yes, this looks very weird and maybe it would be much better just to have a method MutSeriesF.set_last(value: float) but we like the syntax of square brackets. Maybe this will be fixed in the future versions of Indie, hard to say for sure. 2) Method __setitem__ should never be called directly, instead syntax series_obj[index] = value should be used.
  • SEE ALSO

MutSeries[T]

 



MutSeries[T].calc()

method

Recalculates a MutSeries[T] object. In most cases, you can simply use the s[i] = ... syntax instead, but this method allows you to pass an initialization value to the series.
 

  • SIGNATURES
calc(
  reset: indie.Optional[T] = None,
  init: indie.Optional[T] = None,
  size: indie.Optional[int] = None
) -> indie.MutSeries[T]
  • PARAMETERS

    • reset — Value that is written into the most recent element of the MutSeriesF every time MutSeriesF.new function is executed.

    • init — Value that is written into the most recent element of the MutSeriesF object only once after the MutSeriesF object was created.

    • size — Number of elements that MutSeriesF object should store in memory. Default and possible minimum size is 2, which means that series of size = 2 stores in memory value at the time of the last candle and value at the time of previous candle. Size is automatically expanded during history calculation of an indicator. MutSeriesF objects also have a method request_size(new_size: int) which can be used to expand the size explicitly.

  • SEE ALSO

Context.new_mut_series_f() MutSeries[T].new() MutSeries[T]

 



MutSeries[T].new()

static method

Creates a MutSeries[T] object, which is a container for T values in Indie code. The main feature of the MutSeries[T] container is its ability to store (or 'remember') the historical values of a variable. These values can be accessed later using the square brackets operator (via the __getitem__ method).
 

  • SIGNATURES
new(
  reset: indie.Optional[T] = None,
  init: indie.Optional[T] = None,
  size: indie.Optional[int] = None
) -> indie.MutSeries[T]
  • PARAMETERS

    • reset — Value that is written into the most recent element of the MutSeriesF every time MutSeriesF.new function is executed.

    • init — Value that is written into the most recent element of the MutSeriesF object only once after the MutSeriesF object was created.

    • size — Number of elements that MutSeriesF object should store in memory. Default and possible minimum size is 2, which means that series of size = 2 stores in memory value at the time of the last candle and value at the time of previous candle. Size is automatically expanded during history calculation of an indicator. MutSeriesF objects also have a method request_size(new_size: int) which can be used to expand the size explicitly.

  • SEE ALSO

Context.new_mut_series_f() MutSeries[T]

 



Optional[T].__bool__()

method

Casts Optional object to bool.
 

  • SIGNATURES
__bool__() -> bool
  • SEE ALSO

Optional[T]

 



Optional[T].value()

method

Returns value of indie.Optional[T] object. Raises a runtime error if the optional object is None.
 

  • SIGNATURES
value() -> T
  • SEE ALSO

Optional[T]

 



Optional[T].value_or()

method

Returns value of indie.Optional[T] object or given default if the optional object is None.
 

  • SIGNATURES
value_or(default: T) -> T
  • PARAMETERS

    • default — Default value that will be used if there is no value.
  • SEE ALSO

Optional[T]

 



Plot.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(
  value: float,
  offset: int = 0,
  color: indie.Optional[indie.Color] = None
) -> NoneType
  • PARAMETERS

    • value — Value that will be used as the current value of the plot.

    • offset — Offset (in bars) of the plot during its rendering.

    • color — Color to overwrite the default one (that was set in a @plot() decorator).

  • SEE ALSO

Plot

 



Series[T].__getitem__()

method

Returns value of Series[T] object at the specified index. If the value is missing, then the default value of type T is returned (e.g. math.nan if T is float).
 

  • SIGNATURES
__getitem__(int) -> T
  • PARAMETERS

    • <unnamed param> — Index to extract value at.
  • EXAMPLE

@indicator('Example')
def Main(self):
    return self.close[0]  # This implicitly calls `self.close.__getitem__(0)`
  • REMARKS

Method __getitem__ should never be called directly. Instead syntax series_obj[index] should be used.

  • SEE ALSO

Context Series[T]

 



Series[T].__len__()

method

Returns length (number of elements) of a Series[T] object.
 

  • SIGNATURES
__len__() -> int
  • EXAMPLE
l = len(self.close)  # this implicitly calls `self.close.__len__()`
  • REMARKS

Method __len__ should never be called directly. Instead syntax len(series_obj) should be used.

  • SEE ALSO

Series[T]

 



Series[T].get()

method

Returns value of Series[T] object at the specified index or given default if the value is missing.
 

  • SIGNATURES
get(offset: int, default: T) -> T
  • PARAMETERS

    • offset — Index to extract value at.

    • default — Default value that will be used if an element at the specified index cannot be extracted.

  • SEE ALSO

Context Series[T]

 



Series[T].request_size()

method

Expands the capacity of Series[T] object (number of elements that Series[T] object should store in memory).
 

  • SIGNATURES
request_size(size: int) -> NoneType
  • PARAMETERS

    • size — Number of elements that SeriesF object should store in memory. Default and possible minimum size is 2, which means that series of size = 2 stores in memory value at the time of the last candle and value at the time of previous candle. Size is automatically expanded during history calculation of an indicator.
  • SEE ALSO

Context Series[T]

 



TimeFrame.to_minutes()

method

Converts TimeFrame object to corresponding number of minutes. Month is always considered to be of 30 days long, and year is always of 365 days long.
 

  • SIGNATURES
to_minutes() -> int
  • SEE ALSO

TimeFrame tf()

 



tf()

function

Converts string representation of time frame to TimeFrame type. String representation of TimeFrame has a form of <number>[m|h|D|W|M|Y] where suffixes mean: m - minutes, h - hours, D - days, W - weeks, M - months, Y - years. For example tf('15m') creates a TimeFrame object which corresponds to 15 minute time frame.
 

  • SIGNATURES
tf(s: str = None) -> indie.TimeFrame
  • PARAMETERS

    • s — String representation of time frame.
  • SEE ALSO

TimeFrame @param.time_frame()

 


Objects

 


Algorithm.ctx

field

Represents context of an instrument which is currently bound to this algorithm instance. An indicator has at least one instrument — the main instrument of a chart where the indicator was added to. Besides the main instrument an indicator may have several additional instruments, which is done with the help of Context.calc_on function.
 

  • TYPE

Context

  • SEE ALSO

Algorithm

 



Context.bar_count

field

Current total number of bars in this context's instrument which the indicator has received. It is always true that self.bar_count is equal to self.bar_index + 1.
 

  • TYPE

int

  • SEE ALSO

Context

 



Context.bar_index

field

Index of a last (current) bar in this context's instrument which the indicator has received. The very first bar has index equal to 0 and this is the oldest bar.
 

  • TYPE

int

  • SEE ALSO

Context

 



Context.close

field

Series of 'close' prices of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.high

field

Series of 'high' prices of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.hl2

field

Series of '(high + low) / 2' values of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.hlc3

field

Series of '(high + low + close) / 3' values of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.info

field

Information about the context's instrument.
 

  • TYPE

SymbolInfo

  • SEE ALSO

Context

 



Context.is_last_bar

field

Flag that is True if the current bar is the last bar in the history or it is a realtime bar.
 

  • TYPE

bool

  • SEE ALSO

Context

 



Context.is_last_history_bar

field

Flag that is True if the current bar is the last bar of the historical part of prices data.
 

  • TYPE

bool

  • SEE ALSO

Context

 



Context.is_realtime

field

Flag that is True if the last (current) bar is a realtime bar.
 

  • TYPE

bool

  • SEE ALSO

Context

 



Context.low

field

Series of 'low' prices of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.ohlc4

field

Series of '(open + high + low + close) / 4' values of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.open

field

Series of 'open' prices of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.time

field

Series of timestamps (as unix time UTC seconds) of the context's instrument. Every timestamp corresponds to start time of some bar on a chart.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



Context.time_frame

field

Time frame of the context's instrument.
 

  • TYPE

TimeFrame

  • SEE ALSO

Context

 



Context.volume

field

Series of 'volume' values of the context's instrument.
 

  • TYPE

Series[float]

  • SEE ALSO

Context

 



SymbolInfo.exchange_aliases

field

Commonly recognized (but not exactly standardized) alias for an exchange. For example, an alias for the New York Stock Exchange, Inc. is 'NYSE'. In most cases exchange alias matches with the exchange acronym (see ISO10383).
 

  • TYPE

list[str]

  • SEE ALSO

SymbolInfo

 



SymbolInfo.exchange_code

field

Exchange code of the context's instrument. For stocks it is a MIC. For crypto instruments it is just some identifier, not commonly recognized as MIC but unique within TakeProfit. For example, exchange_code for the New York Stock Exchange, Inc. is 'XNYS'.
 

  • TYPE

str

  • SEE ALSO

SymbolInfo

 



SymbolInfo.marketdata_timezone

field

Name of the exchange timezone of the context's instrument. For example, 'America/New_York'.
 

  • TYPE

str

  • SEE ALSO

SymbolInfo

 



SymbolInfo.price_precision

field

Price precision of the context's instrument. For example, price precision of 100 means that prices have two digits after the floating point.
 

  • TYPE

int

  • SEE ALSO

SymbolInfo

 



SymbolInfo.tick_size

field

Absolute value of a minimal movement of a price of the context's instrument in corresponding currency.
 

  • TYPE

float

  • SEE ALSO

SymbolInfo

 



SymbolInfo.ticker

field

Ticker of the context's instrument.
 

  • TYPE

str

  • SEE ALSO

SymbolInfo

 



format.INHERITED

static field

Indicator output values are formatted same as values of the main chart instrument.
 

  • TYPE

int

  • SEE ALSO

format

 



format.PRICE

static field

Indicator output values are formatted using fixed number of digits after the floating point. The number of digits is set with additional parameter precision of @indicator(). The precision param has effect only in combination with the format.PRICE format.
 

  • TYPE

int

  • SEE ALSO

format

 



format.VOLUME

static field

Indicator output values are formatted according to the rules of formatting large numbers, such as volumes of trades. For example 100500.0 will be formatted as 100.5K.
 

  • TYPE

int

  • SEE ALSO

format

 



line_style.DASHED

static field

Built-in line style constant that determines how the line is rendered.
 

  • TYPE

int

  • SEE ALSO

line_style

 



line_style.DOTTED

static field

Built-in line style constant that determines how the line is rendered.
 

  • TYPE

int

  • SEE ALSO

line_style

 



line_style.SOLID

static field

Built-in line style constant that determines how the line is rendered.
 

  • TYPE

int

  • SEE ALSO

line_style

 



plot_style.COLUMNS

static field

Built-in plot style constant that determines how the plot data is rendered.
 

  • TYPE

int

  • SEE ALSO

plot_style

 



plot_style.HISTOGRAM

static field

Built-in plot style constant that determines how the plot data is rendered.
 

  • TYPE

int

  • SEE ALSO

plot_style

 



plot_style.LINE

static field

Built-in plot style constant that determines how the plot data is rendered.
 

  • TYPE

int

  • SEE ALSO

plot_style

 



plot_style.STEPS

static field

Built-in plot style constant that determines how the plot data is rendered.
 

  • TYPE

int

  • SEE ALSO

plot_style

 



source.CLOSE

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.HIGH

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.HL2

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.HLC3

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.LOW

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.OHLC4

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.OPEN

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



source.VOLUME

static field

Built-in source kind constant which corresponds to Context's series field and is used to initialize source input parameter.
 

  • TYPE

int

  • SEE ALSO

source

 



Package indie.algorithms

Algorithms package of Indie language.
 

  • CONTENTS

Adx Atr Bb Cci Change CumSum Dev Donchian Ema FixNan Highest Lowest Ma Median Mfv NanToZero NetVolume PercentRank Rma Roc Rsi SinceHighest SinceLowest Sma StdDev Stoch Sum Supertrend Tr Tsi Vwap Vwma Wma

 


Types

 


Adx

type

Average directional index algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan, isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Change, Rma, Tr, FixNan


@algorithm
def Adx(self, adx_len: int, di_len: int) -> tuple[SeriesF, SeriesF, SeriesF]:
    '''Average Directional Index'''
    up = Change.new(self.ctx.high)[0]
    down = -Change.new(self.ctx.low)[0]
    plus_dm = MutSeriesF.new(0 if up <= down or up <= 0 else up)
    minus_dm = MutSeriesF.new(0 if down <= up or down <= 0 else down)

    truerange = Rma.new(Tr.new(), di_len)

    plus = MutSeriesF.new(init=nan)
    minus = MutSeriesF.new(init=nan)
    if not isclose(truerange[0], 0):
        plus[0] = 100 * Rma.new(plus_dm, di_len)[0] / truerange[0]
        minus[0] = 100 * Rma.new(minus_dm, di_len)[0] / truerange[0]
    plus[0] = FixNan.new(plus)[0]
    minus[0] = FixNan.new(minus)[0]

    sum = plus[0] + minus[0]
    res = 100 * Rma.new(MutSeriesF.new(abs(plus[0] - minus[0]) / (sum if sum != 0 else 1)), adx_len)[0]
    return minus, MutSeriesF.new(res), plus
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Adx

@indicator('Example')
def Main(self):
    minus_di, adx, plus_di = Adx.new(adx_len=9, di_len=12)
    return minus_di[0], adx[0], plus_di[0]

 



Atr

type

Average true range algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF
from indie.algorithms import Tr, Ma


@algorithm
def Atr(self, length: int, ma_algorithm: str = 'RMA') -> SeriesF:
    '''Average True Range'''
    return Ma.new(Tr.new(True), length, ma_algorithm)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Atr

@indicator('Example')
def Main(self):
    atr = Atr.new(length=12, ma_algorithm='SMA')
    return atr[0]

 



Bb

type

Bollinger bands algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma, StdDev


@algorithm
def Bb(self, src: SeriesF, length: int, mult: float) -> tuple[SeriesF, SeriesF, SeriesF]:
    '''Bollinger Bands'''
    middle = Sma.new(src, length)[0]
    dev = mult * StdDev.new(src, length)[0]
    lower = middle - dev
    upper = middle + dev
    return MutSeriesF.new(lower), MutSeriesF.new(middle), MutSeriesF.new(upper)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Bb

@indicator('Example', overlay_main_pane=True)
def Main(self):
    lower, middle, upper = Bb.new(self.close, length=20, mult=2.0)
    return lower[0], middle[0], upper[0]

 



Cci

type

Commodity channel index algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan, isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma, Dev


@algorithm
def Cci(self, src: SeriesF, length: int) -> SeriesF:
    '''Commodity Channel Index'''
    ma = Sma.new(src, length)
    dv = Dev.new(src, length)[0]
    res = nan
    if not isclose(dv, 0):
        res = (src[0] - ma[0]) / (0.015 * dv)
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Cci

@indicator('Example')
def Main(self):
    cci = Cci.new(self.close, length=20)
    return cci[0]

 



Change

type

Algorithm to calculate change of a series of values. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def Change(self, src: SeriesF, length: int = 1) -> SeriesF:
    return MutSeriesF.new(src[0] - src[length])
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Change

@indicator('Example')
def Main(self):
    ch = Change.new(self.close)
    return ch[0]

 



CumSum

type

Cumulative sum algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def CumSum(self, src: SeriesF) -> SeriesF:
    res = MutSeriesF.new(init=0)
    res[0] += src[0]
    return res
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import CumSum

@indicator('Example')
def Main(self):
    cs = CumSum.new(self.close)
    return cs[0]

 



Dev

type

Mean absolute deviation algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma


@algorithm
def Dev(self, src: SeriesF, length: int) -> SeriesF:
    '''Mean Absolute Deviation'''
    mean = Sma.new(src, length)[0]
    sum = 0.0
    for i in range(length):
        sum += abs(src[i] - mean)
    return MutSeriesF.new(sum / length)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Dev

@indicator('Example')
def Main(self):
    dev = Dev.new(self.close, length=12)
    return dev[0]

 



Donchian

type

Donchian channels algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, MutSeriesF, SeriesF
from indie.algorithms import Lowest, Highest


@algorithm
def Donchian(self, length: int) -> SeriesF:
    lowest = Lowest.new(self.ctx.low, length)[0]
    highest = Highest.new(self.ctx.high, length)[0]
    return MutSeriesF.new((lowest + highest) / 2)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Donchian

@indicator('DC', overlay_main_pane=True)
def Main(self):
    d = Donchian.new(length=20)
    return d[0]

 



Ema

type

Exponential moving average algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isnan, nan
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma


@algorithm
def Ema(self, src: SeriesF, length: int) -> SeriesF:
    '''Exponential Moving Average'''
    alpha = 2 / (length + 1)
    s = MutSeriesF.new(init=0)
    res_sma = Sma.new(src, length)[0]
    result = 0.0
    if isnan(src[0]):
        s[0] = nan
        result = res_sma
    elif isnan(s[1]):
        s[0] = res_sma
        result = s[0]
    else:
        s[0] = alpha * src[0] + (1 - alpha) * s[1]
        result = s[0]
    return MutSeriesF.new(result)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Ema

@indicator('Example', overlay_main_pane=True)
def Main(self):
    ema = Ema.new(self.close, length=9)
    return ema[0]

 



FixNan

type

Algorithm that replaces all math.nan values with the most recent corresponding non-nan values in a series. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isnan
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def FixNan(self, src: SeriesF) -> SeriesF:
    res = MutSeriesF.new(init=src[0])
    if not isnan(src[0]):
        res[0] = src[0]
    return res
  • EXAMPLE
# indie:lang_version = 4
import math
from indie import indicator, MutSeriesF
from indie.algorithms import FixNan

@indicator('Example', overlay_main_pane=True)
def Main(self):
    # Variable `s` is just an example of a series with `nan` values:
    s = MutSeriesF.new(math.nan)
    if self.close[0] > self.open[0]:
        s[0] = self.close[0]
    # `FixNan` replaces every `nan` value in `s` with the closest non-`nan` value on the left of it:
    s2 = FixNan.new(s)
    return s2[0]
  • SEE ALSO

NanToZero

 



Highest

type

Algorithm that returns the maximum value over a given period. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def Highest(self, src: SeriesF, length: int) -> SeriesF:
    src.request_size(length)
    result = src[0]
    for i in range(1, length):
        result = max(src[i], result)
    return MutSeriesF.new(result)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Highest

@indicator('My Indie 1', overlay_main_pane=True)
def Main(self):
    h = Highest.new(self.high, length=12)
    return h[0]
  • SEE ALSO

SinceHighest

 



Lowest

type

Algorithm that returns the minimum value over a given period. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def Lowest(self, src: SeriesF, length: int) -> SeriesF:
    src.request_size(length)
    result = src[0]
    for i in range(1, length):
        result = min(src[i], result)
    return MutSeriesF.new(result)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Lowest

@indicator('My Indie 1', overlay_main_pane=True)
def Main(self):
    l = Lowest.new(self.low, length=12)
    return l[0]
  • SEE ALSO

SinceLowest

 



Ma

type

Moving average algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF, Optional, IndieError
from indie.algorithms import Ema, Sma, Rma, Vwma, Wma


@algorithm
def Ma(self, src: SeriesF, length: int, algorithm: str) -> SeriesF:
    '''Moving Average'''
    result: Optional[SeriesF]
    if algorithm == 'EMA':
        result = Ema.new(src, length)
    elif algorithm == 'SMA':
        result = Sma.new(src, length)
    elif algorithm == 'SMMA (RMA)' or algorithm == 'RMA':
        result = Rma.new(src, length)
    elif algorithm == 'VWMA':
        result = Vwma.new(src, length)
    elif algorithm == 'WMA':
        result = Wma.new(src, length)
    else:
        raise IndieError("moving average algorithm should be one of 'EMA', 'SMA', "
                         "'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA' but it is " + algorithm)
    return result.value()
  • EXAMPLE
# indie:lang_version = 4
from indie.algorithms import Ma

@indicator('Example', overlay_main_pane=True)
def Main(self):
    ma = Ma.new(self.close, length=12, algorithm='SMA')
    return ma[0]

 



Median

type

Moving median algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF
from statistics import median as stats_median


# TODO: Use quickselect median find algorithm, see more https://rcoh.me/posts/linear-time-median-finding/
@algorithm
def Median(self, src: SeriesF, length: int) -> SeriesF:
    prices: list[float] = []  # TODO: Create list of size=length only once and clear+refill it
    for i in range(length):
        prices.append(src[i])
    res = stats_median(prices)  # type: ignore
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Median

@indicator('Example', overlay_main_pane=True)
def Main(self):
    m = Median.new(self.close, length=10)
    return m[0]

 



Mfv

type

Money flow volume algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isclose
from indie import algorithm, MutSeriesF, SeriesF


@algorithm
def Mfv(self) -> SeriesF:
    '''Money Flow Volume'''
    h = self.ctx.high[0]
    l = self.ctx.low[0]
    c = self.ctx.close[0]
    v = self.ctx.volume[0]

    res = 0.0
    if not isclose(h - l, 0):
        res = ((c - l) - (h - c)) / (h - l) * v
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Mfv

@indicator('Example')
def Main(self):
    mfv = Mfv.new()
    return mfv[0]

 



NanToZero

type

Algorithm that replaces all math.nan values with zeros in a series. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isnan
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def NanToZero(self, src: SeriesF) -> SeriesF:
    res = 0 if isnan(src[0]) else src[0]
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
import math
from indie import indicator, MutSeriesF
from indie.algorithms import NanToZero

@indicator('Example')
def Main(self):
    # Variable `s` is just an example of a series with `nan` values:
    s = MutSeriesF.new(math.nan)
    if self.close[0] > self.open[0]:
        s[0] = 0 if math.isnan(s[1]) else s[1] + 1
    # `NanToZero` replaces every `nan` value in `s` with zero
    s2 = NanToZero.new(s)
    return s2[0]
  • SEE ALSO

FixNan

 



NetVolume

type

Net volume algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Change


@algorithm
def NetVolume(self, src: SeriesF) -> SeriesF:
    der = Change.new(src)[0]
    nv = MutSeriesF.new(init=nan)
    if der > 0:
        nv[0] = self.ctx.volume[0]
    elif der < 0:
        nv[0] = -self.ctx.volume[0]
    elif der == 0:
        nv[0] = 0
    return nv
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import NetVolume

@indicator('Example')
def Main(self):
    nv = NetVolume.new(self.close)
    return nv[0]

 



PercentRank

type

Percent rank algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def PercentRank(self, src: SeriesF, length: int) -> SeriesF:
    num_leq = 0
    for idx in range(1, length + 1):
        if src[idx] <= src[0]:
            num_leq += 1
    return MutSeriesF.new(100.0 * num_leq / length)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import PercentRank

@indicator('Example')
def Main(self):
    pr = PercentRank.new(self.close, length=12)
    return pr[0]

 



Rma

type

RMA algorithm is a moving average algorithm that is used to calculate RSI. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isnan
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma


@algorithm
def Rma(self, src: SeriesF, length: int) -> SeriesF:
    '''RSI Moving Average'''
    result = MutSeriesF.new(init=0)
    if isnan(result[1]):
        result[0] = Sma.new(src, length)[0]
    else:
        result[0] = (src[0] + (length - 1) * result[1]) / length
    return result
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Rma

@indicator('My Indie 1', overlay_main_pane=True)
def Main(self):
    rma = Rma.new(self.close, length=12)
    return rma[0]

 



Roc

type

Rate of change algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan, isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Change


@algorithm
def Roc(self, src: SeriesF, length: int) -> SeriesF:
    '''Rate Of Change'''
    res = nan
    if not isclose(src[length], 0):
        res = 100 * Change.new(src, length)[0] / src[length]
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Roc

@indicator('Example')
def Main(self):
    roc = Roc.new(self.close, length=9)
    return roc[0]

 



Rsi

type

Relative strength index algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import NanToZero, Change, Rma


@algorithm
def Rsi(self, src: SeriesF, length: int) -> SeriesF:
    '''Relative Strength Index'''
    u = max(NanToZero.new(Change.new(src))[0], 0)  # upward change
    rma_u = Rma.new(MutSeriesF.new(u), length)

    d = max(-NanToZero.new(Change.new(src))[0], 0)  # downward change
    rma_d = Rma.new(MutSeriesF.new(d), length)

    res = 100.0
    if not isclose(rma_d[0], 0):
        rs = rma_u[0] / rma_d[0]
        res = 100 - 100 / (1 + rs)
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Rsi

@indicator('Example')
def Main(self):
    rsi = Rsi.new(self.close, length=12)
    return rsi[0]

 



SinceHighest

type

Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, MutSeriesF, SeriesF


@algorithm
def SinceHighest(self, src: SeriesF, length: int) -> SeriesF:
    offset = 0
    for idx in range(length):
        if src[idx] >= src[offset]:
            offset = idx
    return MutSeriesF.new(offset)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import SinceHighest

@indicator('Example')
def Main(self):
    sh = SinceHighest.new(self.high, length=10)
    return sh[0]
  • SEE ALSO

Highest

 



SinceLowest

type

Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, MutSeriesF, SeriesF


@algorithm
def SinceLowest(self, src: SeriesF, length: int) -> SeriesF:
    offset = 0
    for idx in range(length):
        if src[idx] <= src[offset]:
            offset = idx
    return MutSeriesF.new(offset)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import SinceLowest

@indicator('Example')
def Main(self):
    sl = SinceLowest.new(self.high, length=10)
    return sl[0]
  • SEE ALSO

Lowest

 



Sma

type

Simple moving average algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sum


@algorithm
def Sma(self, src: SeriesF, length: int) -> SeriesF:
    '''Simple Moving Average'''
    s = Sum.new(src, length)
    return MutSeriesF.new(s[0] / length)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Sma

@indicator('Example')
def Main(self):
    sma = Sma.new(self.close, length=12)
    return sma[0]

 



StdDev

type

Standard deviation algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import sqrt
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma


@algorithm
def StdDev(self, src: SeriesF, length: int) -> SeriesF:
    avg = Sma.new(src, length)
    sum_of_square_deviations = 0.0
    for i in range(length):
        dev = src[i] - avg[0]
        sum_of_square_deviations += dev * dev

    return MutSeriesF.new(sqrt(sum_of_square_deviations / length))
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import StdDev

@indicator('Example')
def Main(self):
    sd = StdDev.new(self.close, length=12)
    return sd[0]

 



Stoch

type

Stochastic algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Lowest, Highest


@algorithm
def Stoch(self, src: SeriesF, low: SeriesF, high: SeriesF, length: int) -> SeriesF:
    lowest_low = Lowest.new(low, length)[0]
    highest_high = Highest.new(high, length)[0]

    res = 100.0
    if not isclose(highest_high - lowest_low, 0):
        res = 100 * (src[0] - lowest_low) / (highest_high - lowest_low)
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Stoch

@indicator('Example')
def Main(self):
    s = Stoch.new(self.close, self.low, self.high, length=14)
    return s[0]

 



Sum

type

Sliding sum algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isnan, nan
from indie import algorithm, SeriesF, MutSeriesF


def nan_to_zero(val: float) -> float:
    return 0 if isnan(val) else val


@algorithm
def Sum(self, src: SeriesF, length: int) -> SeriesF:
    src.request_size(length + 1)
    nan_count = MutSeriesF.new(init=0)
    sum = MutSeriesF.new(init=0)  # TODO: Use Var[float].new for sum variable maybe?
    sum[0] += nan_to_zero(src[0])

    result = 0.0
    if isnan(src[0]):
        nan_count[0] += 1
        result = nan
    else:
        if len(src) - nan_count[0] > length:
            sum[0] -= src[length]
        if len(src) - nan_count[0] < length:
            result = nan
        else:
            result = sum[0]
    return MutSeriesF.new(result)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Sum

@indicator('Example')
def Main(self):
    s = Sum.new(self.close, length=10)
    return s[0]

 



Supertrend

type

Supertrend algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import isnan
from indie import algorithm, MutSeriesF, SeriesF
from indie.algorithms import Atr


def nan_to_val(maybe_nan: float, val: float) -> float:
    return val if isnan(maybe_nan) else maybe_nan


@algorithm
def Supertrend(self, factor: float, atr_period: int, ma_algorithm: str) -> tuple[SeriesF, SeriesF]:
    src = self.ctx.hl2
    atr = Atr.new(atr_period, ma_algorithm)
    upper_band = MutSeriesF.new(src[0] + factor * atr[0])
    lower_band = MutSeriesF.new(src[0] - factor * atr[0])
    prev_lower_band = nan_to_val(lower_band[1], 0)
    prev_upper_band = nan_to_val(upper_band[1], 0)
    lower_band[0] = lower_band[0] \
                    if lower_band[0] > prev_lower_band or self.ctx.close[1] < prev_lower_band \
                    else prev_lower_band
    upper_band[0] = upper_band[0] \
                    if upper_band[0] < prev_upper_band or self.ctx.close[1] > prev_upper_band \
                    else prev_upper_band
    direction: float
    super_trend = MutSeriesF.new(init=0)
    prev_super_trend = super_trend[1]
    if isnan(atr[1]):
        direction = 1.0
    elif prev_super_trend == prev_upper_band:
        direction = -1.0 if self.ctx.close[0] > upper_band[0] else 1.0
    else:
        direction = 1.0 if self.ctx.close[0] < lower_band[0] else -1.0
    super_trend[0] = lower_band[0] if direction < 0 else upper_band[0]
    return super_trend, MutSeriesF.new(direction)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator, color, Plot
from indie.algorithms import Supertrend

@indicator('Example', overlay_main_pane=True)
def Main(self):
    st, dir = Supertrend.new(factor=3.0, atr_period=10, ma_algorithm='SMA')
    c = color.RED if dir[0] > 0 else color.GREEN
    return Plot(st[0], color=c)

 



Tr

type

True range algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan, isnan
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def Tr(self, handle_na: bool = False) -> SeriesF:
    '''True Range'''
    res = nan if handle_na else self.ctx.high[0] - self.ctx.low[0]
    if not isnan(self.ctx.close[1]):
        res = max(
            self.ctx.high[0] - self.ctx.low[0],
            abs(self.ctx.high[0] - self.ctx.close[1]),
            abs(self.ctx.low[0] - self.ctx.close[1]),
        )
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Tr

@indicator('Example')
def Main(self):
    tr = Tr.new()
    return tr[0]

 



Tsi

type

True strength index algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan, isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Ema, Change


@algorithm
def DoubleSmooth(self, src: SeriesF, long_len: int, short_len: int) -> SeriesF:
    return Ema.new(Ema.new(src, long_len), short_len)


@algorithm
def Tsi(self, src: SeriesF, long_len: int, short_len: int) -> SeriesF:
    '''True Strength Index'''
    pc = Change.new(src)
    double_smoothed_pc = DoubleSmooth.new(pc, long_len, short_len)[0]
    abs_pc = MutSeriesF.new(abs(pc[0]))
    double_smoothed_abs_pc = DoubleSmooth.new(abs_pc, long_len, short_len)[0]
    res = nan
    if not isclose(double_smoothed_abs_pc, 0):
        res = double_smoothed_pc / double_smoothed_abs_pc
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Tsi

@indicator('Example')
def Main(self):
    tsi = Tsi.new(self.close, long_len=21, short_len=12)
    return tsi[0]

 



Vwap

type

Volume weighted average price algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import sqrt
from indie import algorithm, SeriesF, MutSeriesF
from datetime import datetime


@algorithm
def Vwap(self, src: SeriesF, anchor: str, std_dev_mult: float) -> tuple[SeriesF, SeriesF, SeriesF]:
    '''
    Volume Weighted Average Price
    anchor can be 'Day', 'Week', 'Month', 'Year'
    '''
    cum_weighted_price = MutSeriesF.new(init=0)
    cum_volume = MutSeriesF.new(init=0)
    vwap_values = MutSeriesF.new(init=0)
    vwap_sum = MutSeriesF.new(init=0)
    vwap_count = MutSeriesF.new(init=0)
    vwap_avg = MutSeriesF.new(init=0)
    vwap_dev_squares = MutSeriesF.new(init=0)
    vwap_std_dev = MutSeriesF.new(init=0)

    current_datetime = datetime.utcfromtimestamp(self.ctx.time[0])
    prev_datetime = datetime.utcfromtimestamp(self.ctx.time.get(1, 0))
    need_reset = False
    if anchor == 'Day' and (current_datetime.day != prev_datetime.day or
                            (current_datetime-prev_datetime).days >= 1):
        need_reset = True
    elif anchor == 'Week' and ((current_datetime.weekday() == 0 and prev_datetime.weekday() != 0) or
                               (current_datetime-prev_datetime).days >= 7):
        need_reset = True
    elif anchor == 'Month' and (current_datetime.month != prev_datetime.month or
                                (current_datetime-prev_datetime).days >= 31):
        need_reset = True
    elif anchor == 'Year' and current_datetime.year != prev_datetime.year:
        need_reset = True

    if need_reset:
        cum_weighted_price[0] = 0.0
        cum_volume[0] = 0.0
        vwap_sum[0] = 0.0
        vwap_count[0] = 0
        vwap_dev_squares[0] = 0.0

    cum_weighted_price[0] += src[0] * self.ctx.volume[0]
    cum_volume[0] += self.ctx.volume[0]
    vwap_values[0] = cum_weighted_price[0] / cum_volume[0]

    vwap_sum[0] += vwap_values[0]
    vwap_count[0] += 1
    vwap_avg[0] = vwap_sum[0] / vwap_count[0]
    vwap_dev_squares[0] += (vwap_values[0] - vwap_avg[0]) ** 2
    vwap_std_dev[0] = sqrt(vwap_dev_squares[0] / vwap_count[0])

    std_dev = std_dev_mult * vwap_std_dev[0]
    lower = MutSeriesF.new(vwap_values[0] - std_dev)
    upper = MutSeriesF.new(vwap_values[0] + std_dev)

    return vwap_values, upper, lower
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Vwap

@indicator('Example', overlay_main_pane=True)
def Main(self):
    main_line, upper, lower = Vwap.new(self.close, anchor='Day', std_dev_mult=1.0)
    return main_line[0], upper[0], lower[0]

 



Vwma

type

Volume weighted moving average algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from math import nan, isclose
from indie import algorithm, SeriesF, MutSeriesF
from indie.algorithms import Sma


@algorithm
def Vwma(self, src: SeriesF, length: int) -> SeriesF:
    '''Volume Weighted Moving Average'''
    src_vol = MutSeriesF.new(src[0] * self.ctx.volume[0])
    sma_src_vol = Sma.new(src_vol, length)
    sma_vol = Sma.new(self.ctx.volume, length)
    res = nan
    if not isclose(sma_vol[0], 0):
        res = sma_src_vol[0] / sma_vol[0]
    return MutSeriesF.new(res)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Vwma

@indicator('Example', overlay_main_pane=True)
def Main(self):
    vwma = Vwma.new(self.close, length=12)
    return vwma[0]

 



Wma

type

Weighted moving average algorithm. Read here about how to use it.
 

  • PARENTS

Algorithm

  • MEMBERS

__init__() calc() ctx new()

  • SOURCE CODE
# indie:lang_version = 4
from indie import algorithm, SeriesF, MutSeriesF


@algorithm
def Wma(self, src: SeriesF, length: int) -> SeriesF:
    '''Weighted Moving Average'''
    norm = 0.0
    s = 0.0
    for i in range(length):
        weight = length - i
        norm += weight
        s += src[i] * weight
    return MutSeriesF.new(s / norm)
  • EXAMPLE
# indie:lang_version = 4
from indie import indicator
from indie.algorithms import Wma

@indicator('Example', overlay_main_pane=True)
def Main(self):
    wma = Wma.new(self.close, length=12)
    return wma[0]

 


Functions

 


Adx.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Adx

 



Adx.calc()

method

Returns series of Minus Directional Indicator, Average Directional Index and Plus Directional Indicator.
 

  • SIGNATURES
calc(
  adx_len: int,
  di_len: int
) -> tuple[indie.Series[float], indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • adx_len — Number of bars to calculate smoothing.

    • di_len — Number of bars to calculate directional indicator.

  • SEE ALSO

Adx

 



Adx.new()

static method

Returns series of Minus Directional Indicator, Average Directional Index and Plus Directional Indicator.
 

  • SIGNATURES
new(
  adx_len: int,
  di_len: int
) -> tuple[indie.Series[float], indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • adx_len — Number of bars to calculate smoothing.

    • di_len — Number of bars to calculate directional indicator.

  • SEE ALSO

Adx

 



Atr.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Atr

 



Atr.calc()

method

Returns series of Average True Range values calculated for the length bars period using moving average specified by ma_algorithm argument.
 

  • SIGNATURES
calc(length: int, ma_algorithm: str = "RMA") -> indie.Series[float]
  • PARAMETERS

    • length — Number of bars in calculation taken into account.

    • ma_algorithm — Moving average algorithm name, should be one of 'EMA', 'SMA', 'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA'.

  • SEE ALSO

Atr

 



Atr.new()

static method

Returns series of Average True Range values calculated for the length bars period using moving average specified by ma_algorithm argument.
 

  • SIGNATURES
new(length: int, ma_algorithm: str = "RMA") -> indie.Series[float]
  • PARAMETERS

    • length — Number of bars in calculation taken into account.

    • ma_algorithm — Moving average algorithm name, should be one of 'EMA', 'SMA', 'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA'.

  • SEE ALSO

Atr

 



Bb.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Bb

 



Bb.calc()

method

Returns middle, upper and lower series of Bollinger Bands calculated on src series for the length bars period.
 

  • SIGNATURES
calc(
  src: indie.Series[float],
  length: int,
  mult: float
) -> tuple[indie.Series[float], indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

    • mult — Multiplier for standard deviation.

  • SEE ALSO

Bb

 



Bb.new()

static method

Returns middle, upper and lower series of Bollinger Bands calculated on src series for the length bars period.
 

  • SIGNATURES
new(
  src: indie.Series[float],
  length: int,
  mult: float
) -> tuple[indie.Series[float], indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

    • mult — Multiplier for standard deviation.

  • SEE ALSO

Bb

 



Cci.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Cci

 



Cci.calc()

method

Returns series of Commodity Channel Index values calculated on src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Cci

 



Cci.new()

static method

Returns series of Commodity Channel Index values calculated on src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Cci

 



Change.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Change

 



Change.calc()

method

Returns the difference between current src value and its value length bars ago.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int = 1) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars ago to compare the current value.

  • SEE ALSO

Change

 



Change.new()

static method

Returns the difference between current src value and its value length bars ago.
 

  • SIGNATURES
new(src: indie.Series[float], length: int = 1) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars ago to compare the current value.

  • SEE ALSO

Change

 



CumSum.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

CumSum

 



CumSum.calc()

method

Returns series of cumulative sum of src values.
 

  • SIGNATURES
calc(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

CumSum

 



CumSum.new()

static method

Returns series of cumulative sum of src values.
 

  • SIGNATURES
new(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

CumSum

 



Dev.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Dev

 



Dev.calc()

method

Returns series of Mean Absolute Deviation values calculated on src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Dev

 



Dev.new()

static method

Returns series of Mean Absolute Deviation values calculated on src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Dev

 



Donchian.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Donchian

 



Donchian.calc()

method

Returns series of Middle Channel of Donchian Channels calculated for the length bars period.
 

  • SIGNATURES
calc(length: int) -> indie.Series[float]
  • PARAMETERS

    • length — Number of bars in calculation taken into account.
  • SEE ALSO

Donchian

 



Donchian.new()

static method

Returns series of Middle Channel of Donchian Channels calculated for the length bars period.
 

  • SIGNATURES
new(length: int) -> indie.Series[float]
  • PARAMETERS

    • length — Number of bars in calculation taken into account.
  • SEE ALSO

Donchian

 



Ema.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Ema

 



Ema.calc()

method

Returns series of Exponential Moving Average values calculated on src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Ema

 



Ema.new()

static method

Returns series of Exponential Moving Average values calculated on src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Ema

 



FixNan.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

NanToZero.new() FixNan

 



FixNan.calc()

method

Returns series created from src by replacing math.nan values with previous nearest non-nan value.
 

  • SIGNATURES
calc(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

NanToZero.calc() FixNan

 



FixNan.new()

static method

Returns series created from src by replacing math.nan values with previous nearest non-nan value.
 

  • SIGNATURES
new(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

NanToZero.new() FixNan

 



Highest.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

SinceHighest.new() Highest

 



Highest.calc()

method

Returns maximum value of given src series over a period of length bars.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

SinceHighest.calc() Highest

 



Highest.new()

static method

Returns maximum value of given src series over a period of length bars.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

SinceHighest.new() Highest

 



Lowest.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

SinceLowest.new() Lowest

 



Lowest.calc()

method

Returns minimum value of given src series over a period of length bars.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

SinceLowest.calc() Lowest

 



Lowest.new()

static method

Returns minimum value of given src series over a period of length bars.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

SinceLowest.new() Lowest

 



Ma.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Ma

 



Ma.calc()

method

Returns a moving average of src specified by algorithm argument.
 

  • SIGNATURES
calc(
  src: indie.Series[float],
  length: int,
  algorithm: str
) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

    • algorithm — Moving average algorithm name, should be one of 'EMA', 'SMA', 'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA'.

  • SEE ALSO

Ma

 



Ma.new()

static method

Returns a moving average of src specified by algorithm argument.
 

  • SIGNATURES
new(
  src: indie.Series[float],
  length: int,
  algorithm: str
) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

    • algorithm — Moving average algorithm name, should be one of 'EMA', 'SMA', 'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA'.

  • SEE ALSO

Ma

 



Median.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Median

 



Median.calc()

method

Returns series of Moving Median values calculated from series of src for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Median

 



Median.new()

static method

Returns series of Moving Median values calculated from series of src for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Median

 



Mfv.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Mfv

 



Mfv.calc()

method

Returns series of Money Flow Volume.
 

  • SIGNATURES
calc() -> indie.Series[float]
  • SEE ALSO

Mfv

 



Mfv.new()

static method

Returns series of Money Flow Volume.
 

  • SIGNATURES
new() -> indie.Series[float]
  • SEE ALSO

Mfv

 



NanToZero.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

FixNan.new() NanToZero

 



NanToZero.calc()

method

Returns series created from src by replacing math.nan values with zeros.
 

  • SIGNATURES
calc(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

FixNan.calc() NanToZero

 



NanToZero.new()

static method

Returns series created from src by replacing math.nan values with zeros.
 

  • SIGNATURES
new(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

FixNan.new() NanToZero

 



NetVolume.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

NetVolume

 



NetVolume.calc()

method

Returns series of Net Volume values calculated on src series.
 

  • SIGNATURES
calc(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

NetVolume

 



NetVolume.new()

static method

Returns series of Net Volume values calculated on src series.
 

  • SIGNATURES
new(src: indie.Series[float]) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.
  • SEE ALSO

NetVolume

 



PercentRank.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

PercentRank

 



PercentRank.calc()

method

Returns series of Percent Rank (number of previous values that are less or equal to the current value) calculated on src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

PercentRank

 



PercentRank.new()

static method

Returns series of Percent Rank (number of previous values that are less or equal to the current value) calculated on src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

PercentRank

 



Rma.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Rma

 



Rma.calc()

method

Returns a Moving Average that is used in calculations of Rsi.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Rma

 



Rma.new()

static method

Returns a Moving Average that is used in calculations of Rsi.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Rma

 



Roc.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Roc

 



Roc.calc()

method

Returns series of Rate Of Change (percentage of change between the current value and value length bars ago) calculated on src series.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Roc

 



Roc.new()

static method

Returns series of Rate Of Change (percentage of change between the current value and value length bars ago) calculated on src series.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Roc

 



Rsi.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Rsi

 



Rsi.calc()

method

Returns series of Relative Strength Index values calculated on src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Rsi

 



Rsi.new()

static method

Returns series of Relative Strength Index values calculated on src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Rsi

 



SinceHighest.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Highest.new() SinceHighest

 



SinceHighest.calc()

method

Returns the number of bars after the maximum price for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Highest.calc() SinceHighest

 



SinceHighest.new()

static method

Returns the number of bars after the maximum price for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Highest.new() SinceHighest

 



SinceLowest.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Lowest.new() SinceLowest

 



SinceLowest.calc()

method

Returns the number of bars after the minimum price for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Lowest.calc() SinceLowest

 



SinceLowest.new()

static method

Returns the number of bars after the minimum price for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Lowest.new() SinceLowest

 



Sma.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Sma

 



Sma.calc()

method

Returns series of Simple Moving Average values calculated from series of src for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Sma

 



Sma.new()

static method

Returns series of Simple Moving Average values calculated from series of src for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Sma

 



StdDev.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

StdDev

 



StdDev.calc()

method

Returns series of Standard Deviation values calculated from series of src for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

StdDev

 



StdDev.new()

static method

Returns series of Standard Deviation values calculated from series of src for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

StdDev

 



Stoch.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Stoch

 



Stoch.calc()

method

Returns series of Stochastic on src series with high and low highs and lows of the source over a period of length bars.
 

  • SIGNATURES
calc(
  src: indie.Series[float],
  low: indie.Series[float],
  high: indie.Series[float],
  length: int
) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • low — Series of low values.

    • high — Series of high values.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Stoch

 



Stoch.new()

static method

Returns series of Stochastic on src series with high and low highs and lows of the source over a period of length bars.
 

  • SIGNATURES
new(
  src: indie.Series[float],
  low: indie.Series[float],
  high: indie.Series[float],
  length: int
) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • low — Series of low values.

    • high — Series of high values.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Stoch

 



Sum.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Sum

 



Sum.calc()

method

Returns series of Sliding Sum values calculated on src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Sum

 



Sum.new()

static method

Returns series of Sliding Sum values calculated on src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Sum

 



Supertrend.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Supertrend

 



Supertrend.calc()

method

Returns a tuple of two Supertrend series: Supertrend Line and Direction Of Trend.
 

  • SIGNATURES
calc(
  factor: float,
  atr_period: int,
  ma_algorithm: str
) -> tuple[indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • factor — The multiplier by which the ATR will get multiplied.

    • atr_period — Number of bars to calculate ATR.

    • ma_algorithm — Moving average algorithm name, should be one of 'EMA', 'SMA', 'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA'.

  • SEE ALSO

Supertrend

 



Supertrend.new()

static method

Returns a tuple of two Supertrend series: Supertrend Line and Direction Of Trend.
 

  • SIGNATURES
new(
  factor: float,
  atr_period: int,
  ma_algorithm: str
) -> tuple[indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • factor — The multiplier by which the ATR will get multiplied.

    • atr_period — Number of bars to calculate ATR.

    • ma_algorithm — Moving average algorithm name, should be one of 'EMA', 'SMA', 'SMMA (RMA)', 'RMA', 'VWMA' or 'WMA'.

  • SEE ALSO

Supertrend

 



Tr.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Tr

 



Tr.calc()

method

Returns series of True Range values.
 

  • SIGNATURES
calc(handle_na: bool = False) -> indie.Series[float]
  • PARAMETERS

    • handle_na — Flag that says how NaN close values of the previous day are handled.
  • SEE ALSO

Tr

 



Tr.new()

static method

Returns series of True Range values.
 

  • SIGNATURES
new(handle_na: bool = False) -> indie.Series[float]
  • PARAMETERS

    • handle_na — Flag that says how NaN close values of the previous day are handled.
  • SEE ALSO

Tr

 



Tsi.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Tsi

 



Tsi.calc()

method

Returns series of True Strength Index values.
 

  • SIGNATURES
calc(
  src: indie.Series[float],
  long_len: int,
  short_len: int
) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • long_len — Long length.

    • short_len — Short length.

  • SEE ALSO

Tsi

 



Tsi.new()

static method

Returns series of True Strength Index values.
 

  • SIGNATURES
new(
  src: indie.Series[float],
  long_len: int,
  short_len: int
) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • long_len — Long length.

    • short_len — Short length.

  • SEE ALSO

Tsi

 



Vwap.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Vwap

 



Vwap.calc()

method

Returns series of Volume Weighted Average Price values with band of its standard deviation.
 

  • SIGNATURES
calc(
  src: indie.Series[float],
  anchor: str,
  std_dev_mult: float
) -> tuple[indie.Series[float], indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • anchor — At what points in time do we need to reset the accumulated amounts. Valid values are: 'day', 'week', 'month', 'year'.

    • std_dev_mult — Multiplier for standard deviation.

  • SEE ALSO

Vwap

 



Vwap.new()

static method

Returns series of Volume Weighted Average Price values with band of its standard deviation.
 

  • SIGNATURES
new(
  src: indie.Series[float],
  anchor: str,
  std_dev_mult: float
) -> tuple[indie.Series[float], indie.Series[float], indie.Series[float]]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • anchor — At what points in time do we need to reset the accumulated amounts. Valid values are: 'day', 'week', 'month', 'year'.

    • std_dev_mult — Multiplier for standard deviation.

  • SEE ALSO

Vwap

 



Vwma.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Vwma

 



Vwma.calc()

method

Returns series of Volume Weighted Moving Average values calculated for src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Vwma

 



Vwma.new()

static method

Returns series of Volume Weighted Moving Average values calculated for src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Vwma

 



Wma.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(ctx: indie.Context) -> NoneType
  • PARAMETERS

    • ctx — Context object.
  • SEE ALSO

Wma

 



Wma.calc()

method

Returns series of Weighted Moving Average values calculated for src series for the length bars period.
 

  • SIGNATURES
calc(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Wma

 



Wma.new()

static method

Returns series of Weighted Moving Average values calculated for src series for the length bars period.
 

  • SIGNATURES
new(src: indie.Series[float], length: int) -> indie.Series[float]
  • PARAMETERS

    • src — Series data to perform the calculation.

    • length — Number of bars in calculation taken into account.

  • SEE ALSO

Wma

 



Package indie.color

Class-container for builtin colors and rgba function.
 

  • CONTENTS

AQUA BLACK BLUE FUCHSIA GRAY GREEN LIME MAROON NAVY OLIVE PURPLE RED rgba() SILVER TEAL WHITE YELLOW

  • SEE ALSO

Plot Fill Color

 


Functions

 


rgba()

function

Creates a Color object by its RGB components and alpha channel.
 

  • SIGNATURES
rgba(red: int, green: int, blue: int, alpha: float = 1.0) -> indie.Color
  • PARAMETERS

    • red — Red component of color.

    • green — Green component of color.

    • blue — Blue component of color.

    • alpha — Alpha channel (component) of color which ranges from 0.0 (fully transparent) to 1.0 (fully opaque).

 


Objects

 


AQUA

object

Built-in color.
 

  • TYPE

Color

 



BLACK

object

Built-in color.
 

  • TYPE

Color

 



BLUE

object

Built-in color.
 

  • TYPE

Color

 



FUCHSIA

object

Built-in color.
 

  • TYPE

Color

 



GRAY

object

Built-in color.
 

  • TYPE

Color

 



GREEN

object

Built-in color.
 

  • TYPE

Color

 



LIME

object

Built-in color.
 

  • TYPE

Color

 



MAROON

object

Built-in color.
 

  • TYPE

Color

 



NAVY

object

Built-in color.
 

  • TYPE

Color

 



OLIVE

object

Built-in color.
 

  • TYPE

Color

 



PURPLE

object

Built-in color.
 

  • TYPE

Color

 



RED

object

Built-in color.
 

  • TYPE

Color

 



SILVER

object

Built-in color.
 

  • TYPE

Color

 



TEAL

object

Built-in color.
 

  • TYPE

Color

 



WHITE

object

Built-in color.
 

  • TYPE

Color

 



YELLOW

object

Built-in color.
 

  • TYPE

Color

 



Package math

Math package.
 

  • CONTENTS

acos() asin() atan() ceil() cos() e exp() exp2() floor() isclose() isnan() log() log10() log2() nan pi pow() sin() sqrt() tan()

  • REMARKS

See description in the official Python docs.

 


Functions

 


acos()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
acos(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



asin()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
asin(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



atan()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
atan(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



ceil()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
ceil(float) -> int
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



cos()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
cos(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



exp()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
exp(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



exp2()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
exp2(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



floor()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
floor(float) -> int
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



isclose()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
isclose(float, float, rel_tol: float = 1e-9, abs_tol: float = 0.0) -> bool
  • PARAMETERS

    • <unnamed param> — First value to check for proximity.

    • <unnamed param> — Second value to check for proximity.

    • rel_tol — Relative tolerance for proximity check.

    • abs_tol — Absolute tolerance for proximity check.

 



isnan()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
isnan(float) -> bool
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



log()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
log(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



log10()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
log10(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



log2()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
log2(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



pow()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
pow(float, float) -> float
  • PARAMETERS

    • <unnamed param> — Base value to calculate exponentiation.

    • <unnamed param> — Exponent (power) value to calculate exponentiation.

 



sin()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
sin(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



sqrt()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
sqrt(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



tan()

function

Standard function of Indie math package (similar to Python's).
 

  • SIGNATURES
tan(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 


Objects

 


e

object

Standard constant of Indie math package (similar to Python's).
 

  • TYPE

float

 



nan

object

Standard constant of Indie math package (similar to Python's).
 

  • TYPE

float

 



pi

object

Standard constant of Indie math package (similar to Python's).
 

  • TYPE

float

 



Package statistics

Statistics package.
 

  • CONTENTS

fmean() mean() median()

  • REMARKS

See description in the official Python docs.

 


Functions

 


fmean()

function

Standard statistics function.
 

  • SIGNATURES
fmean(data: list[float]) -> float
  • PARAMETERS

    • data — List on which the function will be calculated.

 



mean()

function

Standard statistics function.
 

  • SIGNATURES
mean(data: list[float]) -> float
mean(data: list[int]) -> float
  • PARAMETERS

    • data — List on which the function will be calculated.

 



median()

function

Standard statistics function.
 

  • SIGNATURES
median(data: list[float]) -> float
  • PARAMETERS

    • data — List on which the function will be calculated.

 



Package datetime

The datetime package supplies classes for manipulating dates and times.
 

  • CONTENTS

datetime time timedelta

  • REMARKS

See description in the official Python docs.

 


Types

 


datetime

type

Represents date and time information.
 

  • MEMBERS

__add__() __init__() __sub__() day hour microsecond minute month second utcfromtimestamp() weekday() year

  • SEE ALSO

timedelta time

 



time

type

Represents a time of day, independent of any particular day.
 

  • MEMBERS

__add__() __init__() __sub__() hour microsecond minute second

  • SEE ALSO

datetime timedelta

 



timedelta

type

A timedelta object represents a duration, the difference between two datetimes.
 

  • MEMBERS

__init__() days microseconds seconds total_seconds()

  • SEE ALSO

datetime time

 


Functions

 


datetime.__add__()

method

+ operator for datetime objects.
 

  • SIGNATURES
__add__(delta: datetime.timedelta) -> datetime.datetime
  • PARAMETERS

    • delta — Timedelta to add to the current datetime.
  • SEE ALSO

datetime

 



datetime.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(
  year: int,
  month: int,
  day: int,
  hour: int = 0,
  minute: int = 0,
  second: int = 0,
  microsecond: int = 0
) -> NoneType
  • PARAMETERS

    • year — Year value.

    • month — Month value.

    • day — Day value.

    • hour — Hour value.

    • minute — Minute value.

    • second — Second value.

    • microsecond — Microsecond value.

  • SEE ALSO

datetime

 



datetime.__sub__()

method

- operator for datetime objects.
 

  • SIGNATURES
__sub__(delta: datetime.timedelta) -> datetime.datetime
__sub__(other: datetime.datetime) -> datetime.timedelta
  • PARAMETERS

    • delta — Timedelta to subtract from the current datetime.

    • other — Datetime to subtract from the current datetime.

  • SEE ALSO

datetime

 



datetime.utcfromtimestamp()

static method

Returns the UTC datetime corresponding to the POSIX timestamp.
 

  • SIGNATURES
utcfromtimestamp(timestamp: float) -> datetime.datetime
  • PARAMETERS

    • timestamp — Timestamp in UTC.
  • SEE ALSO

datetime

 



datetime.weekday()

method

Returns the day of the week as an integer, where Monday is 0 and Sunday is 6.
 

  • SIGNATURES
weekday() -> int
  • SEE ALSO

datetime

 



time.__add__()

method

+ operator for time objects.
 

  • SIGNATURES
__add__(delta: datetime.timedelta) -> datetime.datetime
  • PARAMETERS

    • delta — Timedelta to add to the current time.
  • SEE ALSO

time

 



time.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(
  hour: int = 0,
  minute: int = 0,
  second: int = 0,
  microsecond: int = 0
) -> NoneType
  • PARAMETERS

    • hour — Hour value.

    • minute — Minute value.

    • second — Second value.

    • microsecond — Microsecond value.

  • SEE ALSO

time

 



time.__sub__()

method

- operator for time objects.
 

  • SIGNATURES
__sub__(delta: datetime.timedelta) -> datetime.datetime
  • PARAMETERS

    • delta — Timedelta to subtract from the current time.
  • SEE ALSO

time

 



timedelta.__init__()

method

Class constructor (initializer for the data type).
 

  • SIGNATURES
__init__(
  days: int = 0,
  seconds: int = 0,
  microseconds: int = 0,
  milliseconds: int = 0,
  minutes: int = 0,
  hours: int = 0,
  weeks: int = 0
) -> NoneType
  • PARAMETERS

    • days — Number of days.

    • seconds — Number of seconds.

    • microseconds — Number of microseconds.

    • milliseconds — Number of milliseconds.

    • minutes — Number of minutes.

    • hours — Number of hours.

    • weeks — Number of weeks.

  • SEE ALSO

timedelta

 



timedelta.total_seconds()

method

Returns the total number of seconds contained in the duration.
 

  • SIGNATURES
total_seconds() -> float
  • SEE ALSO

timedelta

 


Objects

 


datetime.day

field

The day value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



datetime.hour

field

The hour value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



datetime.microsecond

field

The microsecond value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



datetime.minute

field

The minute value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



datetime.month

field

The month value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



datetime.second

field

The second value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



datetime.year

field

The year value of the datetime object.
 

  • TYPE

int

  • SEE ALSO

datetime

 



time.hour

field

The hour value of the time object.
 

  • TYPE

int

  • SEE ALSO

time

 



time.microsecond

field

The microsecond value of the time object.
 

  • TYPE

int

  • SEE ALSO

time

 



time.minute

field

The minute value of the time object.
 

  • TYPE

int

  • SEE ALSO

time

 



time.second

field

The second value of the time object.
 

  • TYPE

int

  • SEE ALSO

time

 



timedelta.days

field

The days value of the timedelta object.
 

  • TYPE

int

  • SEE ALSO

timedelta

 



timedelta.microseconds

field

The microseconds value of the timedelta object.
 

  • TYPE

int

  • SEE ALSO

timedelta

 



timedelta.seconds

field

The seconds value of the timedelta object.
 

  • TYPE

int

  • SEE ALSO

timedelta

 


Builtins

 

Types

 


NoneType

type

Builtin Indie type (similar to Python's None type).
 

  • MEMBERS

__bool__()

 



bool

type

Built-in Indie type (similar to Python's).
 

  • MEMBERS

__bool__() __init__()

 



dict[K, V]

type

Built-in Indie type (similar to Python's).
 

 



float

type

Built-in Indie type (similar to Python's).
 

  • MEMBERS

__bool__() __init__()

 



int

type

Built-in Indie type (similar to Python's).
 

  • MEMBERS

__bool__() __init__()

 



list[T]

type

Built-in Indie type (similar to Python's).
 

  • MEMBERS

__getitem__() __len__() __setitem__() append() pop() remove()

  • EXAMPLE
# examples of list creation:
a = [1, 2, 3]  # `a` has type `list[int]`
b = [1, 2, 3, 4.2]  # `b` has type `list[float]`
c = ["a", "b", "c"]  # `c` has type `list[str]`
d = [(1, "a"), (2, "b"), (3, "c")]  # `d` has type `list[tuple[int, str]]`

e = [0, 1, 2, 3, 4, 5, 6, 7]
f = e[2:5]  # `f` is `[2, 3, 4]`
g = e[:5]  # `g` is `[0, 1, 2, 3, 4]`
h = e[2:]  # `h` is `[2, 3, 4, 5, 6, 7]`
i = e[:]  # `i` is a copy of `e`
j = e[1:7:2]  # `j` is `[1, 3, 5]`
k = e[5:2:-1]  # `k` is `[5, 4, 3]`
l = e[5::-1]  # `l` is `[5, 4, 3, 2, 1, 0]`
m = e[::-1]  # `m` is `[7, 6, 5, 4, 3, 2, 1, 0]`

 



str

type

Built-in Indie type (similar to Python's).
 

  • MEMBERS

__bool__() __init__() __len__()

 



tuple[...]

type

Built-in Indie type (similar to Python's).
 

  • MEMBERS

__getitem__()

 


Functions

 


NoneType.__bool__()

method

Casts given none to bool.
 

  • SIGNATURES
__bool__() -> bool
  • SEE ALSO

NoneType

 



abs()

function

Returns the absolute value of a number. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
abs(int) -> int
abs(float) -> float
  • PARAMETERS

    • <unnamed param> — Number on which the function will be calculated.

 



bool.__bool__()

method

Casts given bool to bool.
 

  • SIGNATURES
__bool__() -> bool
  • SEE ALSO

bool

 



bool.__init__()

method

Cast constructor for built-in Indie type. Returns a bool value, i.e. one of True or False. The argument is converted using the standard Python's truth testing procedure. If the argument is false or omitted, this returns False; otherwise, it returns True.
 

  • SIGNATURES
__init__(bool) -> NoneType
__init__(int) -> NoneType
__init__(float) -> NoneType
__init__(str) -> NoneType
__init__(NoneType) -> NoneType
__init__(indie.Optional[bool]) -> NoneType
__init__(indie.Optional[int]) -> NoneType
__init__(indie.Optional[float]) -> NoneType
__init__(indie.Optional[str]) -> NoneType
  • PARAMETERS

    • <unnamed param> — Value to cast from.
  • SEE ALSO

bool

 



float.__bool__()

method

Casts given float to bool.
 

  • SIGNATURES
__bool__() -> bool
  • SEE ALSO

float

 



float.__init__()

method

Cast constructor for built-in Indie type. Returns a float number constructed from a number or a string.
 

  • SIGNATURES
__init__(float) -> NoneType
__init__(int) -> NoneType
__init__(str) -> NoneType
__init__(bool) -> NoneType
  • PARAMETERS

    • <unnamed param> — Value to cast from.
  • SEE ALSO

float

 



int.__bool__()

method

Casts given int to bool.
 

  • SIGNATURES
__bool__() -> bool
  • SEE ALSO

int

 



int.__init__()

method

Cast constructor for built-in Indie type. Returns an int object constructed from a number or a string, or return 0 if no arguments are given.
 

  • SIGNATURES
__init__(int) -> NoneType
__init__(float) -> NoneType
__init__(str) -> NoneType
__init__(bool) -> NoneType
  • PARAMETERS

    • <unnamed param> — Value to cast from.
  • SEE ALSO

int

 



len()

function

Returns the length (the number of items) of an object. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
len(str) -> int
len(list[float]) -> int
len(list[int]) -> int
len(list[str]) -> int
len(indie.Series[float]) -> int
len(indie.MutSeries[float]) -> int
  • PARAMETERS

    • <unnamed param> — String on which the function will be calculated.

    • <unnamed param> — List on which the function will be calculated.

    • <unnamed param> — Series on which the function will be calculated.

    • <unnamed param> — MutSeriesF on which the function will be calculated.

 



list[T].__getitem__()

method

Returns list element at given index or slice.
 

  • SIGNATURES
__getitem__(int) -> T
__getitem__(slice) -> list[T]
  • PARAMETERS

    • <unnamed param> — Index of an element in the list.

    • <unnamed param> — Slice of elements in the list, similar to Python slices. Slices allow to specify a start and end index, as well as a step size, in the format [start:stop:step]. Any of the slice indices can be omitted. See more examples here.

  • EXAMPLE

nums = [40, 41, 42, 43]
meaning_of_life = nums[2]  # returns 42 (this implicitly calls `nums.__getitem__(2)`)
  • REMARKS

Method __getitem__ should never be called directly, instead list_obj[key] syntax should be used.

  • SEE ALSO

list[T]

 



list[T].__len__()

method

Returns the length (the number of items) of a list[T].
 

  • SIGNATURES
__len__() -> int
  • EXAMPLE
nums = [40, 41, 42, 43]
len(nums)  # returns 4 (this implicitly calls `nums.__len__()`)
  • REMARKS

Method __len__ should never be called directly, instead len(list_obj) syntax should be used.

  • SEE ALSO

list[T]

 



list[T].__setitem__()

method

Called to implement assignment to some_list[key].
 

  • SIGNATURES
__setitem__(int, T) -> NoneType
  • PARAMETERS

    • <unnamed param> — Index of an element in the list.

    • <unnamed param> — New value that will be put to the list.

  • EXAMPLE

nums = [40, 41, 42, 43]
nums[2] = 100500  # this implicitly calls `nums.__setitem__(2, 100500)`
                  # and now `nums` are [40, 41, 100500, 43]
  • REMARKS

Method __setitem__ should never be called directly, instead list_obj[key] = value syntax should be used.

  • SEE ALSO

list[T]

 



list[T].append()

method

Appends given param to the end of the list.
 

  • SIGNATURES
append(T) -> NoneType
  • PARAMETERS

    • <unnamed param> — New value that will be put to the list.
  • SEE ALSO

list[T]

 



list[T].pop()

method

Retrieves the item at given index and also removes it from the list
 

  • SIGNATURES
pop(int) -> T
  • PARAMETERS

    • <unnamed param> — Index of an element in the list.
  • EXAMPLE

nums = [40, 41, 42, 43]
meaning_of_life = nums.pop(2)  # now `nums` are [40, 41, 43], `meaning_of_life` is 42
  • SEE ALSO

list[T]

 



list[T].remove()

method

Removes the first item from list s where s[i] is equal to given param.
 

  • SIGNATURES
remove(T) -> NoneType
  • PARAMETERS

    • <unnamed param> — Value that will be removed from the list
  • EXAMPLE

nums = [40, 41, 42, 40, 41, 42]
nums.remove(42)  # now `nums` are [40, 41, 40, 41, 42]
  • SEE ALSO

list[T]

 



max()

function

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
max(int, int) -> int
max(int, int, int) -> int
max(float, float) -> float
max(float, float, float) -> float
  • PARAMETERS

    • <unnamed param> — First number to calculate the function.

    • <unnamed param> — Second number to calculate the function.

    • <unnamed param> — Third number to calculate the function.

 



min()

function

Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
min(int, int) -> int
min(int, int, int) -> int
min(float, float) -> float
min(float, float, float) -> float
  • PARAMETERS

    • <unnamed param> — First number to calculate the function.

    • <unnamed param> — Second number to calculate the function.

    • <unnamed param> — Third number to calculate the function.

 



range()

function

Creates a list containing the specified range of numbers that is used in for loops. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
range(stop: int) -> list[int]
range(start: int, stop: int, step: int = 1) -> list[int]
  • PARAMETERS

    • stop — Last value of the range (exclusive).

    • start — First value of the range.

    • step — Step value of the range.

  • EXAMPLE

x = 0
for i in range(10):
    x += i
  • REMARKS

The behavior of this function is similar to Python's 2 built-in function range and is ineffective. This will be fixed in future versions of Indie.

 



round()

function

Returns number rounded to ndigits precision after the decimal point. If ndigits is omitted or is None, it returns the nearest integer to its input. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
round(number: float) -> int
round(number: float, ndigits: indie.Optional[int] = None) -> float
  • PARAMETERS

    • number — Number on which the function will be calculated.

    • ndigits — Rounding precision.

 



str.__bool__()

method

Casts given str to bool.
 

  • SIGNATURES
__bool__() -> bool
  • SEE ALSO

str

 



str.__init__()

method

Cast constructor for built-in Indie type. Returns a str version of object.
 

  • SIGNATURES
__init__(int) -> NoneType
__init__(float) -> NoneType
__init__(str) -> NoneType
__init__(bool) -> NoneType
  • PARAMETERS

    • <unnamed param> — Value to cast from.
  • SEE ALSO

str

 



str.__len__()

method

Returns the length (the number of characters) of a str.
 

  • SIGNATURES
__len__() -> int
  • EXAMPLE
s = 'foobar'
len(s)  # returns 6 (this implicitly calls `s.__len__()`)
  • REMARKS

Method __len__ should never be called directly, instead len(str_obj) syntax should be used.

  • SEE ALSO

str

 



sum()

function

Sums start and the items of a list from left to right and returns the total. It is a built-in Indie function (similar to Python's).
 

  • SIGNATURES
sum(list[int], start: int = 0) -> int
sum(list[float], start: float = 0.0) -> float
  • PARAMETERS

    • <unnamed param> — List on which the function will be calculated.

    • start — Initial value to calculate sum of the list.

 



tuple[...].__getitem__()

method

Returns tuple element at given index.
 

  • SIGNATURES
__getitem__(int) -> NoneType
  • PARAMETERS

    • <unnamed param> — Index of an element in the tuple.
  • REMARKS

Method __getitem__ should never be called directly, instead tuple_obj[key] syntax should be used.

  • SEE ALSO

tuple[...]

 


Objects

 


False

object

Built-in Indie object (similar to Python's).
 

  • TYPE

bool

 



None

object

Built-in Indie object (similar to Python's).
 

  • TYPE

NoneType

 



True

object

Built-in Indie object (similar to Python's).
 

  • TYPE

bool