lightningchart_trader package

Subpackages

Submodules

lightningchart_trader.heatmap module

class lightningchart_trader.heatmap.Heatmap(trader, start_x, start_y, end_x, end_y, data_values)[source]

Bases: object

dispose()[source]

Disposes the heatmap.

get_name()[source]

Gets the name of the heatmap. Returns None if no name is set.

set_data(data)[source]

Sets new data values to the heatmap.

Parameters:

data (list of lists of numbers) – A 2D array of new data values to update the heatmap.

set_interpolate(setInterpolate)[source]

Enables or disables the interpolation of the heatmap.

Parameters:

set_interpolate (bool) – Set to True to enable interpolation, False to disable it.

set_name(name)[source]

Sets the name of the heatmap.

Parameters:

ame (str) – The name to assign to the heatmap.

set_palette(palette_steps)[source]

Assigns a new set of steps for the palette used by the heatmap.

Parameters:
  • palette_steps (list of dicts) – A list of steps where each step has a ‘value’ and a ‘color’.

  • Example – [{‘value’: 0, ‘color’: ‘#0032FF1E’}, {‘value’: 50, ‘color’: ‘#00FF321E’}, {‘value’: 100, ‘color’: ‘#FFFF321E’}]

set_size(start_x, start_y, end_x, end_y)[source]

Sets the size of the heatmap using axis values.

Parameters:
  • start_x (int | float) – The starting X-coordinate.

  • start_y (int | float) – The starting Y-coordinate.

  • end_x (int | float) – The ending X-coordinate.

  • end_y (int | float) – The ending Y-coordinate.

show_in_result_table(show_in_table)[source]

Controls whether the heatmap is visible in the result table.

Parameters:

show_in_table (bool) – Set to True to show the heatmap in the result table, False otherwise.

lightningchart_trader.instance module

class lightningchart_trader.instance.Instance(license_key)[source]

Bases: object

close()[source]
get(id, command=None, arguments=None)[source]
open(method=None, live=False, width='100%', height=600)[source]
open_in_browser()[source]
open_in_notebook(width='100%', height=600)[source]
send(id, command, arguments=None)[source]
lightningchart_trader.instance.get_free_port()[source]

lightningchart_trader.kagi module

class lightningchart_trader.kagi.Kagi(instance, chart_id)[source]

Bases: object

set_atr_period_count(new_period_count)[source]

Sets the number of time periods (n) used to calculate the Average True Range (ATR). Used when the Kagi chart is based on ATR.

Parameters:

new_period_count (int) – New period count for ATR calculation.

set_kagi_base_type(base_type)[source]

Sets which values the Kagi chart is based on.

Parameters:

base_type (int) – The integer value of the base type. Valid values are: 0 (Close), 1 (HighLowRange), 2 (Percentage), 3 (ATR).

set_line_width(new_width)[source]

Sets the width of the Kagi lines. Thick lines will be slightly thicker than the given value.

Parameters:

new_width (float) – New line width.

set_reversal(box_size)[source]

Sets the reversal amount for the Kagi chart. The line will change direction when there is a price reversal of at least this amount.

Parameters:

box_size (float) – New reversal amount.

set_thick_line_color(color)[source]

Sets the color of the uptrend (thick) line.

Parameters:

color (str) – New line color as a string, should be in HEX format (e.g., #FFFFFF).

set_thin_line_color(color)[source]

Sets the color of the downtrend (thin) line.

Parameters:

color (str) – New line color as a string, should be in HEX format (e.g., #FFFFFF).

lightningchart_trader.menu_options module

class lightningchart_trader.menu_options.MenuOptions(trader)[source]

Bases: object

MenuOptions class provides methods to control various menu-related settings for the trading chart interface.

enable_drawing_tool_menus(enabled)[source]

Enable or disable drawing tool context menus.

Parameters:

enabled (bool) – True to enable drawing tool right-click menus, False to disable.

show_allow_hide_toolbar_checkbox(show_checkbox)[source]

Shows or hides the allow hide toolbar checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_angle_input(show_input)[source]

Shows or hides the angle input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_axis_color_input(show)[source]

Show or hide the axis color input.

show_axis_on_right_checkbox(show_checkbox)[source]

Shows or hides the axis on right checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_background_color_input(show_input)[source]

Shows or hides the background color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_border_checkbox(show)[source]

Show or hide the border visibility checkbox.

show_border_color_input(show)[source]

Show or hide the border color input.

show_chart_title_input(show_input)[source]

Shows or hides the chart title input in the menu.

Parameters:

show_input (bool) – Set True to show the chart title input, False to hide it.

show_currency_input(show_input)[source]

Shows or hides the currency input in the menu.

Parameters:

show_input (bool) – Set True to show the currency input, False to hide it.

show_cursor_tracking_dropdown(show_dropdown)[source]

Shows or hides the cursor tracking dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_data_limit_input(show)[source]

Show or hide the data point limit input.

show_data_packing_checkbox(show_checkbox)[source]

Shows or hides the data packing checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_enable_limit_checkbox(show)[source]

Show or hide the data point limit enable checkbox.

show_fill_style_dropdown(show_dropdown)[source]

Shows or hides the fill style dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_gradient_color_input(show_input)[source]

Shows or hides the gradient color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_gradient_speed_input(show_input)[source]

Shows or hides the gradient speed input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_horizontal_line_checkbox(show_checkbox)[source]

Shows or hides the horizontal line checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_line_color_input(show_input)[source]

Shows or hides the line color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_mountain_gradient_checkbox(show_checkbox)[source]

Shows or hides the mountain gradient checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_negative_body_input(show_input)[source]

Shows or hides the negative body color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_negative_wick_input(show_input)[source]

Shows or hides the negative wick color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_panning_dropdown(show_dropdown)[source]

Shows or hides the panning dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_percent_scale_checkbox(show_checkbox)[source]

Shows or hides the percent scale checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_positive_body_input(show_input)[source]

Shows or hides the positive body color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_positive_wick_input(show_input)[source]

Shows or hides the positive wick color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_radial_x_input(show_input)[source]

Shows or hides the radial X input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_radial_y_input(show_input)[source]

Shows or hides the radial Y input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_rectangle_zoom_dropdown(show_dropdown)[source]

Shows or hides the rectangle zoom dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_restrict_x_checkbox(show_checkbox)[source]

Shows or hides the restrict X checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_restrict_y_checkbox(show_checkbox)[source]

Shows or hides the restrict Y checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_result_table_dropdown(show_dropdown)[source]

Shows or hides the result table dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_sensitivity_input(show)[source]

Show or hide the zoom sensitivity input.

show_series_color_input(show_input)[source]

Shows or hides the series color input in the menu.

Parameters:

show_input (bool) – Set True to show the input, False to hide it.

show_shadow_glow_checkbox(show_checkbox)[source]

Shows or hides the shadow glow checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_show_file_selection_checkbox(show_checkbox)[source]

Shows or hides the show file selection checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_show_image_checkbox(show_checkbox)[source]

Shows or hides the show image checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_show_search_checkbox(show_checkbox)[source]

Shows or hides the show search checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_show_splitters_checkbox(show_checkbox)[source]

Shows or hides the show splitters checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_show_title_checkbox(show_checkbox)[source]

Shows or hides the show title checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_show_watermark_checkbox(show_checkbox)[source]

Shows or hides the show watermark checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_splitter_color_input(show)[source]

Show or hide the splitter color input.

show_theme_dropdown(show_dropdown)[source]

Shows or hides the theme dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_vertical_line_checkbox(show_checkbox)[source]

Shows or hides the vertical line checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_vertical_pan_checkbox(show_checkbox)[source]

Shows or hides the vertical pan checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_vertical_zoom_checkbox(show_checkbox)[source]

Shows or hides the vertical zoom checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

show_watermark_text_input(show_input)[source]

Shows or hides the watermark text input in the menu.

Parameters:

show_input (bool) – Set True to show the watermark text input, False to hide it.

show_wheel_zoom_dropdown(show_dropdown)[source]

Shows or hides the wheel zoom dropdown in the menu.

Parameters:

show_dropdown (bool) – Set True to show the dropdown, False to hide it.

show_x_axis_left_action_dropdown(show)[source]

Show or hide X-axis left button action dropdown.

show_x_axis_right_action_dropdown(show)[source]

Show or hide X-axis right button action dropdown.

show_y_axis_left_action_dropdown(show)[source]

Show or hide Y-axis left button action dropdown.

show_y_axis_right_action_dropdown(show)[source]

Show or hide Y-axis right button action dropdown.

show_zoom_band_checkbox(show_checkbox)[source]

Shows or hides the zoom band checkbox in the menu.

Parameters:

show_checkbox (bool) – Set True to show the checkbox, False to hide it.

lightningchart_trader.point_and_figure module

class lightningchart_trader.point_and_figure.PointAndFigure(instance, chart_id)[source]

Bases: object

set_atr_period_count(newPeriodCount)[source]

Sets the number of time periods (n) used to calculate the Average True Range (ATR). Used when the Point-and-Figure chart is based on ATR.

Parameters:

newPeriodCount (number) – New period count for ATR calculation.

set_box_size(boxSize)[source]

Sets the box size amount for the Point-and-Figure chart. The price needs to move at least this amount for a new X or O to be created.

Parameters:

boxSize (number) – New box size amount.

set_o_color(color)[source]

Sets the color of the O-figures/columns.

Parameters:

color (str) – New line color as a string, should be in HEX format (e.g., #FFFFFF).

set_point_and_figure_base_type(base_type)[source]

Sets which values the Point-and-Figure chart is based on.

Parameters:

base_type (int) – The integer value of the base type. Valid values are: 0 (Close), 1 (HighLowRange), 2 (Percentage), 3 (ATR).

set_reversal_amount(reversal)[source]

Sets the reversal amount for the Point-and-Figure chart. A new X- or O-column will be created when there is a price reversal of at least this amount.

Parameters:

reversal (int) – New reversal amount.

set_x_color(color)[source]

Sets the color of the X-figures/columns.

Parameters:

color (str) – New line color as a string, should be in HEX format (e.g., #FFFFFF).

lightningchart_trader.renko module

class lightningchart_trader.renko.Renko(instance, chart_id)[source]

Bases: object

set_atr_period_count(period_count)[source]

Set the ATR period count for the Renko chart.

Parameters:

period_count (int) – Sets the number of time periods (n) used to calculate the Average True Range (ATR). Used when Renko chart is based on ATR.

set_box_size(box_size)[source]

Set the box size for the Renko chart.

Parameters:

box_size (int) – Sets box size value for the Renko chart. A new brick will be drawn when the price moves above or below the previous brick by this amount.

set_renko_base_type(base_type)[source]

Set the base type for the Renko chart.

Parameters:

base_type (int) – The integer value of the base type. Valid values are: 0 (Close), 1 (HighLowRange), 2 (Percentage), 3 (ATR).

lightningchart_trader.technical_analysis_methods module

class lightningchart_trader.technical_analysis_methods.TechnicalAnalysisMethods(trader)[source]

Bases: object

calculate_accumulation_distribution(close_values, high_values, low_values, volumes)[source]

Calculates Accumulation/distribution indicator (A/D) values based on given OHLC and Volume values.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

Returns:

An array of Accumulation/Distribution values, or null if calculations are not possible with given values.

calculate_accumulative_swing_index(open_values, high_values, low_values, close_values, limit_move_value)[source]

Calculates Accumulative Swing Index (ASI) values using given data and maximum price change (limit move) values.

Parameters:
  • open_values (list[int | float]) – OHLC-data Open values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • limit_move_value (int | float) – Maximum price change in one direction.

Returns:

An array of Accumulative Swing Index values, or null if calculations are not possible with given values.

calculate_aroon(high_values, low_values, n)[source]

Calculates Aroon Up and Aroon Down values using given number of time periods (n).

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Time period count.

Returns:

An array containing two arrays, the first one has Aroon Up values and the second one Aroon Down values. Returns null if calculations are not possible with given values.

calculate_aroon_oscillator(high_values, low_values, n)[source]

Calculates Aroon Oscillator values using given number of time periods (n).

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Time period count.

Returns:

An array of Aroon Oscillator values, or null if calculations are not possible with given values.

calculate_average_directional_index(close_values, high_values, low_values, n)[source]

Calculates Average Directional Index (ADX) values. Returns also values for Directional Movement Indicators (-DI and +DI).

Parameters:
  • close_values (list[int | float]) – OHLC data Close values.

  • high_values (list[int | float]) – OHLC data High values.

  • low_values (list[int | float]) – OHLC data Low values.

  • n (int) – Period count.

Returns:

An array containing three arrays, the first one has ADX values, the second one -DI values, and the third one +DI values. Returns null if calculations are not possible with given values.

calculate_average_true_range(close_values, high_values, low_values, n)[source]

Calculates Average True Range values using given number of time periods (n).

Parameters:
  • close_values (list[int | float]) – OHLC data Close values.

  • high_values (list[int | float]) – OHLC data High values.

  • low_values (list[int | float]) – OHLC data Low values.

  • n (int) – Period count.

Returns:

An array of Average True Range values, or null if calculations are not possible with given values.

calculate_awesome_oscillator(high_values, low_values, short_period_count, long_period_count)[source]

Calculates Awesome Oscillator values using given short-term and long-term time period counts.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • short_period_count (int) – Short-term period count.

  • long_period_count (int) – Long-term period count.

Returns:

An array of Awesome Oscillator values, or null if calculations are not possible with given values.

calculate_balance_of_power(open_values, high_values, low_values, close_values, n, moving_average_type)[source]

Calculates Balance of Power (BOP) values using given moving average type and number of time periods (n) for smoothing.

Parameters:
  • open_values (list[int | float]) – OHLC-data Open values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • n (int) – Time period count.

  • moving_average_type (int) – The type of moving average to use between 0 and 9.

Returns:

An array of Balance of Power values, or null if calculations are not possible with given values.

calculate_bollinger_band(source_values, close_values, high_values, low_values, n, standard_deviation_multiplier)[source]

Calculates Bollinger Band values based on given number of time periods.

Parameters:
  • source_values (list[int | float]) – Data values used as a basis for calculations, most commonly OHLC-data Close values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Period count.

  • standard_deviation_multiplier (int | float) – Number of standard deviations between the moving average line and the upper and the lower bands.

Returns:

An array containing three arrays. The first array has the middle band values, the second has the upper band values, and the third one the lower band values. Returns null if calculations are not possible with given parameters.

calculate_center_of_gravity(data_values, n, signal_periods)[source]

Calculates Center of Gravity (COG) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

  • signal_periods (int) – Period count for the Signal line.

Returns:

the first one has COG values and the second one Signal values.

Return type:

An array containing two arrays

calculate_chaikin_money_flow(close_values, high_values, low_values, volumes, period_count)[source]

Calculates Chaikin Money Flow values using given number of time periods.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • period_count (int) – Period count.

Returns:

An array of Chaikin Money Flow values, or null if calculations are not possible with given values.

calculate_chaikin_oscillator(close_values, high_values, low_values, volumes, fast_period_count, slow_period_count)[source]

Calculates Chaikin Oscillator values using given number of fast and slow time periods.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • fast_period_count (int) – Fast period count.

  • slow_period_count (int) – Slow period count.

Returns:

An array of Chaikin Oscillator values, or null if calculations are not possible with given values.

calculate_chaikin_volatility(high_values, low_values, period_count, period_count_ma, moving_average_type)[source]

Calculates Chaikin Volatility using given values and moving average.

Args: high_values: OHLC-data High values. low_values: OHLC-data Low values. period_count: Period count for Chaikin Volatility. period_count_ma: Period count for the moving average used in calculations. moving_average_type: Moving average type (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of Chaikin Volatility values, or null if calculations are not possible with given values.

calculate_chande_forecast_oscillator(data_values, n)[source]

Calculates Chande Forecast Oscillator (CFO) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of CFO values, or null if calculations are not possible with given values.

calculate_chande_momentum_oscillator(data_values, n)[source]

Calculates Chande Momentum Oscillator (CMO) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of CMO values, or null if calculations are not possible with given values.

calculate_commodity_channel_index(close_values, high_values, low_values, n)[source]

Calculates Commodity Channel Index (CCI) values using given number of time periods (n).

Parameters:
  • close_values (list[int | float]) – OHLC data Close values.

  • high_values (list[int | float]) – OHLC data High values.

  • low_values (list[int | float]) – OHLC data Low values.

  • n (int) – Period count.

Returns:

Array of Commodity Channel Index values, or null if calculation is not possible with given values.

calculate_coppock_curve(data_values, period_count_long_roc, period_count_short_roc, period_count_wma)[source]

Calculates Coppock Curve values using given time period counts.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • period_count_long_roc (int) – Period count for long Rate of Change.

  • period_count_short_roc (int) – Period count for short Rate of Change.

  • period_count_wma (int) – Period count for Weighted Moving Average.

Returns:

An array of Coppock Curve values, or null if calculations are not possible with given values.

calculate_correlation_coefficient(data_values1, data_values2, n)[source]

Calculates Correlation Coefficient between the two given datasets.

Parameters:
  • data_values1 (list[int | float]) – First dataset values.

  • data_values2 (list[int | float]) – Second dataset values.

  • n (int) – Time period count.

Returns:

An array of Correlation Coefficient values, or null if calculations are not possible with given values.

calculate_detrended_price_oscillator(data_values, n, moving_average_type)[source]

Calculates Detrended Price Oscillator (DPO) values using given moving average type and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

  • moving_average_type (int) – Moving average to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of DPO values, or null if calculations are not possible with given values.

calculate_donchian_channels(high_values, low_values, n)[source]

Calculates values for Donchian Channels using given period count (n).

Parameters:
  • high_values (list[int | float]) – OHLC data High values.

  • low_values (list[int | float]) – OHLC data Low values.

  • n (int) – Period count.

Returns:

An array containing three arrays. The first array has the upper band values, the second has the lower band values, and the third one the middle band values. Returns null if calculations are not possible with given parameters.

calculate_ease_of_movement(high_values, low_values, volumes, n, scale, moving_average_type=2)[source]

Calculates Ease of Movement (EOM) values based on given number of time periods (n).

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • n (int) – Period count.

  • scale (int | float) – Scale for the Volume values to keep them compatible with the other values.

  • moving_average_type (int) – Moving average to use during calculations. Defaults to 2. (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of EOM values, or null if calculations are not possible with given values.

calculate_ehler_fisher_transform(high_values, low_values, period_count, raw_smoothing_periods, fisher_smoothing_periods, signal_period_count)[source]

Calculates Ehler Fisher Transform (EFT) values based on given time period counts.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count (int) – The number of overall time periods (lookup periods).

  • raw_smoothing_periods (int) – The number of time periods used for raw smoothing before fisher transform.

  • fisher_smoothing_periods (int) – The number of time periods used for final smoothing with EMA.

  • signal_period_count (int) – The number of time periods used to calculate the signal line.

Returns:

the first one has EFT-values and the second one Signal values. Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_elder_ray_index(source_values, high_values, low_values, n, moving_average_type)[source]

Calculates Elder-Ray Index (Elder-Ray Power Indicator) using given moving average type and number of time periods (n).

Parameters:
  • source_values (list[int | float]) – Data values used as a basis for calculations, most commonly OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Period count.

  • moving_average_type (int) – Moving average to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

the first one has Bull Power values and the second one Bear Power values. Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_elder_thermometer_custom(high_values, low_values, n)[source]

Calculates custom Elder Thermometer using given number of time periods.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Time period count.

Returns:

Thermometer Bull values and Thermometer Bear values.

Return type:

An array containing two arrays

calculate_elders_force_index(data_values, volumes, n)[source]

Calculates Elder’s Force Index (EFI) using the given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

  • n (int) – Period count.

Returns:

An array of EFI values, or null if calculations are not possible with given values.

calculate_exponential_moving_average(values, n)[source]

Calculates Exponential Moving Average using given number of time periods (n).

Parameters:
  • values (list[int | float]) – Data values to calculate from.

  • n (int) – The number of values to use in averaging each round (period count).

Returns:

Array of Exponential Moving Average values, or null if averaging is not possible for the given values.

calculate_fractal_chaos_bands(high_values, low_values, period_count)[source]

Calculates Fractal Chaos Bands based on the given values and number of time periods.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count (int) – The number of bars/candles needed to form a fractal.

Returns:

An array containing two arrays; the first one has the upper band values and the second lower band values. Returns null if calculations are not possible with given values.

calculate_fractal_chaos_oscillator(high_values, low_values, period_count)[source]

Calculates Fractal Chaos Oscillator (FCO) using given number of time periods.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count (int) – The number of bars/candles needed to form a fractal.

Returns:

An array of FCO values, or null if calculations are not possible with given values.

calculate_gopalakrishnan_range_index(high_values, low_values, n)[source]

Calculates Gopalakrishnan Range Index (GAPO) values based on given number of time periods (n).

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Period count.

Returns:

An array of GAPO values, or null if calculations are not possible with given values.

calculate_high_low_bands(data_values, n, percentage)[source]

Calculates High Low Bands based on given data values and period count. Uses Triangular Moving Average to calculate the middle band.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

  • percentage (int | float) – Percentage of the TMA line to position the upper and lower bands.

Returns:

An array containing three arrays. The first array has the middle band values, the second has the upper band values, and the third one the lower band values. Returns null if calculations are not possible with given parameters.

calculate_high_minus_low(high_values, low_values)[source]

Calculates High Minus Low values.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

Returns:

An array of High Minus Low values, or null if calculations are not possible with given values.

calculate_historical_volatility_index(data_values, n, periods_per_year, standard_deviations, use_moving_average)[source]

Calculates Historical Volatility Index (HVI) using given number of time periods.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

  • periods_per_year (int) – The number of time periods used for annualizing the indicator.

  • standard_deviations (int | float) – The number of standard deviations used in calculations.

  • use_moving_average (bool) – Whether Simple Moving average is used to smooth the standard deviations values during the calculations.

Returns:

An array of HVI values, or null if calculations are not possible with given values.

calculate_ichimoku_cloud(high_values, low_values, tenkan_sen_period_count, kijun_sen_period_count, senkou_span_b_period_count)[source]

Calculates various values related to Ichimoku Cloud.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • tenkan_sen_period_count (int) – Tenkan-Sen (Conversion Line) period count.

  • kijun_sen_period_count (int) – Kijun-Sen (Base Line) period count.

  • senkou_span_b_period_count (int) – Senkou Span B (Leading Span B) period count.

Returns:

Tenkan-Sen, Kijun-Sen, Senkou Span A, and Senkou Span B values. Returns null if calculations are not possible with given values.

Return type:

An array of arrays containing

calculate_intraday_momentum_index(open_values, close_values, n)[source]

Calculates Intraday Momentum Index (IMI) values using given number of time periods (n).

Parameters:
  • open_values (list[int | float]) – OHLC-data Open values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • n (int) – Period count.

Returns:

An array of IMI values, or null if calculations are not possible with given values.

calculate_keltner_channels(close_values, high_values, low_values, period_count_ema, period_count_atr, multiplier)[source]

Calculates values Keltner Channels. Uses Exponential Moving Average (EMA) of the typical price for the middle line and Average True Range (ATR) for the upper and lower bands.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count_ema (int) – Period count for EMA.

  • period_count_atr (int) – Period count for ATR.

  • multiplier (int | float) – Multiplier for ATR.

Returns:

an array for EMA values, an array for upper channel values, and an array for lower channel values. Returns null if calculations are not possible with given values.

Return type:

An array containing three arrays

calculate_klinger_volume_oscillator(close_values, high_values, low_values, volumes, short_period_count, long_period_count, signal_period_count, moving_average_type, moving_average_signal)[source]

Calculates Klinger Volume Oscillator (KVO) using given time period count and moving average types.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • short_period_count (int) – Time period count for the shorter moving average.

  • long_period_count (int) – Time period count for the longer moving average.

  • signal_period_count (int) – Time period count for the Signal line.

  • moving_average_type (int) – Moving average to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • moving_average_signal (int) – Moving average used to calculate the Signal line (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array containing three arrays. The first has the KVO values, the second the Signal values, and the third has the histogram values. Returns null if calculations are not possible with given values.

calculate_kurtosis(data_values, n, moving_average_type)[source]

Calculates Kurtosis values based on given moving average type and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

  • moving_average_type (int) – Moving average to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of Kurtosis values, or null if calculations are not possible with given values.

calculate_linear_regression(data_values, period_count)[source]

Calculates Linear Regression indicator values using given number of time periods.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • period_count (int) – Time period count.

Returns:

Linear Regression Slope, Intercept, Forecast, and R Squared values. Returns null if calculations are not possible with given values.

Return type:

An array containing four data arrays

calculate_macd(data_values, long_period, short_period, signal_period)[source]

Calculates MACD, Signal Line, and Histogram.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • long_period (int) – Long period count.

  • short_period (int) – Short period count.

  • signal_period (int) – Signal period count.

Returns:

MACD values, Signal values, and Histogram values. Returns null if calculations are not possible with given values.

Return type:

An array containing three arrays

calculate_macd_custom(data_values, short_period, long_period, signal_period, moving_average_short, moving_average_long, moving_average_signal)[source]

Calculates MACD, Signal Line, and Histogram using given moving average types.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • short_period (int) – Short period count.

  • long_period (int) – Long period count.

  • signal_period (int) – Signal period count.

  • moving_average_short (int) – Moving average type (0-9) for short moving average (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • moving_average_long (int) – Moving average type (0-9) for long moving average (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • moving_average_signal (int) – Moving average type (0-9) for signal line (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

MACD values, Signal values, and Histogram values. Returns null if calculations are not possible with given values.

Return type:

An array containing three arrays

calculate_market_facilitation_index(high_values, low_values, volumes)[source]

Calculates Market Facilitation Index values.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

Returns:

MFI values and bar colors as numbers (1=green, 2=blue, 3=pink, 4=brown). Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_mass_index(high_values, low_values, n)[source]

Calculates Mass Index values using given number of time periods (n).

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Period count.

Returns:

An array of Mass Index values, or null if calculations are not possible with given values.

calculate_median_price(high_values, low_values)[source]

Calculates Median Prices based on given High and Low values.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

Returns:

An array of Median Prices, or null if calculations are not possible with given values.

calculate_momentum_oscillator(data_values, n)[source]

Calculates Momentum Oscillator values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

Returns:

An array of Momentum Oscillator values, or null if calculations are not possible with given values.

calculate_money_flow_index(close_values, high_values, low_values, volumes, n)[source]

Calculates Money Flow Index values using given number of time periods (n).

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • n (int) – Period count.

Returns:

An array of Money Flow Index values, or null if calculations are not possible with given values.

calculate_moving_average_envelopes(data_values, n, percentage, moving_average_type)[source]

Calculates Moving Average Envelopes based on given values and moving average type.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count for the moving average.

  • percentage (int | float) – Percentage of the moving average line to position the upper and lower bands.

  • moving_average_type (int) – The moving average type used to calculate the envelopes (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array containing three arrays. The first array has the middle band values, the second has the upper band values, and the third one the lower band values. Returns null if calculations are not possible with given parameters.

calculate_negative_volume_index(data_values, volumes)[source]

Calculates Negative Volume Index (NVI) values based on given data and volume values.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

Returns:

An array of NVI values, or null if calculations are not possible with given values.

calculate_on_balance_volume(data_values, volumes, start_obv=0)[source]

Calculates On-Balance Volume values based on given data and Volume values.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

  • start_obv (int | float) – Optional starting value to which Volume values are added or subtracted from. Defaults to 0.

Returns:

An array of On-Balance Volume values, or null if calculations are not possible with given values.

calculate_parabolic_sar(high_values, low_values, acceleration_factor, maximum_acceleration_factor)[source]

Calculates Parabolic SAR values using given values.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • acceleration_factor (int | float) – Acceleration Factor. Used as an initial values and as an incremental value.

  • maximum_acceleration_factor (int | float) – Maximum value for Acceleration Factor.

Returns:

An array of Parabolic SAR values. Return null if calculations are not possible with given values.

calculate_percentage_price_oscillator(data_values, long_period, short_period, signal_period)[source]

Calculates Percentage Price Oscillator values using given number of time periods (n). Returns also Signal and Histogram values.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • long_period (int) – Long period count.

  • short_period (int) – Short period count.

  • signal_period (int) – Signal period count.

Returns:

PPO values, Signal values, and Histogram values. Returns null if calculations are not possible with given values.

Return type:

An array containing three arrays

calculate_performance_index(data_values)[source]

Calculates Performance Index values.

Parameters:

data_values (list[int | float]) – Data values to calculate from.

Returns:

An array of Performance Index values, or null if calculations are not possible with given values.

calculate_positive_volume_index(data_values, volumes)[source]

Calculates Positive Volume Index (PVI) values based on given data and volume values.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

Returns:

An array of PVI values, or null if calculations are not possible with given values.

calculate_pretty_good_oscillator(source_values, close_values, high_values, low_values, period_count_ma, period_count_atr, moving_average_ma, moving_average_atr)[source]

Calculates Pretty Good Oscillator (PGO) values using given number of time periods and moving average types.

Parameters:
  • source_values (list[int | float]) – Data values used as a basis for calculations, most commonly OHLC-data Close values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count_ma (int) – The number of time periods used to calculate the moving averages.

  • period_count_atr (int) – The number of time periods used to calculate the Average True Range.

  • moving_average_ma (int) – The type of the OHLC-data based moving average (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • moving_average_atr (int) – The type of the Average True Range based moving average (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of PGO values, or null if calculations are not possible with given values.

calculate_price_volume_trend(data_values, volumes)[source]

Calculates Price Volume Trend (PVT) using given price and volume values.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

Returns:

An array of PVT values, or null if calculations are not possible with given values.

calculate_prime_number_bands(data_values)[source]

Calculates Prime Number Bands based on given values.

Parameters:

data_values (list[int | float]) – Data values to calculate from.

Returns:

An array containing two arrays. The first one has upper bands values and the second lower band values. Returns null if calculations are not possible with given values.

calculate_prime_number_oscillator(data_values)[source]

Calculates Prime Number Oscillator (PNO) values based on given data values.

Parameters:

data_values (list[int | float]) – Data values to calculate from.

Returns:

An array of PNO values, or null if calculations are not possible with given values.

calculate_q_stick(open_values, close_values, n, moving_average_type)[source]

Calculates QStick values using given moving average and number of time periods (n).

Parameters:
  • open_values (list[int | float]) – OHLC-data Open values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • n (int) – Period count.

  • moving_average_type (int) – Moving average to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of QStick values, or null if calculations are not possible with given values.

calculate_rainbow_oscillator(data_values, period_count, lookback_periods, smoothing_levels, moving_average_type)[source]

Calculates Rainbow Oscillator values using given parameters and moving average type.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • period_count (int) – The number of time periods used for calculating the series of moving averages.

  • lookback_periods (int) – The number of time periods checked when finding out the highest and lowest prices.

  • smoothing_levels (int) – The number of times the oscillator is smoothed by calculating a moving average.

  • moving_average_type (int) – Moving average type used for calculating the series of averages (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

Rainbow Oscillator values, upper band values, and lower band values. Returns null if calculations are not possible with given values.

Return type:

An array containing three arrays

calculate_random_walk_index(close_values, high_values, low_values, n)[source]

Calculates Random Walk Index (RWI) values using given number of time periods (n).

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Time period count.

Returns:

RWI High values and RWI Low values. Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_range_action_verification_index(data_values, period_count_short, period_count_long, moving_average_short, moving_average_long)[source]

Calculates Range Action Verification Index (RAVI) using given moving average types and time period counts.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • period_count_short (int) – Period count for the shorter moving average.

  • period_count_long (int) – Period count for the longer moving average.

  • moving_average_short (int) – The type of the shorter moving average (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • moving_average_long (int) – The type of the longer moving average (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of RAVI values, or null if calculations are not possible with given values.

calculate_rate_of_change(data_values, n)[source]

Calculates Rate of Change (ROC) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

Array of Rate of Change values, or null if calculation is not possible with given values.

calculate_relative_strength_index(values, n)[source]

Calculates Relative Strength Index (RSI) using given number of time periods, N.

Parameters:
  • values (list[int | float]) – Values to calculate from.

  • n (int) – Number of values over which the smoothing calculation is applied.

Returns:

Array of Relative Strength Index values, or null if calculations are not possible.

calculate_schaff_trend_cycle(data_values, macd_short_periods, macd_long_periods, first_stoch_periods, first_stoch_k_periods, first_stoch_d_periods, second_stoch_periods, second_stoch_k_periods, second_stoch_d_periods, macd_short_ma, macd_long_ma, first_stoch_k_ma, first_stoch_d_ma, second_stoch_k_ma, second_stoch_d_ma)[source]

Calculates Schaff Trend Cycle (STC) values using given time period counts and moving averages.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • macd_short_periods (int) – The short period count for MACD calculations.

  • macd_long_periods (int) – The long period count for MACD calculations.

  • first_stoch_periods (int) – The time period count used to calculate the first Stochastic, that is the lookback periods when finding the highest and lowest values.

  • first_stoch_k_periods (int) – The time period count used to smooth the first Stochastic (%K).

  • first_stoch_d_periods (int) – The time period count used to calculate the first %D values.

  • second_stoch_periods (int) – The time period count used to calculate the second Stochastic, that is the lookback periods when finding the highest and lowest values.

  • second_stoch_k_periods (int) – The time period count used to smooth the second Stochastic (%K).

  • second_stoch_d_periods (int) – The time period count used to calculate the second %D values, in other words the final STC values.

  • macd_short_ma (int) – Moving average type (0-9) to calculate the short moving average during MACD calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • macd_long_ma (int) – Moving average type (0-9) to calculate the long moving average during MACD calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • first_stoch_k_ma (int) – Moving average type (0-9) to calculate the first Stochastic %K values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • first_stoch_d_ma (int) – Moving average type (0-9) to calculate the first Stochastic %D values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • second_stoch_k_ma (int) – Moving average type (0-9) to calculate the second Stochastic %K values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • second_stoch_d_ma (int) – Moving average type (0-9) to calculate the second Stochastic %D values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of STC values, or null if calculations are not possible with given values.

calculate_schaff_trend_cycle_signal(data_values, macd_short_periods, macd_long_periods, macd_signal_periods, first_stoch_periods, first_stoch_k_periods, first_stoch_d_periods, second_stoch_periods, second_stoch_k_periods, second_stoch_d_periods, macd_short_ma, macd_long_ma, macd_signal_ma, first_stoch_k_ma, first_stoch_d_ma, second_stoch_k_ma, second_stoch_d_ma)[source]

Calculates Schaff Trend Cycle (STC) values using given time period counts and moving averages. This version uses MACD’s Signal line as basis for Stochastic calculations.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • macd_short_periods (int) – The short period count for MACD calculations.

  • macd_long_periods (int) – The long period count for MACD calculations.

  • macd_signal_periods (int) – The signal period count for MACD calculations.

  • first_stoch_periods (int) – The time period count used to calculate the first Stochastic, that is the lookback periods when finding the highest and lowest values.

  • first_stoch_k_periods (int) – The time period count used to smooth the first Stochastic (%K).

  • first_stoch_d_periods (int) – The time period count used to calculate the first %D values.

  • second_stoch_periods (int) – The time period count used to calculate the second Stochastic, that is the lookback periods when finding the highest and lowest values.

  • second_stoch_k_periods (int) – The time period count used to smooth the second Stochastic (%K).

  • second_stoch_d_periods (int) – The time period count used to calculate the second %D values, in other words the final STC values.

  • macd_short_ma (int) – Moving average type (0-9) to calculate the short moving average during MACD calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • macd_long_ma (int) – Moving average type (0-9) to calculate the long moving average during MACD calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • macd_signal_ma (int) – Moving average type (0-9) to calculate the signal line during MACD calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • first_stoch_k_ma (int) – Moving average type (0-9) to calculate the first Stochastic %K values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • first_stoch_d_ma (int) – Moving average type (0-9) to calculate the first Stochastic %D values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • second_stoch_k_ma (int) – Moving average type (0-9) to calculate the second Stochastic %K values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • second_stoch_d_ma (int) – Moving average type (0-9) to calculate the second Stochastic %D values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of STC values, or null if calculations are not possible with given values.

calculate_simple_moving_average(values, n)[source]

Calculates Simple Moving Average using given averaging frame length (window length, or period count N).

Parameters:
  • values (list[int | float]) – Data values to calculate from.

  • n (int) – The number of values to use in averaging each round (period count).

Returns:

Array of Simple Moving Average values, or null if averaging is not possible for the given values.

calculate_skewness(data_values, n, moving_average_type)[source]

Calculates Skewness values based on given moving average type and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

  • moving_average_type (int) – The type of moving average (0-9) to use (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of Skewness values, or null if calculations are not possible with given values.

calculate_sqn_trend(data_values, n, moving_average_type)[source]

Calculates SQN Trend (System Quality Number) using given values, moving average type and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

  • moving_average_type (int) – Moving average type (0-9) used during calculations.

Returns:

An array of SQN Trend values, or null if calculations are not possible with given values.

calculate_standard_deviation(data_values, n, movingAverageType)[source]

Calculates Standard Deviation values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

  • movingAverageType (int) – The type of moving average to use between 0 and 9.

Returns:

An array of Standard Deviation values, or null if calculations are not possible with given values.

calculate_standard_error(data_values, n, moving_average_type)[source]

Calculates Standard Error values using given moving average and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Period count.

  • moving_average_type (int) – Moving average type (0-9) to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of Standard Error values, or null if calculations are not possible with given values.

calculate_standard_error_bands(data_values, n, multiplier, moving_average_type)[source]

Calculates Standard Error Bands values using given moving average type and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

  • multiplier (int | float) – Multiplier for the standard error used when calculating upper and lower bands.

  • moving_average_type (int) – The type of moving average (0-9) to use (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array containing three arrays. The first array has the middle band values, the second has the upper band values, and the third one the lower band values. Returns null if calculations are not possible with given parameters.

calculate_stochastic_momentum_index(close_values, high_values, low_values, period_count, first_smooth_periods, double_smooth_periods, moving_average_periods, oscillator_moving_average, ma_moving_average)[source]

Calculates Stochastic Momentum Index (SMI) values using given moving average types and time period counts.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count (int) – The number of time periods to calculate the stochastic (%K) line. This is the lookback period for High/Low range.

  • first_smooth_periods (int) – The number of time periods used for the first smoothing of the stochastic (%K) values.

  • double_smooth_periods (int) – The number of time periods used for the second (double) smoothing of the stochastic (%K) values.

  • moving_average_periods (int) – The number of time periods used to calculate the moving average (%D) line.

  • oscillator_moving_average (int) – The moving average type (0-9) used to smooth the oscillator (%K) line (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • ma_moving_average (int) – The moving average type (0-9) used to calculate the moving average (%D) line (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

the first one has SMI values (%K) while the second one has moving average values (%D). Returns null if calculations are not possible with given values.

Return type:

An array of two arrays

calculate_stochastic_oscillator(close_values, high_values, low_values, n, moving_average_periods)[source]

Calculates Stochastic Oscillator values using given number of time periods (n).

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – The number of time periods used to calculate the oscillator.

  • moving_average_periods (int) – The number of time periods used to calculate the moving average.

Returns:

Stochastic Oscillator values and moving average values. Returns null if calculation is not possible with given values.

Return type:

An array containing two arrays

calculate_stochastic_oscillator_smoothed(close_values, high_values, low_values, oscillator_periods, oscillator_smoothing_periods, moving_average_periods, oscillator_moving_average, ma_moving_average)[source]

Calculates Smoothed Stochastic Oscillator values using given moving average types and time period counts.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • oscillator_periods (int) – The number of time periods used to calculate the stochastic (%K) values.

  • oscillator_smoothing_periods (int) – The number of time periods used to smooth the stochastic (%K) values.

  • moving_average_periods (int) – The number of time periods used to calculate the moving average (%D) values.

  • oscillator_moving_average (int) – The moving average type (0-9) used to smooth the stochastic (%K) values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • ma_moving_average (int) – The moving average type (0-9) used to calculate the moving average (%D) values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

stochastic (%K) values and moving average (%D) values. Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_stoller_average_channels(source_values, close_values, high_values, low_values, period_count_ma, period_count_atr, multiplier, moving_average_type)[source]

Calculates Stoller Average Range Channels (STARC) using given moving average type and number of time periods.

Parameters:
  • source_values (list[int | float]) – Data values used as a basis for calculations, most commonly OHLC-data Close values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count_ma (int) – Period count for the moving average.

  • period_count_atr (int) – Period count for the Average True Range.

  • multiplier (int | float) – Multiplier for the Average True Range.

  • moving_average_type (int) – The type of moving average (0-9) to use (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

moving average values, upper channel values, and lower channel values. Returns null if calculations are not possible with given values.

Return type:

An array containing three arrays

calculate_super_trend(close_values, high_values, low_values, period_count, multiplier)[source]

Calculates Supertrend values using given number of time periods.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • period_count (int) – Period count.

  • multiplier (int | float) – Multiplier for ATR.

Returns:

An array of Supertrend values, or null if calculations are not possible with values.

calculate_swing_index(open_values, high_values, low_values, close_values, limit_move_value)[source]

Calculates Swing Index (SI) values using given data and maximum price change (limit move) values.

Parameters:
  • open_values (list[int | float]) – OHLC-data Open values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • limit_move_value (int | float) – Maximum price change in one direction.

Returns:

An array of Swing Index values, or null if calculations are not possible with given values.

calculate_time_series_moving_average(data_values, n)[source]

Calculates Time Series Moving Average (TSMA) values using given number of time periods (n). Uses least squares regression fitting.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of TSMA values, or null if calculations are not possible with given values.

calculate_trade_volume_index(data_values, volumes, minimum_tick_value)[source]

Calculates Trade Volume Index (TVI) values using given minimum tick value.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

  • minimum_tick_value (int | float) – Minimum tick value to be used in the calculations.

Returns:

An array of TVI values, or null if calculations are not possible with given values.

calculate_triangular_moving_average(data_values, n)[source]

Calculates Triangular Moving Average (TMA) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of TMA values, or null if calculations are not possible with given values.

calculate_triple_exponential_average(data_values, n)[source]

Calculates Triple Exponential Average (TRIX) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

Triple Exponential Average values and 9-day Exponential Moving Average values. Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_true_strength_index(data_values, price_change_periods, first_smooth_periods, double_smooth_periods, signal_periods, first_smooth_moving_average, double_smooth_moving_average, signal_moving_average)[source]

Calculates True Strength Index (TSI) values using given time period counts and moving average types.

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • price_change_periods (int) – Time periods used to calculate the price change (value - value n periods ago).

  • first_smooth_periods (int) – Time periods used to calculate the first smoothing.

  • double_smooth_periods (int) – Time periods used to calculate the second (double) smoothing.

  • signal_periods (int) – Time periods used to calculate the signal values.

  • first_smooth_moving_average (int) – Moving average type (0-9) used for the first smoothing (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • double_smooth_moving_average (int) – Moving average type (0-9) used for the second (double) smoothing (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • signal_moving_average (int) – Moving average type (0-9) used to calculate the signal values (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

TSI values and signal values. Returns null if calculations are not possible with given values.

Return type:

An array containing two arrays

calculate_twiggs_money_flow(close_values, high_values, low_values, volumes, n)[source]

Calculates Twiggs Money Flow values using given OHLC- and Volume values and number of time periods (n).

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • n (int) – Period count.

Returns:

An array of Twiggs Money Flow values, or null if calculations are not possible with given values.

calculate_typical_price(high_values, low_values, close_values)[source]

Calculates Typical Prices based on given High, Low and Close values.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • close_values (list[int | float]) – OHLC-data Close values.

Returns:

An array of Typical Prices, or null if calculations are not possible with given values.

calculate_ultimate_oscillator(close_values, high_values, low_values, short_periods, mid_periods, long_periods)[source]

Calculates Ultimate Oscillator (UO) values using given time period counts.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • short_periods (int) – Period count for the shortest average.

  • mid_periods (int) – Period count for the middle average.

  • long_periods (int) – Period count for the longest average.

Returns:

An array of Ultimate Oscillator values, or null if calculations are not possible with given values.

calculate_ultimate_oscillator_smoothed(close_values, high_values, low_values, short_periods, mid_periods, long_periods, moving_average_type)[source]

Calculates Ultimate Oscillator Smoothed (UO ST) values using given time period counts and moving average.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • short_periods (int) – Period count for the shortest average.

  • mid_periods (int) – Period count for the middle average.

  • long_periods (int) – Period count for the longest average.

  • moving_average_type (int) – Moving average type (0-9) to be used in smoothing (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of Ultimate Oscillator ST values, or null if calculations are not possible with given values.

calculate_variable_moving_average(data_values, n)[source]

Calculates Variable Moving Average (VMA) values using the given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of VMA values, or null if calculations are not possible with given values.

calculate_vertical_horizontal_filter(data_values, n)[source]

Calculates Vertical Horizontal Filter (VHF) using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of VHF values, or null if calculations are not possible with given values.

calculate_vidya(data_values, n, period_count_st_dev_short, period_count_st_dev_long)[source]

Calculates Variable Index Dynamic Average (VIDYA) values using given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

  • period_count_st_dev_short (int) – Short standard deviation period count used in VIDYA calculations.

  • period_count_st_dev_long (int) – Long standard deviation period count used in VIDYA calculations.

Returns:

An array of VIDYA values, or null if calculations are not possible with given values.

calculate_volume_oscillator(volumes, short_period_count, long_period_count, signal_period_count, calculate_as_percentage, moving_average_type, moving_average_signal)[source]

Calculates Volume Oscillator (VO) using the given time period counts and moving average types.

Parameters:
  • volumes (list[int | float]) – Volume values to calculate from.

  • short_period_count (int) – Short-term period count.

  • long_period_count (int) – Long-term period count.

  • signal_period_count (int) – Period count for signal line.

  • calculate_as_percentage (bool) – When enabled, the difference between the short and long moving averages is calculated as a percentage and not as an actual volume difference.

  • moving_average_type (int) – Moving average type (0-9) for the short and long averages (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

  • moving_average_signal (int) – Moving average type (0-9) for the signal line (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array containing three arrays. The first has the VO values, the second the Signal values, and the third has the histogram values. Returns null if calculations are not possible with given values.

calculate_volume_rate_of_change(volumes, n)[source]

Calculates Volume Rate of Change (VROC) values using given number of time periods (n).

Parameters:
  • volumes (list[int | float]) – Volumes values to calculate from.

  • n (int) – Period count.

Returns:

An array of VROC values, or null if calculations are not possible with given values.

calculate_volume_weighted_moving_average(values, volumes, n)[source]

Calculates Volume Weighted Moving Average (VWMA) values using the given number of time periods (n).

Parameters:
  • values (list[int | float]) – Data values to calculate from.

  • volumes (list[int | float]) – Volume values.

  • n (int) – Time period count.

Returns:

An array of VWMA values, or null if calculations are not possible with given values.

calculate_weighted_close(high_values, low_values, close_values)[source]

Calculates Weighted Close values based on given High, Low and Close values.

Parameters:
  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • close_values (list[int | float]) – OHLC-data Close values.

Returns:

An array of Weighted Close values, or null if calculations are not possible with given values.

calculate_weighted_moving_average(values, n)[source]

Calculates Weighted Moving Average using given number of time periods (n).

Parameters:
  • values (list[int | float]) – Data values to calculate from.

  • n (int) – The number of values to use in averaging each round (period count).

Returns:

Array of Weighted Moving Average values, or null if averaging is not possible for the given values.

calculate_welles_wilder_smoothing(data_values, n)[source]

Calculates Welles Wilder Smoothing (WWS) for the data values using the given number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

Returns:

An array of WWS values, or null if calculations are not possible with given values.

calculate_williams_accumulation_distribution(close_values, high_values, low_values, use_volume, volumes=None)[source]

Calculates Williams Accumulation Distribution (WAD) values.

Parameters:
  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • use_volume (bool) – Sets whether to take Volume into account during calculations.

  • volumes (list[int | float]) – Volume values. Can be null if useVolume is set false (Volume values not incorporated into calculations).

Returns:

An array of WAD values, or null if calculations are not possible with given values.

calculate_williams_percent_range(source_values, high_values, low_values, n)[source]

Calculates Williams Percent Range values using given number of time periods (n).

Parameters:
  • source_values (list[int | float]) – Data values used as a basis for calculations, most commonly OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • n (int) – Time period count.

Returns:

An array of Williams Percent Range values, or null if calculations are not possible with given values.

calculate_williams_variable_accumulation_distribution(open_values, close_values, high_values, low_values, volumes, n, moving_average_type)[source]

Calculates Williams Variable Accumulation Distribution (WVAD) values using given moving average and number of time periods (n).

Parameters:
  • open_values (list[int | float]) – OHLC-data Open values.

  • close_values (list[int | float]) – OHLC-data Close values.

  • high_values (list[int | float]) – OHLC-data High values.

  • low_values (list[int | float]) – OHLC-data Low values.

  • volumes (list[int | float]) – Volume values.

  • n (int) – Period count.

  • moving_average_type (int) – Moving average type (0-9) to use during calculations (0=EMA, 1=None, 2=SMA, 3=TSMA, 4=TMA, 5=VMA, 6=VIDYA, 7=VWMA, 8=WMA, 9=WWS).

Returns:

An array of WVAD values, or null if calculations are not possible with given values.

calculate_z_value(data_values, n, movingAverageType)[source]

Calculates Z-Value values based on given moving average type and number of time periods (n).

Parameters:
  • data_values (list[int | float]) – Data values to calculate from.

  • n (int) – Time period count.

  • movingAverageType (int) – The type of moving average to use between 0 and 9.

Returns:

An array of Z-Values, or null if calculations are not possible with given values.

linear_regression(x_in_factorization, y_in_factorization, x_values_to_fit)[source]

Calculate linear line fit for given points.

Parameters:
  • x_in_factorization (list[int | float]) – X-values that are used to calculate the factors. This is the point set where the regression line is fitted to.

  • y_in_factorization (list[int | float]) – Y-values that are used to calculate the factors. Length must be equal to xInFactorization length.

  • x_values_to_fit (list[int | float]) – X-values whose Y values are to be solved, using the factors.

Returns:

Array containing fitted Y-values. Returns null if unable to calculate with given values.

lightningchart_trader.trader module

class lightningchart_trader.trader.Dashboard(instance, parent_chart_id, rows, cols, color_theme=None, axis_on_right=None, license_key=None, html_text_rendering=None, load_from_storage=None)[source]

Bases: object

add_chart(chart_type, row_index, column_index, row_span=1, column_span=1, title=None, load_from_storage=None)[source]

Adds a chart to the dashboard at specified position.

Parameters:
  • chart_type (str) – The type of the chart to set. Example values: ‘CandleStick’, ‘Bar’, ‘Line’, ‘Mountain’, ‘HeikinAshi’, ‘Renko’, ‘Kagi’, ‘PointAndFigure’.

  • row_index (int) – Row index (0-based) where the chart will be located. First row is 0.

  • column_index (int) – Column index (0-based) where the chart will be located. First column is 0.

  • row_span (int) – How many rows the chart will occupy (height). Default = 1.

  • column_span (int) – How many columns the chart will occupy (width). Default = 1.

  • title (str, optional) – The title of the chart. If None, no title will be set. Default = None.

load_csv_to_all_charts(csv, dataset_name='', delimiter=',')[source]

Load CSV data to all charts in the dashboard.

Parameters:
  • csv (str) – Path to the CSV file or CSV file content as string.

  • dataset_name (str, optional) – Name of the dataset, shown as the chart title. Defaults to ‘’.

  • delimiter (str, optional) – Delimiter used in the CSV file. Defaults to ‘,’.

class lightningchart_trader.trader.DashboardChart(instance, chart_id)[source]

Bases: TAChart

Individual chart within a dashboard

set_chart_title(title)[source]

Sets the title of this dashboard chart.

class lightningchart_trader.trader.TAChart(license_key, html_text_rendering=True, load_from_storage=False, axis_on_right=None, theme=None)[source]

Bases: object

add_accumulation_distribution()[source]

Adds the Accumulation/Distribution indicator to the chart.

The Accumulation/Distribution indicator is a volume-based indicator designed to measure the cumulative flow of money into and out of a security.

add_accumulative_swing_index()[source]

Adds the Accumulative Swing Index (ASI) indicator to the chart.

The Accumulative Swing Index (ASI) is a trend-following indicator that quantifies price swings and helps identify trends in the market.

add_aroon(period_count=25)[source]

Adds the Aroon indicator to the chart.

The Aroon indicator is used to identify trend changes in the price of an asset, as well as the strength of that trend. It consists of the Aroon-Up and Aroon-Down lines, which show how many periods have passed since the highest high and lowest low, respectively.

Parameters:

period_count (int) – The number of periods used to calculate the Aroon indicator.

add_aroon_oscillator(period_count=25)[source]

Adds the Aroon Oscillator to the chart.

The Aroon Oscillator is used to determine the strength of a trend and the likelihood of its continuation. It is derived from the difference between the Aroon-Up and Aroon-Down indicators.

Parameters:

period_count (int) – The number of periods used to calculate the Aroon Oscillator.

add_arrow(x_position, y_position)[source]

Adds an Arrow to the chart.

Parameters:
  • x_position (int | float) – X-value for the cross point.

  • y_position (int | float) – Y-value for the cross point.

add_average_directional_index(period_count=14)[source]

Adds the Average Directional Index (ADX) to the chart.

The ADX is used to measure the strength of a trend, whether it’s upward or downward. It does not indicate the direction of the trend, only the strength of it. A higher ADX value means a stronger trend.

Parameters:

period_count (int) – The number of periods used to calculate the ADX.

add_average_true_range(period_count=14)[source]

Adds the Average True Range (ATR) indicator to the chart.

The ATR is a volatility indicator that measures the degree of price fluctuation. It does not indicate the direction of the price movement, but rather the magnitude of recent volatility.

Parameters:

period_count (int) – The number of periods used to calculate the ATR.

add_awesome_oscillator()[source]

Adds the Awesome Oscillator (AO) to the chart.

The Awesome Oscillator is a momentum indicator used to measure market momentum by comparing the most recent 5-period moving average with the 34-period moving average of the price. It is primarily used to confirm trends or anticipate potential reversals.

add_balance_of_power()[source]

Adds the Balance of Power (BOP) indicator to the chart.

The Balance of Power is an indicator that measures the strength of buying and selling pressure. It helps to identify potential reversals or continuation of trends based on the balance between buyers and sellers.

Parameters:

period_count (int) – The number of periods over which the Balance of Power will be calculated.

add_bollinger_band(period_count=14)[source]

Adds the Bollinger Bands indicator to the chart.

Bollinger Bands are a volatility indicator that plots an upper and lower band based on standard deviations from a moving average, helping to identify overbought or oversold conditions.

Parameters:

period_count (int) – The number of periods to use for the moving average.

add_center_of_gravity()[source]

Adds the Center of Gravity indicator to the chart.

The Center of Gravity indicator is a leading indicator that identifies turning points in the market.

add_chaikin_money_flow(period_count=21)[source]

Adds the Chaikin Money Flow indicator to the chart.

The Chaikin Money Flow measures the accumulation/distribution over a period of time, indicating buying or selling pressure.

Parameters:

period_count (int) – The number of periods to calculate the money flow.

add_chaikin_oscillator(fast_period_count=3, slow_period_count=10)[source]

Adds the Chaikin Oscillator to the chart.

The Chaikin Oscillator is a momentum indicator derived from the accumulation/distribution line of the market.

Parameters:
  • fast_period_count (int) – The fast period for the calculation.

  • slow_period_count (int) – The slow period for the calculation.

add_chaikin_volatility()[source]

Adds the Chaikin Volatility indicator to the chart.

This indicator measures the volatility by comparing the spread between a security’s high and low prices.

add_chande_forecast_oscillator(period_count=14)[source]

Adds the Chande Forecast Oscillator to the chart.

This oscillator measures the difference between the price and a linear regression forecast over a period.

Parameters:

period_count (int) – The number of periods to calculate the oscillator.

add_chande_momentum_oscillator(period_count=9)[source]

Adds the Chande Momentum Oscillator to the chart.

This oscillator is used to measure momentum over a specified period of time.

Parameters:

period_count (int) – The number of periods for calculating momentum.

add_commodity_channel_index(period_count=20)[source]

Adds the Commodity Channel Index (CCI) to the chart.

The CCI is an oscillator that helps to identify cyclical trends in commodities or other securities.

Parameters:

period_count (int) – The number of periods for the CCI calculation.

add_coppock_curve()[source]

Adds the Coppock Curve to the chart.

The Coppock Curve is a long-term momentum indicator used to identify major bottoms in the stock market.

add_correlation_coefficient()[source]

Adds the Correlation Coefficient indicator to the chart.

The Correlation Coefficient measures the strength of the relationship between two variables.

add_cross_line(x_position, y_position)[source]

Adds Cross Line to the chart. Draws horizontal and vertical lines crossing at the selected point of the chart.

Parameters:
  • x_position (int | float) – X-position for the cross point.

  • y_position (int | float) – Y-position for the cross point.

add_custom_overlay()[source]

Adds a Custom Overlay indicator to the chart.

Custom overlays allow you to create and apply custom formulas or calculations.

add_custom_study()[source]

Adds a Custom Study to the chart.

Custom studies allow for the creation and application of unique trading strategies and calculations.

add_cycle_lines(startX, startY, endX=None, endY=None)[source]

Adds Cycle Lines tool to the chart.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_data_array(data, scroll=False)[source]

Add an array of data points to the existing chart data.

Parameters:
  • data (Union[dict, list, DataFrame]) – The dataset to be added. Can be a list of dictionaries, raw lists of OHLC data, or a single dictionary.

  • scroll (bool) – Whether to scroll data, dropping the oldest data points.

Examples

>>> ### Using a list of lists: Ensure OHLC values come first, followed by dateTime, then optional fields.
>>> data = [
>>>     [1.9, 1.9, 1.7, 1.85, "Thu, 01 Jan 1970 00:00:00 GMT+0000"],
>>>     [2.0, 2.0, 1.8, 1.95, "04 Dec 1995", 1200, 300]
>>> ]
>>> trader.add_data_array(data)
>>> ### Using mixed list: Ensure OHLC values come first, followed by dateTime, then optional fields.
>>> data = [
>>>     {'open': 1.1, 'high': 1.2, 'low': 1.0, 'close': 1.15, 'dateTime': "Jan 1, 1970", 'volume': 350},
>>>     [1.9, 1.9, 1.7, 1.85, "Thu, 01 Jan 1970 00:00:00 GMT+0000"],
>>>     {'open': 2.0, 'high': 2.0, 'low': 1.8, 'close': 1.95, 'dateTime': "04 Dec 1995", 'volume': 1200, 'openInterest': 300}
>>> ]
>>> trader.add_data_array(data)
>>> ### Using a single dictionary
>>> data = {'open': 1.6, 'high': 1.7, 'low': 1.5, 'close': 1.65, 'dateTime': "2022-12-31"}
>>> trader.add_data_array(data)
>>> ### Using a DataFrame
>>> df = pd.read_csv('data/Tesla.csv')
>>> trader.add_data_array(df)
add_data_point(*args, **kwargs)[source]

Adds a single data point to the end of the existing data or to an empty chart.

Parameters:
  • *args – Accepts positional arguments like tuples or lists representing the data point.

  • **kwargs – Additional keyword arguments for data point fields (e.g., open, high, low, close, dateTime, volume, openInterest).

Examples

>>> ### Using keyword arguments
>>> trader.add_data_point(open=1.6, high=1.7, low=1.5, close=1.65, date_time='2020-08-22')
>>> trader.add_data_point(open=1.6, high=1.7, low=1.5, close=1.65)
>>> ### Using a dictionary
>>> data_point = {'open': 1.6, 'high': 1.7, 'low': 1.5, 'close': 1.65, 'dateTime': "2022/10/25"}
>>> trader.add_data_point(data_point=data_point)
>>> ### Using a list: Ensure OHLC values come first, followed by optional fields and dateTime.
>>> trader.add_data_point([1.6, 1.7, 1.5, 1.65, "2022/12/25"])
>>> trader.add_data_point([1.6, 1.7, 1.5, 1.65, 1000, 200, "2023/10/25"])
>>> ### Using a tuple: Ensure OHLC values come first, followed by optional fields and dateTime.
>>> trader.add_data_point((1.6, 1.7, 1.5, 1.65, 1000, 200, "2023/11/25"))
>>> trader.add_data_point((1.6, 1.7, 1.5, 1.65, "2023/12/25"))
>>> ### Using positional arguments: Ensure OHLC values come first, followed by optional fields and dateTime.
>>> trader.add_data_point(1.6, 1.7, 1.5, 1.65, "1/4/2024")
>>> trader.add_data_point(1.6, 1.7, 1.5, 1.65, 1000, 200, "2/4/2024")
add_date_range(startX, startY, endX=None, endY=None)[source]

Adds Date Range measurement tool to the chart. Measures the date range, bar count, and total volume between two points.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_detrended_price_oscillator()[source]

Adds the Detrended Price Oscillator (DPO) to the chart.

The DPO is used to identify cycles in the market by removing the long-term trend.

Parameters:

period_count (int) – The number of periods for the DPO calculation.

add_donchian_channels(period_count=20)[source]

Adds Donchian Channels to the chart.

Donchian Channels plot the highest and lowest price over a period, used to identify breakouts.

Parameters:

period_count (int) – The number of periods to calculate the channels.

add_ease_of_movement()[source]

Adds the Ease of Movement (EOM) indicator to the chart.

EOM is an indicator that measures the relationship between price changes and volume. It shows how easily a price is moving up or down.

add_ehler_fisher_transform()[source]

Adds the Ehler Fisher Transform indicator to the chart.

The Ehler Fisher Transform is a technical indicator used to determine trend reversals based on price data transformation.

add_elder_ray_index(period_count=13)[source]

Adds the Elder Ray Index indicator to the chart.

The Elder Ray Index helps identify buying and selling pressure in the market.

Parameters:

period_count (int) – The number of periods over which the Elder Ray Index will be calculated.

add_elder_thermometer_custom()[source]

Adds a custom Elder Thermometer indicator to the chart.

This indicator helps measure market volatility by comparing price range changes.

add_elders_force_index(period_count=13)[source]

Adds the Elder’s Force Index to the chart.

Elder’s Force Index measures the strength of bulls or bears in the market by combining price direction, extent of price movement, and volume.

Parameters:

period_count (int) – The number of periods over which the Force Index will be calculated.

add_elliot_wave(waveType, startX, startY, secondX=None, secondY=None, thirdX=None, thirdY=None, fourthX=None, fourthY=None, fifthX=None, fifthY=None, sixthX=None, sixthY=None, seventhX=None, seventhY=None, eighthX=None, eighthY=None, ninthX=None, ninthY=None)[source]

Adds Elliot Wave tool to the chart. Draws a wave pattern between several control points.

Parameters:
  • waveType (int) – Type of Elliot Wave.

  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • secondX (int | float, optional) – Second point X-position. Defaults to None.

  • secondY (int | float, optional) – Second point Y-position. Defaults to None.

  • thirdX (int | float, optional) – Third point X-position. Defaults to None.

  • thirdY (int | float, optional) – Third point Y-position. Defaults to None.

  • fourthX (int | float, optional) – Fourth point X-position. Defaults to None.

  • fourthY (int | float, optional) – Fourth point Y-position. Defaults to None.

  • fifthX (int | float, optional) – Fifth point X-position. Defaults to None.

  • fifthY (int | float, optional) – Fifth point Y-position. Defaults to None.

  • sixthX (int | float, optional) – Sixth point X-position. Defaults to None.

  • sixthY (int | float, optional) – Sixth point Y-position. Defaults to None.

  • seventhX (int | float, optional) – Seventh point X-position. Defaults to None.

  • seventhY (int | float, optional) – Seventh point Y-position. Defaults to None.

  • eighthX (int | float, optional) – Eighth point X-position. Defaults to None.

  • eighthY (int | float, optional) – Eighth point Y-position. Defaults to None.

  • ninthX (int | float, optional) – Ninth point X-position. Defaults to None.

  • ninthY (int | float, optional) – Ninth point Y-position. Defaults to None.

add_ellipse(startX, startY, radiusX=None, radiusY=None)[source]

Adds an Ellipse to the chart.

Parameters:
  • startX (int | float) – Start point X-position. If radius parameters are not supplied, this is where the drawing starts. Otherwise, this is the center X-value of the ellipse.

  • startY (int | float) – Start point Y-position. If radius parameters are not supplied, this is where the drawing starts. Otherwise, this is the center Y-value of the ellipse.

  • radiusX (int | float, optional) – Radius of the ellipse in X-direction. Defaults to None.

  • radiusY (int | float, optional) – Radius of the ellipse in Y-direction. Defaults to None.

add_exponential_moving_average(period_count=14)[source]

Adds the Exponential Moving Average (EMA) to the chart.

The EMA gives more weight to recent prices to make it more responsive to new information.

Parameters:

period_count (int) – The number of periods over which the EMA will be calculated.

add_extended_line(startX, startY, endX=None, endY=None)[source]

Adds Extended Line tool to the chart. Draws a straight line between two control points, then extends the line to the left and right edges of the chart.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_fibonacci_arc(startX, startY, endX=None, endY=None)[source]

Adds Fibonacci Arc tool to the chart. Draws a trend line between two control points, followed by multiple arcs intersecting the line at levels 38.2%, 50.0%, 61.8% and 100%. The arcs are centered on the second control point.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_fibonacci_extension(firstX, firstY, secondX=None, secondY=None, thirdX=None, thirdY=None)[source]

Adds Fibonacci Extension tool to the chart. Fibonacci Extensions are based on three chosen points on chart: the first two points determine the price move while the third point is the end of retracement against that move. Extension lines using Fibonacci ratios are then drawn based on the price moves.

Parameters:
  • firstX (int | float) – First point X-position.

  • firstY (int | float) – First point Y-position.

  • secondX (int | float, optional) – Second point X-position. Defaults to None.

  • secondY (int | float, optional) – Second point Y-position. Defaults to None.

  • thirdX (int | float, optional) – Third point X-position. Defaults to None.

  • thirdY (int | float, optional) – Third point Y-position. Defaults to None.

add_fibonacci_fan(startX, startY, endX=None, endY=None)[source]

Adds Fibonacci Fan tool to the chart. Draws a trend line between two control points, then several Fibonacci fan lines starting from the first point and crossing an “invisible” vertical line at the X-value of the second point based on Fibonacci levels at 38.2%, 50.0% and 61.8%.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_fibonacci_retracements(startX, startY, endX=None, endY=None)[source]

Adds Fibonacci Retracements tool to the chart. Draws a trend line between two control points, then several horizontal retracement lines based on selected price range (height) of the trend line. The retracement lines are drawn at Fibonacci levels of 38.2%, 50.0% and 61.8%.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_fibonacci_time_zones(startX, startY, endX=None, endY=None)[source]

Adds Fibonacci Time Zones tool to the chart. Draws vertical lines corresponding to elapsed time periods based on Fibonacci number sequence. Can be used to spot potential price reversal points.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_flat_top_bottom(startX, startY, endX=None, endY=None, flatYValue=None)[source]

Adds Flat Top/Bottom tool to the chart. Draws a line between two points and another horizontal line above or below it. The area between the lines is then colored.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

  • flatYValue (int | float, optional) – The price value of the flat horizontal line. Defaults to None.

add_fractal_chaos_bands()[source]

Adds the Fractal Chaos Bands indicator to the chart.

This indicator helps identify the market’s fractal patterns and potential turning points.

add_fractal_chaos_oscillator()[source]

Adds the Fractal Chaos Oscillator to the chart.

This indicator helps identify fractal patterns in the market for trend analysis.

Parameters:

period_count (int) – The number of periods over which the oscillator will be calculated.

add_gann_box(startX, startY, endX, endY, lineColor, lineWidth, areaColor)[source]

Adds a Gann Box to the trading chart.

Parameters:
  • startX (float) – X-coordinate of the starting point.

  • startY (float) – Y-coordinate of the starting point.

  • endX (float) – X-coordinate of the ending point.

  • endY (float) – Y-coordinate of the ending point.

  • lineColor (str) – Line color in HEX format.

  • lineWidth (float) – Line width.

  • areaColor (str) – Area fill color in HEX format.

Returns:

The created Gann Box instance.

Return type:

GannBox

add_gann_fan(startX, startY, endX, endY, lineColor, lineWidth)[source]

Adds a Gann Fun to the trading chart.

Parameters:
  • startX (float) – X-coordinate of the starting point.

  • startY (float) – Y-coordinate of the starting point.

  • endX (float) – X-coordinate of the ending point.

  • endY (float) – Y-coordinate of the ending point.

  • lineColor (str) – Line color in HEX format.

  • lineWidth (float) – Line width.

  • areaColor (str) – Area fill color in HEX format.

Returns:

The created Gann Fun instance.

Return type:

GannFun

add_gopalakrishnan_range_index(period_count=14)[source]

Adds the Gopalakrishnan Range Index (GAPO) to the chart.

GAPO is used to measure the volatility of an asset over a specified period.

Parameters:

period_count (int) – The number of periods over which the range index will be calculated.

add_head_and_shoulders(startX, startY, leftShoulderX=None, leftShoulderY=None, firstTroughX=None, firstTroughY=None, headX=None, headY=None, secondTroughX=None, secondTroughY=None, rightShoulderX=None, rightShoulderY=None, endX=None, endY=None)[source]

Adds Head and Shoulders pattern to the chart. Appears as a baseline with three peaks.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • leftShoulderX (int | float, optional) – Left Shoulder point X-position. Defaults to None.

  • leftShoulderY (int | float, optional) – Left Shoulder point Y-position. Defaults to None.

  • firstTroughX (int | float, optional) – First Trough point X-position. Defaults to None.

  • firstTroughY (int | float, optional) – First Trough point Y-position. Defaults to None.

  • headX (int | float, optional) – Head point X-position. Defaults to None.

  • headY (int | float, optional) – Head point Y-position. Defaults to None.

  • secondTroughX (int | float, optional) – Second Trough point X-position. Defaults to None.

  • secondTroughY (int | float, optional) – Second Trough point Y-position. Defaults to None.

  • rightShoulderX (int | float, optional) – Right Shoulder point X-position. Defaults to None.

  • rightShoulderY (int | float, optional) – Right Shoulder point Y-position. Defaults to None.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_heatmap(start_x, start_y, end_x, end_y, data_values)[source]

Adds a heatmap visualization to the chart.

A heatmap is a graphical representation of data where individual values are represented as colors. It helps to visualize complex data and identify patterns within the chart.

Parameters:
  • start_x (float) – The starting X-coordinate for the heatmap.

  • start_y (float) – The starting Y-coordinate for the heatmap.

  • end_x (float) – The ending X-coordinate for the heatmap.

  • end_y (float) – The ending Y-coordinate for the heatmap.

  • data_values (list) – A 2D array of data values used to generate the heatmap, where each value represents a color intensity.

add_high_low_bands()[source]

Adds the High-Low Bands indicator to the chart.

The High-Low Bands indicator shows two lines representing the highest and lowest prices over a specific period.

Parameters:

period_count (int) – The number of periods to calculate the high and low bands.

add_high_minus_low()[source]

Adds the High Minus Low indicator to the chart.

The High Minus Low indicator calculates the difference between the high and low prices.

add_historical_volatility_index()[source]

Adds the Historical Volatility Index to the chart.

This indicator measures the volatility of a stock by calculating the standard deviation of its price changes over a specified period.

add_horizontal_line(yPosition)[source]

Adds Horizontal Line to the chart. Draws a line across the whole chart.

Parameters:

yPosition (int | float) – Y-position for the line.

add_horizontal_ray(xPosition, yPosition)[source]

Adds Horizontal Ray to the chart. Draws a straight line from a selected point to the right edge of the chart.

Parameters:
  • xPosition (int | float) – Starting point X-value for the ray.

  • yPosition (int | float) – Y-position for the line.

add_ichimoku_cloud()[source]

Adds the Ichimoku Cloud indicator to the chart.

Ichimoku Cloud is a technical analysis tool that defines support and resistance, identifies trend direction, and provides trade signals.

add_indicator(indicator_name, **kwargs)[source]

Add a technical indicator to the chart.

Parameters:
  • indicator_name (str) – The name of the indicator to add (e.g., ‘SimpleMovingAverage’, ‘Aroon’).

  • **kwargs – Additional arguments specific to the indicator (e.g., period, fastPeriod, slowPeriod).

add_intraday_momentum_index()[source]

Adds the Intraday Momentum Index to the chart.

This indicator combines elements of both candlestick analysis and RSI to show intraday price momentum.

add_keltner_channels()[source]

Adds the Keltner Channels to the chart.

Keltner Channels are volatility-based envelopes set above and below an exponential moving average.

add_klinger_volume_oscillator()[source]

Adds the Klinger Volume Oscillator to the chart.

The Klinger Oscillator uses volume and price to predict price reversals.

add_kurtosis()[source]

Adds the Kurtosis indicator to the chart.

Kurtosis measures the “tailedness” of the distribution of returns.

add_linear_regression()[source]

Adds the Linear Regression indicator to the chart.

This indicator shows the best-fit line of a stock’s price movement over a specified time period.

add_linear_regression_channel(startX, startY, endX=None, endY=None)[source]

Adds Linear Regression Channel tool to the chart. Calculates and draws a linear regression line between two control points. Then draws two channel lines, one above and one below the regression line based on the selected channel type.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_market_facilitation_index()[source]

Adds the Market Facilitation Index (MFI) to the chart.

MFI evaluates the efficiency of price movements by comparing price changes with volume.

add_mass_index(period_count=25)[source]

Adds the Mass Index to the chart.

The Mass Index identifies potential reversals by analyzing price ranges.

Parameters:

period_count (int) – The number of periods to calculate the Mass Index.

add_median_price()[source]

Adds the Median Price indicator to the chart.

The Median Price indicator is a simple average of the high and low prices for each period.

add_momentum_oscillator(period_count=10)[source]

Adds the Momentum Oscillator to the chart.

The Momentum Oscillator measures the rate of change in a stock’s price.

Parameters:

period_count (int) – The number of periods over which to calculate momentum.

add_money_flow_index(period_count=14)[source]

Adds the Money Flow Index (MFI) to the chart.

MFI measures the strength of money flowing into and out of a security over a specific period.

Parameters:

period_count (int) – The number of periods to calculate MFI.

add_moving_average_convergence_divergence()[source]

Adds the Moving Average Convergence Divergence (MACD) indicator to the chart.

MACD shows the relationship between two moving averages of a security’s price.

add_moving_average_convergence_divergence_custom()[source]

Adds a custom MACD indicator to the chart, allowing for custom settings.

add_moving_average_envelopes(period_count)[source]

Adds the Moving Average Envelopes to the chart.

Moving Average Envelopes are percentages-based lines set above and below a moving average.

Parameters:

period_count (int) – The number of periods over which the moving average is calculated.

add_negative_volume_index()[source]

Adds the Negative Volume Index (NVI) indicator to the chart.

The Negative Volume Index is used to identify trends in a market based on the concept that “smart money” takes advantage of low volume periods to make its move.

add_on_balance_volume()[source]

Adds the On Balance Volume (OBV) indicator to the chart.

The On Balance Volume indicator measures buying and selling pressure based on the volume flow to predict future price movements.

add_open_interest()[source]

Adds the Open Interest indicator to the chart.

Open Interest is the total number of outstanding contracts for an asset in futures or options trading.

add_parabolic_sar()[source]

Adds the Parabolic SAR indicator to the chart.

The Parabolic SAR is used to identify potential reversals in market trends.

add_parallel_channel(startX, startY, endX=None, endY=None, channelHeight=None)[source]

Adds Parallel Channel tool to the chart. Draws a line between two points and another parallel line above or below it, thus forming a channel. The middle value of the channel is displayed with a dashed line.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

  • channelHeight (int | float, optional) – The height of the channel in price values. Defaults to None.

add_percentage_price_oscillator()[source]

Adds the Percentage Price Oscillator (PPO) to the chart.

The Percentage Price Oscillator is a momentum indicator that shows the relationship between two moving averages of a security’s price.

add_performance_index()[source]

Adds the Performance Index indicator to the chart.

The Performance Index is used to analyze how well a security is performing over time, typically in comparison to a benchmark.

add_pitchfork(startX, startY, endX1=None, endY1=None, endX2=None, endY2=None)[source]

Adds Pitchfork tool to the chart. Places three control points on the chart and draws a line from the first point through the midpoint of the other points. Can be used to identify support and resistance levels for a stock’s price.

Parameters:
  • startX (int | float) – First point X-position.

  • startY (int | float) – First point Y-position.

  • endX1 (int | float, optional) – Second point X-position. Defaults to None.

  • endY1 (int | float, optional) – Second point Y-position. Defaults to None.

  • endX2 (int | float, optional) – Third point X-position. Defaults to None.

  • endY2 (int | float, optional) – Third point Y-position. Defaults to None.

add_plain_text(positionX, positionY, text='Text')[source]

Adds a simple text to the chart.

Parameters:
  • positionX (int | float) – Text X-position.

  • positionY (int | float) – Text Y-position.

  • text (str, optional) – The text content. Defaults to ‘Text’.

add_positive_volume_index()[source]

Adds the Positive Volume Index (PVI) indicator to the chart.

The Positive Volume Index is used to measure changes in volume and identify market trends when the volume is high.

add_pretty_good_oscillator()[source]

Adds the Pretty Good Oscillator to the chart.

The Pretty Good Oscillator is used to identify overbought and oversold levels.

add_price_range(startX, startY, endX=None, endY=None)[source]

Adds a Price Range measurement tool to the chart, which measures the price change between two points on the chart.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_price_volume_trend()[source]

Adds the Price Volume Trend (PVT) indicator to the chart.

The Price Volume Trend indicator helps to confirm trends in price by considering the amount of traded volume.

add_prime_number_bands()[source]

Adds the Prime Number Bands indicator to the chart.

The Prime Number Bands show significant price levels based on prime numbers.

add_prime_number_oscillator()[source]

Adds the Prime Number Oscillator to the chart.

The Prime Number Oscillator highlights key levels of support and resistance using prime numbers.

add_qstick(period_count)[source]

Adds the QStick indicator to the chart.

The QStick is a technical analysis indicator that measures the average of the difference between the open and close prices over a specified period.

Parameters:

period_count (int) – The number of periods over which to calculate the QStick.

add_rainbow_oscillator()[source]

Adds the Rainbow Oscillator to the chart.

The Rainbow Oscillator uses a series of moving averages to identify trends and potential reversals.

add_random_walk_index()[source]

Adds the Random Walk Index (RWI) to the chart.

The Random Walk Index is a technical analysis indicator used to determine if a security is trending or in a range.

Parameters:

period_count (int) – The number of periods used in the RWI calculation.

add_range_action_verification_index()[source]

Adds the Range Action Verification Index (RAVI) to the chart.

The RAVI measures the strength of a price trend and can indicate if a market is trending or consolidating.

add_rate_of_change(period_count=9)[source]

Adds the Rate of Change (ROC) indicator to the chart.

The Rate of Change measures the percentage change in a security’s price between the current price and a price in a previous period.

Parameters:

period_count (int) – The number of periods over which to calculate the ROC.

add_rectangle(startX, startY, endX=None, endY=None)[source]

Adds a Rectangle tool to the chart.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_relative_strength_index(period_count=14)[source]

Adds the Relative Strength Index (RSI) to the chart.

The RSI measures the speed and change of price movements and is used to identify overbought or oversold conditions.

Parameters:

period_count (int) – The number of periods over which to calculate the RSI.

add_schaff_trend_cycle()[source]

Adds the Schaff Trend Cycle (STC) to the chart.

The Schaff Trend Cycle is a technical analysis tool that uses moving averages to determine market trends.

add_schaff_trend_cycle_signal()[source]

Adds the Schaff Trend Cycle Signal indicator to the chart.

This is used to generate signals based on the Schaff Trend Cycle for potential market entry and exit points.

add_secondary_symbol(symbol)[source]

Add a secondary symbol to the chart for comparison.

Parameters:

symbol (str) – The symbol to add as a secondary comparison.

add_simple_moving_average(period_count=14)[source]

Adds the Simple Moving Average (SMA) to the chart.

The SMA is a widely used indicator that calculates the average price over a specific period.

Parameters:

period_count (int) – The number of periods over which to calculate the SMA.

add_sine_wave(startX, startY, endX=None, endY=None)[source]

Adds Sine Wave tool to the chart.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_skewness()[source]

Adds the Skewness indicator to the chart.

The Skewness indicator measures the asymmetry of the returns distribution for a security.

Parameters:

period_count (int) – The number of periods used for the calculation of skewness.

add_sqn_trend()[source]

Adds the System Quality Number (SQN) Trend indicator to the chart.

The SQN Trend measures the quality of a trading system over a specific time frame.

Parameters:

period_count (int) – The number of periods used to calculate the SQN.

add_standard_deviation(period_count=20)[source]

Adds the Standard Deviation indicator to the chart.

Standard Deviation is a statistical measure of price volatility over a specified period.

Parameters:

period_count (int) – The number of periods used for the Standard Deviation calculation.

add_standard_error(period_count=14)[source]

Adds the Standard Error indicator to the chart.

The Standard Error shows the standard deviation of the regression line over a specified period.

Parameters:

period_count (int) – The number of periods over which to calculate the Standard Error.

add_standard_error_bands()[source]

Adds the Standard Error Bands to the chart.

These bands represent a range above and below a moving average based on the standard error.

add_stochastic_momentum_index()[source]

Adds the Stochastic Momentum Index (SMI) to the chart.

The SMI helps identify trend direction and potential reversal points.

add_stochastic_oscillator()[source]

Adds the Stochastic Oscillator to the chart.

The Stochastic Oscillator is a momentum indicator that compares a security’s closing price to its price range over a specific period.

add_stochastic_oscillator_smoothed()[source]

Adds the Smoothed Stochastic Oscillator to the chart.

This is a variation of the traditional Stochastic Oscillator with additional smoothing to reduce false signals.

add_stoller_average_range_channel()[source]

Adds the Stoller Average Range Channel (STARC) to the chart.

The STARC bands are a volatility-based indicator that can help identify overbought and oversold conditions.

add_super_trend(period_count=10)[source]

Adds the Super Trend indicator to the chart.

The Super Trend is used to identify market trends and potential reversals.

Parameters:

period_count (int) – The number of periods used in the Super Trend calculation.

add_swing_index()[source]

Adds the Swing Index to the chart.

The Swing Index identifies the overall trend direction by comparing the current price with previous prices.

add_symbol_search_results(response_array)[source]

Add symbol search results to the chart.

Parameters:

response_array (list of list) – An array of symbol search results, where each sublist can contain Symbol, Name, Region, and Currency.

add_text_box(positionX, positionY, text='Text')[source]

Adds a text box to the chart.

Parameters:
  • positionX (int | float) – Text X-position.

  • positionY (int | float) – Text Y-position.

  • text (str, optional) – The text content. Defaults to ‘Text’.

add_time_series_moving_average(period_count=25)[source]

Adds the Time Series Moving Average (TSMA) to the chart.

The TSMA is a moving average based on linear regression.

Parameters:

period_count (int) – The number of periods used to calculate the TSMA.

add_trade_volume_index()[source]

Adds the Trade Volume Index (TVI) to the chart.

The TVI is used to determine whether a security is under accumulation or distribution by measuring the volume traded at different price levels.

add_trend_line(startX, startY, endX=None, endY=None)[source]

Adds Trend Line tool to the chart. Draws a straight line between two control points.

Parameters:
  • startX (int | float) – Start point X-position.

  • startY (int | float) – Start point Y-position.

  • endX (int | float, optional) – End point X-position. Defaults to None.

  • endY (int | float, optional) – End point Y-position. Defaults to None.

add_triangle(startX, startY, endX1=None, endY1=None, endX2=None, endY2=None)[source]

Adds a Triangle tool to the chart.

Parameters:
  • startX (int | float) – First point X-position.

  • startY (int | float) – First point Y-position.

  • endX1 (int | float, optional) – Second point X-position. Defaults to None.

  • endY1 (int | float, optional) – Second point Y-position. Defaults to None.

  • endX2 (int | float, optional) – Third point X-position. Defaults to None.

  • endY2 (int | float, optional) – Third point Y-position. Defaults to None.

add_triangular_moving_average(period_count=20)[source]

Adds the Triangular Moving Average (TMA) to the chart.

The TMA gives more weight to middle data points and less to extremes, smoothing price trends.

Parameters:

period_count (int) – The number of periods used for the TMA calculation.

add_triple_exponential_average()[source]

Adds the Triple Exponential Moving Average (TEMA) to the chart.

The TEMA is a variation of the exponential moving average that aims to reduce lag in trend identification.

Parameters:

period_count (int) – The number of periods used in the TEMA calculation.

add_true_strength_index()[source]

Adds the True Strength Index (TSI) to the chart.

The TSI measures momentum based on price changes and is used to identify trend strength and reversals.

add_twiggs_money_flow()[source]

Adds the Twiggs Money Flow (TMF) indicator to the chart.

The TMF measures buying and selling pressure over a specified period and is used to identify market trends.

Parameters:

period_count (int) – The number of periods used for the TMF calculation.

add_typical_price()[source]

Adds the Typical Price indicator to the chart.

The Typical Price is an average of the high, low, and close prices for a trading period, used to identify trends.

add_ultimate_oscillator()[source]

Adds the Ultimate Oscillator to the chart.

The Ultimate Oscillator combines short, medium, and long-term price movements into a single indicator to identify overbought and oversold conditions.

add_ultimate_oscillator_smoothed()[source]

Adds the Smoothed Ultimate Oscillator to the chart.

This is a variation of the Ultimate Oscillator with additional smoothing to reduce noise.

add_variable_moving_average(period_count=9)[source]

Adds the Variable Moving Average (VMA) to the chart.

The VMA is a moving average that adjusts its period length based on market volatility.

Parameters:

period_count (int) – The number of periods used to calculate the VMA.

add_vertical_horizontal_filter(period_count=28)[source]

Adds the Vertical Horizontal Filter (VHF) to the chart.

The VHF helps identify whether the market is trending or ranging.

Parameters:

period_count (int) – The number of periods used in the VHF calculation.

add_vertical_line(x_position)[source]

Adds Vertical Line to the chart. Draws a line across the whole chart.

Parameters:

x_position (int | float) – X-position for the line. Given as a number.

add_vidya(period_count=9)[source]

Adds the Variable Index Dynamic Average (VIDYA) to the chart.

The VIDYA is a type of adaptive moving average that adjusts its sensitivity based on market volatility.

Parameters:

period_count (int) – The number of periods used for the VIDYA calculation.

add_volume(add_as_overlay=True, two_colored_bars=True, bar_color='#0000FF', offset=0)[source]

Adds the Volume indicator to the chart.

Volume shows the number of traded securities over a specific time period and can help identify market activity and trends.

Parameters:
  • add_as_overlay (bool, optional) – Whether to display volume as an overlay. Defaults to True.

  • two_colored_bars (bool, optional) – Whether to use two-colored bars for up/down volume. Defaults to True.

  • bar_color (str, optional) – The color for the volume bars. Defaults to ‘#0000FF’.

  • offset (int, optional) – The offset for volume data. Defaults to 0.

add_volume_oscillator()[source]

Adds the Volume Oscillator to the chart.

The Volume Oscillator measures the difference between two moving averages of volume to indicate market trends.

add_volume_rate_of_change()[source]

Adds the Volume Rate of Change (VROC) indicator to the chart.

The VROC shows the percentage change in volume between two periods.

add_volume_weighted_moving_average(period_count=20)[source]

Adds the Volume Weighted Moving Average (VWMA) to the chart.

The VWMA calculates the average price weighted by volume, giving more significance to price movements with higher volume.

Parameters:

period_count (int) – The number of periods used to calculate the VWMA.

add_weighted_close()[source]

Adds the Weighted Close indicator to the chart.

The Weighted Close averages the high, low, and close prices, with more weight given to the close.

add_weighted_moving_average(period_count=14)[source]

Adds the Weighted Moving Average (WMA) to the chart.

The WMA gives more weight to recent data points, helping to identify trends more quickly.

Parameters:

period_count (int) – The number of periods used to calculate the WMA.

add_welles_wilder_smoothing_average(period_count=14)[source]

Adds the Welles Wilder Smoothing Average to the chart.

This is a variation of the exponential moving average developed by Welles Wilder.

Parameters:

period_count (int) – The number of periods used to calculate the smoothing average.

add_williams_accumulation_distribution()[source]

Adds the Williams Accumulation Distribution indicator to the chart.

This indicator measures market accumulation and distribution based on price and volume movements.

Parameters:

period_count (int) – The number of periods used to calculate the indicator.

add_williams_percent_range(period_count=14)[source]

Adds the Williams Percent Range (%R) indicator to the chart.

The Williams %R measures overbought and oversold levels, similar to the RSI.

Parameters:

period_count (int) – The number of periods used to calculate the %R.

add_williams_variable_accumulation_distribution()[source]

Adds the Williams Variable Accumulation Distribution (WVAD) indicator to the chart.

The WVAD helps identify buying and selling pressure by combining volume and price movements.

Parameters:

period_count (int) – The number of periods used to calculate the WVAD.

add_xabcd_pattern(startX, startY, positionAX=None, positionAY=None, positionBX=None, positionBY=None, positionCX=None, positionCY=None, positionDX=None, positionDY=None)[source]

Adds a XABCD pattern tool to the chart.

Parameters:
  • startX (int | float) – Start X-position (X-point)

  • startY (int | float) – Start Y-position (X-point)

  • positionAX (int | float, optional) – A-point X-position. Defaults to None.

  • positionAY (int | float, optional) – A-point Y-position. Defaults to None.

  • positionBX (int | float, optional) – B-point X-position. Defaults to None.

  • positionBY (int | float, optional) – B-point Y-position. Defaults to None.

  • positionCX (int | float, optional) – C-point X-position. Defaults to None.

  • positionCY (int | float, optional) – C-point Y-position. Defaults to None.

  • positionDX (int | float, optional) – D-point X-position. Defaults to None.

  • positionDY (int | float, optional) – D-point Y-position. Defaults to None.

add_z_value(period_count=20)[source]

Adds the Z-Value indicator to the chart.

The Z-Value measures how many standard deviations a security’s price is from the mean, helping to identify overbought or oversold conditions.

Parameters:

period_count (int) – The number of periods used to calculate the Z-Value.

change_time_range(index)[source]

Programmatically changes the value of the time range selection element.

Parameters:

index (int) – Index of the selected time range. See documentation for the correct values.

clear_data()[source]

Clears all data from the current chart.

This method sends a command to the technical analysis chart instance to remove all data points from the chart. It can be useful when you want to reset or refresh the chart without closing it.

clear_everything()[source]

Cleans the chart by removing all added data, indicators, drawing tools, and heatmaps.

close()[source]

Closes the current technical analysis chart instance and releases resources.

This method ensures that the chart and all related resources are properly closed when they are no longer needed. It calls the close() method of the underlying TAChart instance to perform the cleanup.

create_dashboard(rows, cols)[source]

Creates a dashboard grid layout.

Parameters:
  • columns (int) – The amount of columns in the dashboard.

  • rows (int) – The amount of rows in the dashboard.

dispose_all_drawing_tools()[source]

Disposes all current drawing tools.

dispose_all_heatmaps()[source]

Disposes all heatmaps from the chart.

dispose_all_indicators(dispose_secondary_symbol=False)[source]

Disposes of all indicators on the chart.

Parameters:

dispose_secondary_symbol (bool, optional) – Whether to dispose the secondary symbol as well. Defaults to False.

enable_data_point_limit(enabled)[source]

Enable or disable data point limit.

Parameters:

enabled (bool) – True to enable limit, False to disable.

enable_effects(enableEffect)[source]

Enables or disables chart effects.

When enabled, a glow effect is added to most chart components.

Parameters:

enableEffect (bool) – Set True to enable the glow effect, or False to disable it.

enable_mountain_gradient(mountainGradient=<class 'bool'>)[source]

When enabled, mountain price chart type uses gradient coloring for fill.

enable_x_axis_restrictions(enableRestrictions)[source]

Enables or disables X-axis restrictions.

When enabled, the X-axis cannot be zoomed or panned outside the minimum and maximum values of the data set. Disabling this allows free zooming and panning, but other zoom/pan-related settings may still apply.

Parameters:

enableRestrictions (bool) – Set True to enable X-axis restrictions, or False to disable them.

enable_y_axis_restrictions(enableRestrictions)[source]

Enables or disables Y-axis restrictions.

When enabled, the Y-axis cannot be zoomed or panned outside the minimum and maximum values of the data set. Disabling this allows free zooming and panning, but other zoom/pan-related settings may still apply.

Parameters:

enableRestrictions (bool) – Set True to enable Y-axis restrictions, or False to disable them.

get_data(single_array=False)[source]

Gets the current data set loaded to the chart as separate arrays or as a single XOHLC-type array.

Important

This method should be used after the chart is opened with open() method.

Parameters:

single_array (bool) – When enabled, returns the data set as a single XOHLC-typed array. Does not contain DateTime values. Default = False.

Returns:

If single_array is True, returns the XOHLC-array. If single_array is False, returns an array of arrays containing: - Date array (dates in string format) - Array of Open values - Array of High values - Array of Low values - Array of Close values

get_data_point_array()[source]

Get all data points from the chart.

Note

This method should be used after the chart is opened with open() method.

Returns:

Array of dictionaries, each containing:
  • open (float)

  • high (float)

  • low (float)

  • close (float)

  • dateTime (str): ISO format

  • volume (float, optional)

  • openInterest (float, optional)

Return type:

list

get_kagi_instance()[source]

Retrieve the Kagi instance for customizing Kagi-specific settings.

get_point_and_figure_instance()[source]

Retrieve the Point-and-Figure instance for customizing Point-and-Figure-specific settings.

get_renko_instance()[source]

Retrieve the Renko instance for customizing Renko-specific settings.

get_search_button()[source]

Gets the search input component. Can be used to subscribe to various events when using the search bar with user-defined data provider.

Important

This method should be used after the chart is opened with open() method.

Returns:

The search input component.

get_search_input()[source]

Gets the search input component. Can be used to subscribe to various events when using the search bar with user-defined data provider.

Important

This method should be used after the chart is opened with open() method.

Returns:

The search input component.S

get_symbol_search_result_table()[source]

Gets the table component used to display Symbol search results. Each result is a separate table row. Can be used to subscribe to various events when using the search bar with user-defined data provider.

Important

This method should be used after the chart is opened with open() method.

Returns:

Symbol search table component.

get_time_range()[source]

Gets the current time range of the chart. To get the current selected time range (time range button value), use getTimeRangeSelection() method.

Important

This method should be used after the chart is opened with open() method.

Returns:

start time and end time.

Return type:

Array containing two Date values

get_time_range_selection()[source]

Gets the current selected time range (time range button value). To get the exact time range start and end values, use getTimeRange() method.

Important

This method should be used after the chart is opened with open() method.

Returns:

Selected time range button value as a number (0 = All, 1 = 10Y, 2 = 5Y, 3 = 3Y, 4 = 1Y, 5 = 6M, 6 = 3M, 7 = 1M, 8 = 10D, 9 = 5D, 10 = 1D, 11 = 12H, 12 = 3H, 13 = 1H, 14 = 30m, 15 = 10m, 16 = 1m)

get_volume_data()[source]

Gets the Volume data currently loaded to the chart.

Important

This method should be used after the chart is opened with open() method.

Returns:

The Volume data array.

load_csv(csv, dataset_name='', delimiter=',')[source]

Reads the given csv string/file and converts it into a data array, which is then added to the chart. Replaces existing data.

Parameters:
  • csv (str) – Path to the CSV file or CSV file content as string.

  • dataset_name (str, optional) – Name of the dataset, shown as the chart title. Defaults to ‘’.

  • delimiter (str, optional) – Delimiter used in the CSV file. Defaults to ‘,’.

Examples

Read from file: >>> trader.load_csv(‘data/file.csv’, delimiter=’,’)

Raw CSV string: >>> csv_content = ‘’’Date,Open,Close,High,Low,Volume >>> 1/4/2010,28.29999924,28.68400002,28.71333313,28.11400032,142981500 >>> 1/5/2010,29.36666679,29.5340004,30.26666641,29.12800026,266677500 >>> 1/6/2010,29.36466789,30.10266685,30.10400009,29.33333206,151995000 >>> ‘’’ >>> trader.load_csv(csv_content, delimiter=’,’)

load_template()[source]

Load a chart configuration from a template.

This method will open a File Upload window to browse and load a previously saved template file.

menu_options()[source]

Returns the menu options manager for this trading chart.

The menu options manager provides methods to control various menu-related settings and UI elements of the trading chart interface.

Returns:

The menu options manager instance.

Return type:

MenuOptions

Example

# Hide the chart title input trader.menu_options().show_chart_title_input(False)

# Show the chart title input trader.menu_options().show_chart_title_input(True)

# Method chaining is supported trader.menu_options().show_chart_title_input(False)

off_clear_everything()[source]

Unsubscribes from the ClearEverything event.

Removes the event handler for the ClearEverything event.

off_pointer_down()[source]

Unsubscribe from chart pointer down events.

off_pointer_move()[source]

Unsubscribe from chart pointer move events.

off_pointer_up()[source]

Unsubscribe from chart pointer up events.

on_clear_everything(callback)[source]

Subscribes to the ClearEverything event.

This event triggers when the chart contents are cleared either via the ‘Clear everything’ button in the user interface, or by calling clear_everything() in code.

Parameters:

callback (callable) – Function to call when the event is triggered. The callback receives an event dictionary with: - timestamp (str): ISO timestamp when the event occurred

Example

>>> def on_cleared(event):
...     print(f"Chart cleared at {event['timestamp']}")
>>>
>>> chart.on_clear_everything(on_cleared)
on_pointer_down(callback)[source]

Subscribe to chart pointer down events.

Parameters:

callback – Function receiving event dict with keys: - x (float): Horizontal Axis value (where the pointer event occurred) - y (float): Vertical Axis value (where the pointer event occurred) - pixelsX: Screen pixel position from left edge of chart canvas - pixelsY: Screen pixel position from top edge of chart canvas - button (int): Mouse button (0=left, 1=middle, 2=right)

Example

>>> trader = TAChart(license_key)
>>> def handler(evt):
...     print('Pointer DOWN event:', evt)
>>> trader.on_pointer_down(handler)
>>> # Later: trend.off_pointer_down()
on_pointer_move(callback)[source]

Subscribe to chart pointer move events.

Parameters:

callback – Function receiving event dict with keys: - x (float): Horizontal Axis value (where the pointer event occurred) - y (float): Vertical Axis value (where the pointer event occurred) - pixelsX: Screen pixel position from left edge of chart canvas - pixelsY: Screen pixel position from top edge of chart canvas - button (int): Mouse button (0=left, 1=middle, 2=right)

Example

>>> trader = TAChart(license_key)
>>> def handler(evt):
...     print('Pointer DOWN event:', evt)
>>> trader.on_pointer_move(handler)
>>> # Later: trend.off_pointer_move()
on_pointer_up(callback)[source]

Subscribe to chart pointer up events.

Parameters:

callback – Function receiving event dict with keys: - x (float): Horizontal Axis value (where the pointer event occurred) - y (float): Vertical Axis value (where the pointer event occurred) - pixelsX: Screen pixel position from left edge of chart canvas - pixelsY: Screen pixel position from top edge of chart canvas - button (int): Mouse button (0=left, 1=middle, 2=right)

Example

>>> trader = TAChart(license_key)
>>> def handler(evt):
...     print('Pointer DOWN event:', evt)
>>> trader.on_pointer_up(handler)
>>> # Later: trend.off_pointer_up()
open(method=None, width='100%', height=600)[source]

Open the technical analysis chart.

Method “browser” will open the chart in your browser. Method “notebook” will display the chart in a notebook environment with an IFrame component. Method “link” will return a URL of the chart that can be used to embed it in external applications.

Parameters:
  • method (str) – “browser” | “notebook” | “link”

  • width (int) – The CSS width value of the IFrame component.

  • height (int) – The CSS height value of the IFrame component.

Returns:

Returns a URL string if method is “link”, otherwise returns the class instance.

Return type:

self | str

remove_chart()[source]

Removes and disposes of the chart.

This method will remove the chart from the view and dispose of it properly.

restore_default_background()[source]

Restores the default background colors and settings.

This method resets any custom background settings to the default configuration.

restore_default_settings()[source]

Restores the default chart and color settings.

This method will reset the chart’s visual settings to their defaults. Indicators and drawing tools will remain unaffected.

save_as_template(template_name='_')[source]

Save the current chart layout as a template.

Parameters:

template_name (str) – The name of the template file to save. Defaults to ‘_’.

set_axis_alignment(axes_on_right)[source]

Sets the alignment of the price axes.

Parameters:

axes_on_right (bool) – Set True to place the price axes on the right side of the chart, False to place them on the left.

set_axis_color(color)[source]

Set the axis color.

Parameters:

color (str) – Color in HEX format e.g. #FFFFFF.

set_background_color(color)[source]

Sets the background color of the entire chart, including both the margin and series areas.

Note

The series area background color can also be controlled via the setSeriesBackgroundColor method.

Parameters:

color (str) – New background color in HEX format, e.g., ‘#FFFFFF’.

set_background_image(source)[source]

Set the chart background image.

Parameters:

source (str) – The image source. This can be: - A URL (remote image). - A local file path. - An already Base64-encoded image string.

set_border_color(color)[source]

Set the chart border color.

Parameters:

color (str) – Color in HEX format e.g. #FFFFFF.

set_chart_title(title)[source]

Sets the title of the current trading chart.

This method allows you to specify a title that will be displayed on the chart.

Parameters:

title (str) – The title text to be displayed on the chart.

set_color_theme(color_theme)[source]

Sets the color theme of the chart.

This method will change the chart’s color theme and override all manually set colors.

Parameters:

color_theme (str) – The new color theme. Example values: ‘cyberSpace’, ‘darkGold’, ‘light’, ‘lightNature’, ‘turquoiseHexagon’.

set_currency(currency)[source]

Manually sets the currency shown on the chart.

Parameters:

currency (str) – The new currency to display.

set_data(data)[source]

Sets the dataset for the chart after converting dateTime values to ISO format.

Parameters:

data (Union[dict, list, DataFrame]) – The dataset to be set. Can be a single dictionary, a single list of OHLC data, multiple lists of OHLC data or Pandas DataFrame.

Examples

>>> ### Using a list of dictionaries: OHLC values come first, then dateTime, and optional fields last.
>>> data = [
>>>     {'open': 1.1, 'high': 1.2, 'low': 1.0, 'close': 1.15, 'dateTime': "Jan 1, 1970"},
>>>     {'open': 1.9, 'high': 1.9, 'low': 1.7, 'close': 1.85, 'dateTime': "Thu, 01 Jan 1970 00:00:00 GMT+0000"}
>>> ]
>>> trader.set_data(data)
>>> ### Using a single dictionary
>>> data = {'open': 1.1, 'high': 1.2, 'low': 1.0, 'close': 1.15, 'dateTime': "Jan 1, 1970"}
>>> trader.set_data(data)
>>> ### Using a list of lists: Ensure OHLC values come first, followed by dateTime, then optional fields.
>>> data = [
>>>     [1.1, 1.2, 1.0, 1.15, "Jan 1, 1970"],
>>>     [1.2, 1.3, 1.1, 1.25, "Feb 1, 1970"]
>>> ]
>>> trader.set_data(data)
>>> ### Using a DataFrame
>>> df = pd.read_csv('data/Tesla.csv')
>>> trader.set_data(df)
>>> ### Mixed formats with different dateTime formats
>>> data = [
>>>     {'open': 1.6, 'high': 1.7, 'low': 1.5, 'close': 1.65, 'dateTime': '2024-10-22'},
>>>     {'open': 1.7, 'high': 1.8, 'low': 1.6, 'close': 1.75, 'dateTime': '2024-10-23'}
>>> ]
>>> trader.set_data(data)
set_data_packing(packing_enabled)[source]

Sets whether OHLC-data should be packed when showing a large number of data values.

Enabling packing improves performance but may lose accuracy of the data.

Parameters:

packing_enabled (bool) – Set True to enable packing, False to disable it.

set_data_point_limit(limit)[source]

Set maximum number of data points to display.

Parameters:

limit (int) – Maximum data points (e.g., 1000).

Example

>>> trader.set_data_point_limit(1000)
>>> trader.load_csv('PATH/TO/FILE.csv')
This limits the chart to display only the latest 1000 data points from the loaded CSV file.
set_latest_value_label_type(label_type)[source]

Sets the value label type for the latest value on the chart.

Parameters:

label_type (str) – The value label type. Valid values: ‘LabelAndLine’, ‘Label’, ‘Line’, ‘Hidden’.

set_line_color(color)[source]

Sets the color for Line and Mountain chart types.

Parameters:

color (str) – The new color as a string in HEX format, e.g., ‘#FFFFFF’.

set_negative_body_color(new_color)[source]

Sets the color for negative candlesticks.

Parameters:

new_color (str) – The new color for negative candlesticks as a string in HEX format, e.g., ‘#FF0000’ for red.

set_negative_wick_color(new_color)[source]

Sets the color for wicks (shadows) of negative candlesticks.

Parameters:

new_color (str) – The new color for negative wicks as a string in HEX format, e.g., ‘#FF0000’ for red.

set_ohlc_cursor_tracking(tracking_type)[source]

Sets which value the cursor tracks and is shown in the price axis label.

Parameters:

tracking_type (int) – The OHLCTrackingType value to track. Should be one of the following: 0 for All (shows each of the OHLC-data values), 1 for Open, 2 for High, 3 for Low, 4 for Close, 5 for CursorLocation (show the price value of the current cursor position).

set_open_interest_data(open_interest_data)[source]

Sets new Open Interest data to the chart.

Parameters:

open_interest_data (list) – A list of numbers representing the new Open Interest data.

set_panning_button(panningButton)[source]

Sets the mouse button used for panning.

Note: Panning and rectangle zooming cannot be assigned to the same button.

Parameters:

panningButton (int) – Specifies the mouse button for panning. The value should be from the MouseButtonSelection enumeration: - 0 (LeftButton): Interaction is controlled by the left mouse button. - 1 (RightButton): Interaction is controlled by the right mouse button. - 2 (MiddleButton): Interaction is controlled by the middle mouse button. - 3 (Off): Interaction is disabled.

set_percent_scale(use_percentage)[source]

Allows showing price value changes as percentages.

Parameters:

use_percentage (bool) – Set True to show price changes as percentages, False to show absolute values.

set_positive_body_color(new_color)[source]

Sets the color for positive candlesticks.

Parameters:

new_color (str) – The new color for positive candlesticks as a string in HEX format, e.g., ‘#00FF00’ for green.

set_positive_wick_color(new_color)[source]

Sets the color for wicks (shadows) of positive candlesticks.

Parameters:

new_color (str) – The new color for positive wicks as a string in HEX format, e.g., ‘#00FF00’ for green.

set_price_chart_type(chart_type)[source]

Set the price chart type.

Parameters:

chart_type (str) – The type of the chart to set. Example values: ‘CandleStick’, ‘Bar’, ‘Line’, ‘Mountain’, ‘HeikinAshi’, ‘Renko’, ‘Kagi’, ‘PointAndFigure’

set_rectangle_zooming_button(rectangleZoomingButton)[source]

Sets the mouse button used for rectangle zooming.

Parameters:

rectangleZoomingButton (int) – The mouse button to be used for rectangle zooming. Options are based on the MouseButtonSelection enumeration: - 0 (LeftButton): Use the left mouse button for interaction. - 1 (RightButton): Use the right mouse button for interaction. - 2 (MiddleButton): Use the middle mouse button for interaction. - 3 (Off): Disable rectangle zooming.

Note

Rectangle zooming and panning cannot be assigned to the same mouse button.

set_result_table_position(result_table_position)[source]

Sets the visibility and the position of the result table.

Parameters:

result_table_position (int) – The position of the result table. Should be one of the following: 0 for Hidden, 1 for TopLeft (top-left corner of the chart), 2 for CursorLocation (shown next to the cursor).

set_series_background_color(color, **kwargs)[source]

Sets the background color of the series area where data is drawn.

Parameters:
  • color (str) – The new background color in HEX format (e.g., #FFFFFF).

  • **kwargs

    Optional parameters for customizing the background fill style: - fillStyle (int, optional): The fill style for the background.

    • 0 (Solid): Solid, single color fill (default).

    • 1 (LinearGradient): Linear gradient fill using two colors.

    • 2 (RadialGradient): Radial gradient fill using two colors.

    • gradientColor (str, optional): The second color used for gradients (in HEX format).

    • angle (float, optional): The angle of the linear gradient in degrees (0-360).

    • gradientSpeed (float, optional): Speed of gradient transition.
      • 1 signifies even distribution between colors.

      • Values smaller than 1 cause faster transitions.

      • Values larger than 1 cause slower transitions.

    • positionX (float, optional): X-position of the radial gradient center.
      • 0 = left edge, 1 = right edge.

    • positionY (float, optional): Y-position of the radial gradient center.
      • 0 = bottom of the chart, 1 = top of the chart.

set_splitter_color(color)[source]

Set the color of chart splitters.

Parameters:

color (str) – Color in HEX format e.g. #FFFFFF.

set_time_range(start_time, end_time)[source]

Sets the time range. Data values only within this range will be shown.

Parameters:
  • start_time (datetime) – The start time for the range.

  • end_time (datetime) – The end time for the range.

set_transparent_chart(transparent=<class 'bool'>)[source]

Sets the chart to use transparent background

set_vertical_panning(verticalPanning)[source]

Enables or disables vertical panning, affecting the Y-axis range.

Parameters:

verticalPanning (bool) – Set True to enable vertical panning, or False to disable it.

set_vertical_zooming(verticalZooming)[source]

Enables or disables vertical zooming, affecting the Y-axis range.

Parameters:

verticalZooming (bool) – Set True to enable vertical zooming, or False to disable it.

set_volume_data(volume_data)[source]

Sets new Volume data to the chart.

Note that if the length of the Volume data array is different from the length of the current OHLC-data set, some indicators cannot be calculated correctly.

Parameters:

volume_data (list) – A list of numbers representing the new Volume data.

set_watermark_text(watermark_text)[source]

Sets the text shown in the symbol watermark.

Note: showSymbolWatermark needs to be set to True for the text to show up.

Parameters:

watermark_text (str) – The new watermark text to display.

set_wheel_zooming(zooming_mode)[source]

Sets the zooming mode for the mouse wheel.

This method configures how the chart responds to mouse wheel zooming. The zooming behavior is also influenced by the vertical zooming setting.

Args: zooming_mode (int): The desired wheel zooming mode, based on the following enumeration:

  • 0 (KeepEnd): Zooms towards the latest data points.

  • 1 (KeepStart): Zooms towards the earliest data points.

  • 2 (TowardPointer): Zooms towards the pointer location.

  • 3 (Centered): Zooms towards the center of the chart.

  • 4 (Off): Disables mouse wheel zooming.

set_x_axis_left_button_interaction(interaction)[source]

Set X-axis left mouse button interaction.

Parameters:

interaction (str) – ‘DragZoom’, ‘Pan’, ‘RectangleZoom’, ‘ZoomToEnd’, or ‘Off’

set_x_axis_right_button_interaction(interaction)[source]

Set X-axis right mouse button interaction.

Parameters:

interaction (str) – ‘DragZoom’, ‘Pan’, ‘RectangleZoom’, ‘ZoomToEnd’, or ‘Off’

set_y_axis_left_button_interaction(interaction)[source]

Set Y-axis left mouse button interaction.

Parameters:

interaction (str) – ‘DragZoom’, ‘Pan’, ‘RectangleZoom’, ‘ZoomToEnd’, or ‘Off’

set_y_axis_right_button_interaction(interaction)[source]

Set Y-axis right mouse button interaction.

Parameters:

interaction (str) – ‘DragZoom’, ‘Pan’, ‘RectangleZoom’, ‘ZoomToEnd’, or ‘Off’

set_zooming_sensitivity(sensitivity)[source]

Set the mouse wheel zooming sensitivity.

Parameters:

sensitivity (float) – Sensitivity value.

show_chart_border(show)[source]

Show or hide the chart border.

Parameters:

show (bool) – True to show, False to hide.

show_chart_title(showTitle)[source]

“” Shows or hides the chart title.

Parameters:

showTitle (bool) – Set True to show the chart title, or False to hide it.

show_file_selection(showFileSelection)[source]

Shows or hides the file selection button.

Parameters:

showFileSelection (bool) – Set True to show the file selection button, or False to hide it.

show_horizontal_cursor_line(show_line)[source]

Shows or hides the horizontal cursor line and its label.

Parameters:

show_line (bool) – Set True to show the horizontal cursor line, False to hide it.

show_indicator_buttons(show)[source]

Show or hide indicator buttons in the toolbar.

Parameters:

show (bool) – True to show, False to hide.

Shows or hides the search bar for symbols.

Parameters:

show_searchbar (bool) – Set True to show the search bar, False to hide it.

show_splitter_lines(show_splitter_lines)[source]

Shows or hides splitter lines between the chart segments.

When enabled, splitter lines between the chart segments are shown, and they can be dragged to resize the segments.

Parameters:

show_splitter_lines (bool) – Set True to show splitter lines, False to hide them.

show_symbol_watermark(show_symbol_watermark)[source]

Shows or hides the symbol watermark written on the middle of the price chart.

Parameters:

show_symbol_watermark (bool) – Set True to show the watermark, False to hide it.

show_theme_image(show_theme_image)[source]

Shows or hides the background image.

This works with Cyber Space and Turquoise Hexagon themes.

Parameters:

show_theme_image (bool) – Set True to show the image, False to hide it.

show_toolbar(show_toolbar)[source]

Shows or hides the whole toolbar on the left side of the chart.

This includes data addition UI like “Dataset from file” button, time range selection, and all the settings buttons in the top-right corner.

Parameters:

show_toolbar (bool) – Set True to show the toolbar, False to hide it.

show_value_labels(show)[source]

Control whether value labels should be displayed on the chart.

Parameters:

show (bool) – Set True to show value labels, False to hide them.

show_vertical_cursor_line(show_line)[source]

Shows or hides the vertical cursor line and its label.

Parameters:

show_line (bool) – Set True to show the vertical cursor line, False to hide it.

show_zoom_band_chart(show_zoom_band_chart)[source]

Shows or hides the zoom band chart below the main chart.

When enabled, the zoom band chart depicts the whole X-axis range of the main chart.

Parameters:

show_zoom_band_chart (bool) – Set True to show the zoom band chart, False to hide it.

technical_analysis_methods()[source]

Returns instance of TechnicalAnalysisMethods class.

update_last_data_point(*args, **kwargs)[source]

Updates the last data point on the chart with new OHLC values, and optionally volume and open interest.

Parameters:
  • *args – Positional arguments for open, high, low, close, volume, and openInterest in order.

  • data_point (Union[dict, list, None]) – A dictionary or list representing the data point.

  • **kwargs – Additional keyword arguments for data point fields (e.g., open, high, low, close, etc.).

Examples

>>> ### Using positional arguments: Ensure OHLC values come first, followed by dateTime, then optional fields.
>>> trader.update_last_data_point(101.5, 102.0, 100.0, 101.8, "2024-11-25", 15000, 5000)
>>> trader.update_last_data_point(101.5, 102.0, 100.0, 101.8, "2024-11-25")
>>> ### Using a dictionary
>>> trader.update_last_data_point({
>>>     "open": 101.5, "high": 102.0, "low": 100.0, "close": 101.8,
>>>     "dateTime": "2024-11-25", "volume": 15000, "openInterest": 5000
>>> })
>>> ### Using a list: Ensure OHLC values come first, followed by dateTime, then optional fields.
>>> trader.update_last_data_point([101.5, 102.0, 100.0, 101.8, "2024-11-25", 15000, 5000])
>>> trader.update_last_data_point([101.5, 102.0, 100.0, 101.8, "2024-11-25"])
>>> ### Using keyword arguments
>>> trader.update_last_data_point(open=101.5, high=102.0, low=100.0, close=101.8, dateTime="2024-11-25", volume=15000, openInterest=5000)
>>> trader.update_last_data_point(open=101.5, high=102.0, low=100.0, close=101.8)
zoom_to_fit()[source]

Zooms the chart so that all data is visible.

This method automatically adjusts the chart view to ensure all data points are displayed within the visible area.

zoom_to_range(start_time, end_time)[source]

Zooms horizontally to given time range..

Parameters:
  • start_time (datetime) – The start time for the range.

  • end_time (datetime) – The end time for the range.

Examples

>>> start_time = datetime(2013, 3, 3)
>>> end_time = datetime(2013, 4, 4)
>>> chart.zoom_to_range(start_time, end_time)

Module contents