Summary:
The drawing script speedlines measure the rate of ascent or descent of a trend of the underlying symbol price, as it develops.

Developer:
Edson Gould

Interpretation:
1. 2/3 Line Support: When the underlying symbol price is falling, support should be found above the 2/3 line.
2. 1/3 Line Support: When prices do fall below the 2/3 line, they should quickly drop to the 1/3 line where they should then again find support.
3. 1/3 Line Resistence: When the underlying symbol price is rising, resistance should be found below the 1/3 line.
4. 2/3 Line Resistence: When prices do raise above the 1/3 line, they should quickly raise to the 2/3 line where they should then again find resistence.

                    
#region Namespaces using System; #endregion namespace ScriptCode { /// <summary> /// Drawing scripts are used for drawing a visual object. /// /// This script can be used in several ways: /// (1) It can be used on a chart by clicking the chart in order to set the drawing's anchor points. /// (2) It can be used from another script by having that script set the drawing's anchor points. /// </summary> public partial class MyDrawing : DrawingScriptBase // NEVER CHANGE THE CLASS NAME { #region Variables #endregion #region OnInitialize /// <summary> /// This function is called when a new drawing instance is created. /// </summary> /// -------------------------------------------------------------------------------------------------- /// THIS FUNCTION MUST ACCEPT THE SYMBOL INDEX PARAMETER AND SHOULD NOT ACCEPT ANY OTHER PARAMETERS. /// -------------------------------------------------------------------------------------------------- /// <param name="symbolIndex" type="Symbol" default="">The underlying symbol index for the drawing.</param> public void OnInitialize(int symbolIndex) { // Initialize the drawing for the symbol to accept 2 anchor points. DrawingInitialize(symbolIndex, 2); } #endregion #region OnChartSetup /// <summary> /// This function is used for setting up the drawing on the chart and registering its pens (see the DrawingRegisterPen function). /// </summary> public override void OnChartSetup() { // Register the pens with which to draw the channels. DrawingRegisterPen("Top Pen", new byte[] { 5, 110, 180, 255 }, AT_DashStyle.SOLID, 2); DrawingRegisterPen("Two Thirds Pen", new byte[] { 5, 110, 180, 255 }, AT_DashStyle.SOLID, 2); DrawingRegisterPen("Third Pen", new byte[] { 5, 110, 180, 255 }, AT_DashStyle.SOLID, 2); } #endregion #region OnDraw /// <summary> /// This function is used to draw the drawing by setting all of its anchor points, lines and labels on a virtual canvas. /// The canvas x-axis values are the date and time of the underlying symbol bars and its y-axis values are the symbol prices. /// /// The location of the drawing on the canvas is specified by the drawing anchor points, which can either be specified by /// clicking on a chart or from another script (see the Drawing functions). /// </summary> public override void OnDraw() { // Get the X value of anchor point 0. int line1X = DrawingAnchorPointBarShift(0); // Get the Y value of anchor point 0. double line1Y = DrawingAnchorPointValue(0); // Get the X value of anchor point 1. int line2X = DrawingAnchorPointBarShift(1); // Get the Y value of anchor point 1. double line2Y = DrawingAnchorPointValue(1); double line3Y = line1Y + 2d / 3 * (line2Y - line1Y); double line4Y = line1Y + 1d / 3 * (line2Y - line1Y); if (line1Y > line2Y) { line3Y = line2Y + 2d / 3 * (line1Y - line2Y); line4Y = line2Y + 1d / 3 * (line1Y - line2Y); } // Draw the top line. DrawingSetLine("Top Pen", line1X, line1Y, "", line2X, line2Y, "1"); // Draw the 2 / 3 line. DrawingSetLine("Two Thirds Pen", line1X, line1Y, "", line2X, line3Y, "2/3"); // Draw the 1 / 3 line. DrawingSetLine("Third Pen", line1X, line1Y, "", line2X, line4Y, "1/2"); } #endregion } }

The Algorithmic Trading Software for Hedge Funds and Quants