lightningchart_trader.drawing_tools package¶
Submodules¶
lightningchart_trader.drawing_tools.arrow module¶
- class lightningchart_trader.drawing_tools.arrow.Arrow(trader, x_position, y_position, arrow_type)[source]¶
Bases:
DrawingToolBase- set_arrow_color(color)[source]¶
Sets the color of the arrow.
- Parameters:
color (str) – New arrow color as string, should be in HEX format e.g. #FFFFFF.
- set_arrow_size(width, height)[source]¶
Sets the size of the arrow in pixels.
- Parameters:
width (int) – New arrow width.
height (int) – New arrow height.
lightningchart_trader.drawing_tools.cross_line module¶
- class lightningchart_trader.drawing_tools.cross_line.CrossLine(trader, x_position, y_position)[source]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the color of the Cross Line.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Cross Line.
- Parameters:
width (int | float) – New line width.
lightningchart_trader.drawing_tools.cycle_lines module¶
- class lightningchart_trader.drawing_tools.cycle_lines.CycleLines(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_fill_enabled(fillEnabled)[source]¶
Sets whether the area between the cycle lines is filled.
- Parameters:
fillEnabled (bool) – Set true to enable fill.
- set_line_color(color)[source]¶
Sets the color of the Cycle Lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Cycle Lines.
- Parameters:
width (int | float) – New line width.
- set_time_zone_count(timeZoneCount)[source]¶
Sets the number of time zones.
- Parameters:
timeZoneCount (int) – New time zone count.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Start point X-location.
startY (int | float) – Start point Y-location.
endX (int | float) – End point X-location.
endY (int | float) – End point Y-location.
lightningchart_trader.drawing_tools.date_range module¶
- class lightningchart_trader.drawing_tools.date_range.DateRange(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Date Range.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_fill_enabled(fill_enabled)[source]¶
Sets whether the measurement area is colored or not.
- Parameters:
fill_enabled (bool) – Set true to enable colored fill.
- set_line_color(color)[source]¶
Sets the line color.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the lines.
- Parameters:
width (int | float) – New line width.
- update_position(point1X, point1Y, point2X, point2Y)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
point1X (int | float) – First point X-location.
point1Y (int | float) – First point Y-location.
point2X (int | float) – Second point X-location.
point2Y (int | float) – Second point Y-location.
lightningchart_trader.drawing_tools.elliot_wave module¶
- class lightningchart_trader.drawing_tools.elliot_wave.ElliotWave(trader, waveType, startX, startY, secondX, 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]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the line color of the wave lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the wave lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- set_wave_type(wave_type)[source]¶
Sets the type of the Elliot Wave.
- Parameters:
wave_type (int) – Elliot Wave type. Possible values: 0: ElliotWave 1: ImpulseWave 2: TriangleWave 3: TripleComboWave 4: CorrectionWave 5: DoubleComboWave
- update_position(startPosition=None, position1=None, position2=None, position3=None, position4=None, position5=None, positionA=None, positionB=None, positionC=None)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startPosition (Point) – First control point location.
position1 (Point) – Second control point location (1).
position2 (Point) – Third control point location (2).
position3 (Point) – Fourth control point location (3).
position4 (Point) – Fifth control point location (4).
position5 (Point) – Sixth control point location (5).
positionA (Point) – Seventh control point location (A).
positionB (Point) – Eighth control point location (B).
positionC (Point) – Ninth control point location (C).
lightningchart_trader.drawing_tools.ellipse module¶
- class lightningchart_trader.drawing_tools.ellipse.Ellipse(trader, startX, startY, radiusX=None, radiusY=None)[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Ellipse.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the Ellipse’s border lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Ellipse’s border lines.
- Parameters:
width (int | float) – New line width.
- update_position(point1X, point2X, point1Y, point2Y)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
point1X (int | float) – X-location of the Ellipse’s left edge.
point2X (int | float) – X-location of the Ellipse’s right edge.
point1Y (int | float) – Y-location of the Ellipse’s bottom edge.
point2Y (int | float) – Y-location of the Ellipse’s top edge.
lightningchart_trader.drawing_tools.extended_line module¶
- class lightningchart_trader.drawing_tools.extended_line.ExtendedLine(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_extend_lines(extendLeft, extendRight)[source]¶
Sets whether the top and bottom lines should be extended to the left and right edges of the chart.
- Parameters:
extendLeft (bool) – Set true to extend the lines to the left edge.
extendRight (bool) – Set true to extend the lines to the right edge.
- set_line_color(color)[source]¶
Sets the color of the Trend Line.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Trend Line.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.fibonacci_arc module¶
- class lightningchart_trader.drawing_tools.fibonacci_arc.FibonacciArc(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_fill_enabled(fillEnabled)[source]¶
Set whether areas between the Fibonacci Arc lines are colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colors.
- set_line_color(color)[source]¶
Sets the color of the Fibonacci Arc lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Fibonacci Arc lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.fibonacci_extension module¶
- class lightningchart_trader.drawing_tools.fibonacci_extension.FibonacciExtension(trader, firstX, firstY, secondX=None, secondY=None, thirdX=None, thirdY=None)[source]¶
Bases:
DrawingToolBase- set_extend_lines(enabled)[source]¶
Sets whether the two lines extend to the edge of the chart.
- Parameters:
enabled (bool) – Set true to extend the lines.
- set_fill_enabled(fillEnabled)[source]¶
Sets whether areas between the Fibonacci levels are colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable the fill.
- set_line_color(color)[source]¶
Sets the color of the Fibonacci Extension lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Fibonacci Extension lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- set_show_prices(showPrices)[source]¶
Shows the price values of each Fibonacci level label.
- Parameters:
showPrices (bool) – Set true to show the price values.
- update_position(startX, startY, midX, midY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
midX (int | float) – Middle point X location.
midY (int | float) – Middle point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.fibonacci_fan module¶
- class lightningchart_trader.drawing_tools.fibonacci_fan.FibonacciFan(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_fill_enabled(fillEnabled)[source]¶
Set whether areas between the Fibonacci Lines are colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colors.
- set_line_color(color)[source]¶
Sets the color of the Fibonacci Fan lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Fibonacci Fan lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.fibonacci_retracements module¶
- class lightningchart_trader.drawing_tools.fibonacci_retracements.FibonacciRetracements(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_fill_enabled(fillEnabled)[source]¶
Set whether areas between the Fibonacci Lines are colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colors.
- set_line_color(color)[source]¶
Sets the color of the Fibonacci Retracement lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Fibonacci Retracement lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.fibonacci_time_zones module¶
- class lightningchart_trader.drawing_tools.fibonacci_time_zones.FibonacciTimeZones(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_fill_enabled(fillEnabled)[source]¶
Set whether areas between the Fibonacci Lines are colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colors.
- set_line_color(color)[source]¶
Sets the line color of the Fibonacci Lines. Affects also the areas between the lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the line width of the Fibonacci Lines.
- Parameters:
width (int | float) – New line width.
- set_time_zone_count(timeZoneCount)[source]¶
Sets the number of visible time zones.
- Parameters:
timeZoneCount (int) – New time zone count.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.flat_top_bottom module¶
- class lightningchart_trader.drawing_tools.flat_top_bottom.FlatTopBottom(trader, startX, startY, endX=None, endY=None, flatYValue=None)[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the color of the area between the lines.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_extend_lines(enabled)[source]¶
Sets whether the two lines extend to the edge of the chart.
- Parameters:
enabled (bool) – Set true to extend the lines.
- set_fill_enabled(fillEnabled)[source]¶
Sets whether the area between the two lines is colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colored fill.
- set_line_color(color)[source]¶
Sets the color of the lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, endX, trendStartY, trendEndY, flatY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Trend line first point X-location.
endX (int | float) – Trend line second point X-location.
trendStartY (int | float) – Trend line first point Y-location.
trendEndY (int | float) – Trend line second point Y-location.
flatY (int | float) – Flat line Y-location.
lightningchart_trader.drawing_tools.gannbox module¶
- class lightningchart_trader.drawing_tools.gannbox.GannBox(trader, startX, startY, endX, endY, lineColor, lineWidth, areaColor)[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Date Range.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the Gann Box.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g., #FFFFFF.
- set_line_width(width)[source]¶
Sets the line width of the Gann Box.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the Gann Box should snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- show_angles(show_angles)[source]¶
Sets whether diagonal angle lines are shown inside the Gann Box.
- Parameters:
show_angles (bool) – Set true to show diagonal lines.
- update_position(topLeftX, topLeftY, topRightX, topRightY, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY)[source]¶
Updates the Gann Box based on control points’ locations.
- Parameters:
topLeftX (int | float) – Top left X-location.
topLeftY (int | float) – Top left Y-location.
topRightX (int | float) – Top right X-location.
topRightY (int | float) – Top right Y-location.
bottomLeftX (int | float) – Bottom left X-location.
bottomLeftY (int | float) – Bottom left Y-location.
bottomRightX (int | float) – Bottom right X-location.
bottomRightY (int | float) – Bottom right Y-location.
lightningchart_trader.drawing_tools.gannfan module¶
- class lightningchart_trader.drawing_tools.gannfan.GannFan(trader, startX, startY, endX, endY, lineColor, lineWidth)[source]¶
Bases:
DrawingToolBase- set_fill_enabled(fillEnabled)[source]¶
Sets whether the area between the cycle lines is filled.
- Parameters:
fillEnabled (bool) – Set true to enable fill.
- set_line_color(color)[source]¶
Sets the line color of the Gann Box.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g., #FFFFFF.
- set_line_width(width)[source]¶
Sets the line width of the Gann Box.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the Gann Box should snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Start point X-location.
startY (int | float) – Start point Y-location.
endX (int | float) – End point X-location.
endY (int | float) – End point Y-location.
lightningchart_trader.drawing_tools.head_and_shoulders module¶
- class lightningchart_trader.drawing_tools.head_and_shoulders.HeadAndShoulders(trader, 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]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Head and Shoulders.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the Head and Shoulders lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Head and Shoulders lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startPosition=None, positionLS=None, position1stTrough=None, positionHead=None, position2ndTrough=None, positionRS=None, positionEnd=None)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startPosition (dict, optional) – Starting control point location.
positionLS (dict, optional) – Left shoulder control point location.
position1stTrough (dict, optional) – First trough control point location.
positionHead (dict, optional) – Head control point location.
position2ndTrough (dict, optional) – Second trough control point location.
positionRS (dict, optional) – Right shoulder control point location.
positionEnd (dict, optional) – Last control point location.
lightningchart_trader.drawing_tools.horizontal_line module¶
- class lightningchart_trader.drawing_tools.horizontal_line.HorizontalLine(trader, yPosition, lineColor='#000000', lineWidth=1)[source]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the color of the Horizontal Line.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
lightningchart_trader.drawing_tools.horizontal_ray module¶
- class lightningchart_trader.drawing_tools.horizontal_ray.HorizontalRay(trader, xPosition, yPosition, lineColor='#000000', lineWidth=1)[source]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the color of the Horizontal Ray.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Horizontal Ray.
- Parameters:
width (int | float) – New line width.
lightningchart_trader.drawing_tools.linear_regression_channel module¶
- class lightningchart_trader.drawing_tools.linear_regression_channel.LinearRegressionChannel(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_channel_type(channelType)[source]¶
Sets the type of the Linear regression Channel.
- Parameters:
channelType (int) – Channel type. Possible values: 0: Line 1: RaffChannel 2: StandardDeviations
- set_fill_enabled(fillEnabled)[source]¶
Set whether areas between the channel lines are colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable fill.
- set_line_color(color)[source]¶
Sets the color of the channel lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the channel lines.
- Parameters:
width (int | float) – New line width.
lightningchart_trader.drawing_tools.parallel_channel module¶
- class lightningchart_trader.drawing_tools.parallel_channel.ParallelChannel(trader, startX, startY, endX=None, endY=None, channelHeight=None)[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the color of the channel area.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_extend_lines(enabled)[source]¶
Sets whether the two lines extend to the edge of the chart.
- Parameters:
enabled (bool) – Set true to extend the lines.
- set_fill_enabled(fillEnabled)[source]¶
Sets whether the channel area is colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colored fill.
- set_line_color(color)[source]¶
Sets the color of the lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, endX, upperStartY, upperEndY, priceRange)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Channel’s starting X-location.
endX (int | float) – Channel’s ending X-location.
upperStartY (int | float) – Y-location for the starting point of the first line.
upperEndY (int | float) – Y-location for the ending point of the first line.
priceRange (int | float) – Price value range between the two channel lines.
lightningchart_trader.drawing_tools.pitchfork module¶
- class lightningchart_trader.drawing_tools.pitchfork.Pitchfork(trader, startX, startY, endX1=None, endY1=None, endX2=None, endY2=None, lineColor='#000000', lineWidth=1, areaColor='#FFFFFF')[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Pitchfork.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the Pitchfork lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Pitchfork lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX1, endY1, endX2, endY2)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X-location.
startY (int | float) – Starting point Y-location.
endX1 (int | float) – First end point X-location.
endY1 (int | float) – First end point Y-location.
endX2 (int | float) – Second end point X-location.
endY2 (int | float) – Second end point Y-location.
lightningchart_trader.drawing_tools.plain_text module¶
- class lightningchart_trader.drawing_tools.plain_text.PlainText(trader, positionX, positionY, text='Text', textColor='#000000')[source]¶
Bases:
DrawingToolBase- set_font_size(fontSize)[source]¶
Sets the font size of the text.
- Parameters:
fontSize (int | float) – New font size for the text.
lightningchart_trader.drawing_tools.price_range module¶
- class lightningchart_trader.drawing_tools.price_range.PriceRange(trader, startX, startY, endX=None, endY=None, lineColor='#000000', lineWidth=1, areaColor='#FFFFFF')[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Price Range.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_extend_lines(extendLeft, extendRight)[source]¶
Sets whether the top and bottom lines should be extended to the left and right edges of the chart.
- Parameters:
extendLeft (bool) – Set true to extend the lines to the left edge.
extendRight (bool) – Set true to extend the lines to the right edge.
- set_fill_enabled(fillEnabled)[source]¶
Sets whether the measurement area is colored or not.
- Parameters:
fillEnabled (bool) – Set true to enable colored fill.
- set_line_color(color)[source]¶
Sets the line color.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(point1X, point1Y, point2X, point2Y)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
point1X (int | float) – First point X-location.
point1Y (int | float) – First point Y-location.
point2X (int | float) – Second point X-location.
point2Y (int | float) – Second point Y-location.
lightningchart_trader.drawing_tools.rectangle module¶
- class lightningchart_trader.drawing_tools.rectangle.Rectangle(trader, startX, startY, endX=None, endY=None, lineColor='#000000', lineWidth=1, areaColor='#FFFFFF')[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Rectangle.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the Rectangle border lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Rectangle border lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(point1X, point1Y, point2X, point2Y)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
point1X (int | float) – First point X-location.
point1Y (int | float) – First point Y-location.
point2X (int | float) – Second point X-location.
point2Y (int | float) – Second point Y-location.
lightningchart_trader.drawing_tools.sine_wave module¶
- class lightningchart_trader.drawing_tools.sine_wave.SineWave(trader, startX, startY, endX=None, endY=None)[source]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the color of the Sine Wave.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Sine Wave.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- set_smoothness(smoothness)[source]¶
Sets the smoothness of the Sine Wave.
- Parameters:
smoothness (int | float) – The smoothness value for the wave.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Start point X-location.
startY (int | float) – Start point Y-location.
endX (int | float) – End point X-location.
endY (int | float) – End point Y-location.
lightningchart_trader.drawing_tools.text_box module¶
- class lightningchart_trader.drawing_tools.text_box.TextBox(trader, positionX, positionY, text='Text', textColor='#000000')[source]¶
Bases:
DrawingToolBase- set_border_color(color)[source]¶
Sets the border color of the text box.
- Parameters:
color (str) – New border color as string, should be in HEX format e.g. #FFFFFF.
- set_border_width(width)[source]¶
Sets the border width of the text box.
- Parameters:
width (int | float) – New border width.
- set_fill_color(color)[source]¶
Sets the fill color of the text box.
- Parameters:
color (str) – New fill color as string, should be in HEX format e.g. #FFFFFF.
- set_font_size(fontSize)[source]¶
Sets the font size of the text.
- Parameters:
fontSize (int | float) – New font size for the text.
lightningchart_trader.drawing_tools.trend_line module¶
- class lightningchart_trader.drawing_tools.trend_line.TrendLine(trader, startX, startY, endX=None, endY=None, lineColor='#000000', lineWidth=1)[source]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the color of the Trend Line.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Trend Line.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(startX, startY, endX, endY)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
startX (int | float) – Starting point X location.
startY (int | float) – Starting point Y location.
endX (int | float) – End point X location.
endY (int | float) – End point Y location.
lightningchart_trader.drawing_tools.triangle module¶
- class lightningchart_trader.drawing_tools.triangle.Triangle(trader, startX, startY, endX1=None, endY1=None, endX2=None, endY2=None, lineColor='#000000', lineWidth=1, areaColor='#FFFFFF')[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the Triangle.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the Triangle lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the Triangle lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- update_position(point1X, point1Y, point2X, point2Y, point3X, point3Y)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
point1X (int | float) – First point X-location.
point1Y (int | float) – First point Y-location.
point2X (int | float) – Second point X-location.
point2Y (int | float) – Second point Y-location.
point3X (int | float) – Third point X-location.
point3Y (int | float) – Third point Y-location.
lightningchart_trader.drawing_tools.vertical_line module¶
- class lightningchart_trader.drawing_tools.vertical_line.VerticalLine(trader, x_position)[source]¶
Bases:
DrawingToolBase- set_line_color(color)[source]¶
Sets the color of the Vertical Line.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
lightningchart_trader.drawing_tools.xabcd_pattern module¶
- class lightningchart_trader.drawing_tools.xabcd_pattern.XABCDpattern(trader, startX, startY, positionAX=None, positionAY=None, positionBX=None, positionBY=None, positionCX=None, positionCY=None, positionDX=None, positionDY=None, lineColor='#000000', areaColor=1, lineWidth='#FFFFFF')[source]¶
Bases:
DrawingToolBase- set_area_color(color)[source]¶
Sets the area color of the XABCD Pattern.
- Parameters:
color (str) – New area color as string, should be in HEX format e.g. #FFFFFF.
- set_line_color(color)[source]¶
Sets the line color of the XABCD Pattern lines.
- Parameters:
color (str) – New line color as string, should be in HEX format e.g. #FFFFFF.
- set_line_width(width)[source]¶
Sets the width of the XABCD Pattern lines.
- Parameters:
width (int | float) – New line width.
- set_magnetic(is_magnetic)[source]¶
Sets whether the drawing tool should automatically snap to OHLC data points.
- Parameters:
is_magnetic (bool) – Set true to enable snapping to data points.
- show_ratio_numbers(showRatios)[source]¶
When enabled, shows ratio values between various legs.
- Parameters:
showRatios (bool) – Show ratio numbers.
- update_position(positionX=None, positionA=None, positionB=None, positionC=None, positionD=None)[source]¶
Updates the drawing tool based on the control points’ locations.
- Parameters:
positionX (dict) – Location of the X-point.
positionA (dict) – Location of the A-point.
positionB (dict) – Location of the B-point.
positionC (dict) – Location of the C-point.
positionD (dict) – Location of the D-point.
Module contents¶
- class lightningchart_trader.drawing_tools.DrawingToolBase(trader)[source]¶
Bases:
objectBase class for all Drawing Tools.
- get_position()[source]¶
Gets the current position of the drawing tool.
Note
This method should be used after the chart is opened with the open() method.
- Returns:
- For most tools, returns list of points [{‘x’: x1, ‘y’: y1}, {‘x’: x2, ‘y’: y2}, …].
For Horizontal/Vertical lines, returns single value {‘x’: x} or {‘y’: y}.
- Return type:
list or dict
- on_drawing_tool_moved(callback)[source]¶
Subscribe to drawing tool moved events (triggered when position changes).
- Parameters:
callback – Function receiving event dict with keys: - xPosition (float): New X coordinate (data/axis value, not pixels) - yPosition (float): New Y coordinate (data/axis value, not pixels) - drawingTool (dict): Reference with ‘id’ and ‘type’ of the drawing tool
- on_pointer_down(callback)[source]¶
Subscribe to pointer down events on the drawing tool.
- Parameters:
callback – Function receiving event dict with keys: - x (float): Chart X coordinate (data/axis value, not pixels) - y (float): Chart Y coordinate (data/axis value, not pixels) - xClient (float): Screen X coordinate in pixels - yClient (float): Screen Y coordinate in pixels - button (int): Mouse button (0=left, 1=middle, 2=right) - isControlPoint (bool): True if clicked on control point (the draggable endpoints)
Example
>>> trend = trader.add_trend_line(100, 200, 150, 250) >>> def handler(evt): ... print('Pointer DOWN event:', evt) >>> trend.on_pointer_down(handler) >>> # Later: trend.off_pointer_down()
- on_pointer_enter(callback)[source]¶
Subscribe to pointer enter events (mouse enters drawing tool area).
- Parameters:
callback – Function receiving event dict with keys: - x (float): Chart X coordinate (data/axis value, not pixels) - y (float): Chart Y coordinate (data/axis value, not pixels) - xClient (float): Screen X coordinate in pixels - yClient (float): Screen Y coordinate in pixels - button (int): Mouse button (0=left, 1=middle, 2=right) - isControlPoint (bool): True if clicked on control point (the draggable endpoints)
Example
>>> trend = trader.add_trend_line(100, 200, 150, 250) >>> def handler(evt): ... print('Pointer ENTER event:', evt) >>> trend.on_pointer_enter(handler) >>> # Later: trend.off_pointer_enter()
- on_pointer_leave(callback)[source]¶
Subscribe to pointer leave events (mouse leaves drawing tool area).
- Parameters:
callback – Function receiving event dict with keys: - x (float): Chart X coordinate (data/axis value, not pixels) - y (float): Chart Y coordinate (data/axis value, not pixels) - xClient (float): Screen X coordinate in pixels - yClient (float): Screen Y coordinate in pixels - button (int): Mouse button (0=left, 1=middle, 2=right) - isControlPoint (bool): True if clicked on control point (the draggable endpoints)
Example
>>> trend = trader.add_trend_line(100, 200, 150, 250) >>> def handler(evt): ... print('Pointer LEAVE event:', evt) >>> trend.on_pointer_leave(handler) >>> # Later: trend.off_pointer_leave()
- on_pointer_up(callback)[source]¶
Subscribe to pointer up events on the drawing tool.
- Parameters:
callback – Function receiving event dict with keys: - x (float): Chart X coordinate (data/axis value, not pixels) - y (float): Chart Y coordinate (data/axis value, not pixels) - xClient (float): Screen X coordinate in pixels - yClient (float): Screen Y coordinate in pixels - button (int): Mouse button (0=left, 1=middle, 2=right) - isControlPoint (bool): True if clicked on control point (the draggable endpoints)
Example
>>> trend = trader.add_trend_line(100, 200, 150, 250) >>> def handler(evt): ... print('Pointer UP event:', evt) >>> trend.on_pointer_up(handler) >>> # Later: trend.off_pointer_up()