# DrawingObjects

### AddChartAndrewsPitchfork() <a href="#addchartandrewspitchfork" id="addchartandrewspitchfork"></a>

#### Description <a href="#description" id="description"></a>

This drawing object draws an Andrew’s Pitchfork.

Information concerning its usage: - [*vtad.de*](http://vtadwiki.vtad.de/index.php/Andrews_Pitchfork) - [*hvolumen-analyse.de*](http://www.volumen-analyse.de/blog/?p=917) - [*Godmode-Trader.de*](http://www.godmode-trader.de/wissen/index.php/Chartlehrgang:Andrews_Pitchfork)

#### Usage <a href="#usage" id="usage"></a>

```csharp
AddChartAndrewsPitchfork(string name, bool autoScale, int start1BarsBack, double start1Y, int start2BarsBack, double start2Y, int start3BarsBack, double start3Y, Color color, DashStyle dashStyle, int width)
AddChartAndrewsPitchfork(string name, bool autoScale, DateTime start1Time, double start1Y, DateTime start2Time, double start2Y, DateTime start3Time, double start3Y, Color color, DashStyle dashStyle, int width)
```

#### Return Value <a href="#return-value" id="return-value"></a>

A drawing object of the type IAndrewsPitchfork (interface)

#### Parameter <a href="#parameter" id="parameter"></a>

|                |                                                                                         |
| -------------- | --------------------------------------------------------------------------------------- |
| name           | A clearly identifiable name for the drawing object                                      |
| autoScale      | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| start1BarsBack | Number of bars ago for start point 1 (x-axis)                                           |
| start1Time     | Date/time for start point 1 (x-axis)                                                    |
| start1Y        | y-value for start point 1                                                               |
| start2BarsBack | Number of bars ago for start point 2 (x-axis)                                           |
| start2Time     | Date/time for start point 2 (x-axis)                                                    |
| start2Y        | y-value for start point 2                                                               |
| start3BarsBack | Number of bars ago for start point 3 (x-axis)                                           |
| start3Time     | Date/time for start point 3 (x-axis)                                                    |
| start3Y        | y-value for start point 3                                                               |
| color          | Color of the object                                                                     |
| dashStyle      | LevelLine styles:                                                                       |
|                | DashStyle.Dash                                                                          |
|                | DashStyle.DashDot                                                                       |
|                | DashStyle.DashDotDot                                                                    |
|                | DashStyle.Dot                                                                           |
|                | DashStyle.Solid                                                                         |
|                |                                                                                         |
|                | You may have to integrate: using System.Drawing.Drawing2D;                              |
| width          | LevelLine strength in points                                                            |

#### Example <a href="#example" id="example"></a>

```csharp
// Draw the Andrew’s Pitchfork (“MyAPF”)
AddChartAndrewsPitchfork("MyAPF-" + ProcessingBarIndex, true, 4, Low[4], 3, High[3], 1, Low[1], Color.Black, DashStyle.Solid, 2);
```

### AddChartArc() <a href="#addchartarc" id="addchartarc"></a>

#### Description <a href="#description_1" id="description_1"></a>

AddChartArc() draws a circular arc.

#### Usage <a href="#usage_1" id="usage_1"></a>

```csharp
AddChartArc(string name, int barsBackStart, double startY, int barsBackEnd, double endY, Color color)
AddChartArc(string name, bool isAutoScale, int barsBackStart, double startY, int barsBackEnd, double endY, Color color, DashStyle dashStyle, int width)
AddChartArc(string name, bool isAutoScale, double startX, double  startY,double  endX,double  endY, double  middleX, double  middleY, Color color, DashStyle dashStyle, int width, showOnTop);
```

#### Return Value <a href="#return-value_1" id="return-value_1"></a>

A drawing object of the type IArc (interface)

#### Parameter <a href="#parameter_1" id="parameter_1"></a>

|                  |                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------- |
| name             | A clearly identifiable name for the drawing object                                      |
| IsAutoScale      | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| startX, startY   | Beginning of the arch line                                                              |
| middleX, middleY | Top arc coordinate                                                                      |
| endX, endY       | end of the arch line                                                                    |
| barsBackEnd      | Number of bars ago for the end point                                                    |
| endTime          | Date/time for the end point                                                             |
| endY             | y-value for the end point                                                               |
| color            | Color of the drawing object                                                             |
| dashStyle        | LevelLine style:                                                                        |
|                  | DashStyle.Dash                                                                          |
|                  | DashStyle.DashDot                                                                       |
|                  | DashStyle.DashDotDot                                                                    |
|                  | DashStyle.Dot                                                                           |
|                  | DashStyle.Solid                                                                         |
|                  |                                                                                         |
|                  | You may have to integrate: using System.Drawing.Drawing2D;                              |
| width            | LevelLine strength in points                                                            |

#### Example <a href="#example_1" id="example_1"></a>

```csharp
// AddChart a blue arc
AddChartArc("MyArc-" + ProcessingBarIndex, true, 10, 10, 0, 20, Color.Blue, DashStyle.Solid, 3);
//Add Arc
AddChartArc("test", true, first.Time, 1854, last.Time, 1854, mid.Time, 1938, Color.Black, DashStyle.Custom, 1, true);
```

### AddChartArrowDown() <a href="#addchartarrowdown" id="addchartarrowdown"></a>

#### Description <a href="#description_2" id="description_2"></a>

AddChartArrowDown() draws an arrow pointing downwards:

![AddChartArrowDown()](https://agenatrader.github.io/AgenaScript-documentation/media/image21.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleDown()*](#addcharttriangledown).

#### Usage <a href="#usage_2" id="usage_2"></a>

```csharp
AddChartArrowDown(string name, bool autoScale, int barsAgo, double y, Color color)
AddChartArrowDown(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_2" id="return-value_2"></a>

A drawing object of the type IArrowDown (interface)

#### Parameter <a href="#parameter_2" id="parameter_2"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Sets the preceding bar on which the arrow should be drawn (0 = current bar)             |
| time      | Date/time of the bar on which the arrow should be drawn                                 |
| y         | y-value for the arrow                                                                   |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_2" id="example_2"></a>

```csharp
// Draws a red arrow 3 ticks above the high for the current bar
AddChartArrowDown("MyArrow-" + ProcessingBarIndex, true, 0, High[0] + 3*TickSize, Color.Red);
// Draws a red arrow on a three-bar reversal pattern
if(High[2] > High[3] && High[1] > High[2] && Close[0] < Open[0])
AddChartArrowDown(ProcessingBarIndex.ToString(), true, 0, High[0] + 3*TickSize, Color.Red);
```

### AddChartArrowLine() <a href="#addchartarrowline" id="addchartarrowline"></a>

#### Description <a href="#description_3" id="description_3"></a>

AddChartArrowLine() draws an arrow:

![AddChartArrowLine()](https://agenatrader.github.io/AgenaScript-documentation/media/image22.png)

#### Usage <a href="#usage_3" id="usage_3"></a>

```csharp
 AddChartArrowLine (string name,  int  barsBackStart,  double  startY,  int  barsBackEnd,  double  endY, Color color)
 AddChartArrowLine (string name,  bool  autoScale,  int  barsBackStart,  double  startY,  int  barsBackEnd,  double  endY, Color color, DashStyle dashStyle,  int  width)
 AddChartArrowLine (string name,  bool  autoScale, DateTime startTime,  double  startY, DateTime endTime,  double  endY, Color color, DashStyle dashStyle,  int  width)
```

#### Return Value <a href="#return-value_3" id="return-value_3"></a>

A drawing object of the type IArrowLine (interface)

#### Parameter <a href="#parameter_3" id="parameter_3"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsBackStart | Sets the preceding bar at which the arrow should start (0 = current bar)                |
| startTime     | Date/time of the bar at which the arrow should start                                    |
| startY        | y-value for the starting point of the arrow                                             |
| barsBackEnd   | Sets the preceding bar at which the arrow should end (0 = current bar)                  |
| endTime       | Date/time at which the arrow should end                                                 |
| endY          | y-value at which the arrow should end                                                   |
| color         | Color of the drawing object                                                             |
| dashStyle     | LevelLine style:                                                                        |
|               | DashStyle.Dash                                                                          |
|               | DashStyle.DashDot                                                                       |
|               | DashStyle.DashDotDot                                                                    |
|               | DashStyle.Dot                                                                           |
|               | DashStyle.Solid                                                                         |
|               |                                                                                         |
|               | You may have to integrate: using System.Drawing.Drawing2D;                              |
| width         | LevelLine strength in points                                                            |

#### Example <a href="#example_3" id="example_3"></a>

```csharp
// Draws a black arrow
AddChartArrowLine("MyArrow-" + ProcessingBarIndex, false, 10, 10, 0, 5, Color.Black, DashStyle.Solid, 4);
```

### AddChartArrowUp() <a href="#addchartarrowup" id="addchartarrowup"></a>

#### Description <a href="#description_4" id="description_4"></a>

AddChartArowUp() draws an arrow pointing upwards:

![AddChartArrowUp()](https://agenatrader.github.io/AgenaScript-documentation/media/image23.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleDown()*](#addcharttriangledown).

#### Usage <a href="#usage_4" id="usage_4"></a>

```csharp
AddChartArrowUp(string name, bool autoScale, int barsAgo, double y, Color color)
AddChartArrowUp(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_4" id="return-value_4"></a>

A drawing object of the type IArrowUp (interface)

#### Parameter <a href="#parameter_4" id="parameter_4"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Sets the preceding bar on which the arrow should be drawn (0 = current bar)             |
| time      | Date/time at which the arrow should be drawn                                            |
| y         | y-value for the arrow                                                                   |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_4" id="example_4"></a>

```csharp
// Draws a green arrow for the current bar 3 ticks below the low
AddChartArrowUp("MyArrow-" + ProcessingBarIndex, true, 0, Low[0] - 3*TickSize, Color.Green);
```

### AddChartDiamond() <a href="#addchartdiamond" id="addchartdiamond"></a>

#### Description <a href="#description_5" id="description_5"></a>

AddChartDiamond() draws a diamond:

![AddChartDiamond()](https://agenatrader.github.io/AgenaScript-documentation/media/image24.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleDown()*](#addcharttriangledown).

#### Usage <a href="#usage_5" id="usage_5"></a>

```csharp
AddChartDiamond(string name, bool autoScale, int barsAgo, double y, Color color)
AddChartDiamond(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_5" id="return-value_5"></a>

A drawing object of the type IDiamond (interface)

#### Parameter <a href="#parameter_5" id="parameter_5"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Defines the preceding bar on which the diamond should be drawn                          |
| time      | Date/time of the bar on which the diamond should be drawn                               |
| y         | y-value on which the diamond should be drawn                                            |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_5" id="example_5"></a>

```csharp
// Draws a light blue diamond for the current bar 5 ticks below the low
AddChartDiamond("MyDiamond-" + ProcessingBarIndex, true, 0, Low[0] - 5*TickSize, Color.SteelBlue);
```

### AddChartDot() <a href="#addchartdot" id="addchartdot"></a>

#### Description <a href="#description_6" id="description_6"></a>

AddChartDot() draws a dot:

![AddChartDot()](https://agenatrader.github.io/AgenaScript-documentation/media/image25.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleDown()*](#addcharttriangledown).

#### Usage <a href="#usage_6" id="usage_6"></a>

```csharp
AddChartDot(string name, bool autoScale, int barsAgo, double y, Color color)
AddChartDot(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_6" id="return-value_6"></a>

A drawing object of the type IDot (interface)

#### Parameter <a href="#parameter_6" id="parameter_6"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Defines the preceding bar on which the dot should be drawn (0 = current bar)            |
| time      | The date/time at which the dot should be drawn                                          |
| y         | y-value at which the dot should be drawn                                                |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_6" id="example_6"></a>

```csharp
// Draws an orange dot for the current bar 5 ticks above the high
AddChartDot("MyDot-" + ProcessingBarIndex, true, 0, High[0] + 5*TickSize, Color.Orange);
```

### AddChartEllipse() <a href="#addchartellipse" id="addchartellipse"></a>

#### Description <a href="#description_7" id="description_7"></a>

AddChartEllipse() draws an ellipse.

#### Usage <a href="#usage_7" id="usage_7"></a>

```csharp
AddChartEllipse(string name, int barsBackStart, double startY, int barsBackEnd, double endY, Color color)
AddChartEllipse(string name, bool autoScale, int barsBackStart, double startY, int barsBackEnd, double endY, Color color, Color areaColor, int areaOpacity)
AddChartEllipse(string name, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, Color areaColor, int areaOpacity)
```

#### Return Value <a href="#return-value_7" id="return-value_7"></a>

A drawing object of the type IEllipse (interface)

#### Parameter <a href="#parameter_7" id="parameter_7"></a>

|               |                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                                            |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety                       |
| barsBackStart | Sets the preceding bar at which the ellipse should start                                                      |
| startTime     | Date/time at which the ellipse should start                                                                   |
| startY        | y-value for the start of the ellipse                                                                          |
| barsBackEnd   | Sets the preceding bar at which the ellipse should end (0 = current bar)                                      |
| endTime       | Date/time at which the ellipse should end                                                                     |
| endY          | y-value for the end of the ellipse                                                                            |
| color         | Border color of the drawing object                                                                            |
| areaColor     | Fill color of the drawing object                                                                              |
| areaOpacity   | Transparency of the fill color value between 0 and 255 (0 = completely transparent , 255 = completely opaque) |

#### Example <a href="#example_7" id="example_7"></a>

```csharp
// Draws a yellow ellipse from the current bar to 5 bars ago
AddChartEllipse("MyEllipse-" + ProcessingBarIndex, true, 5, High[5], 0, Close[0], Color.Yellow, Color.Yellow, 1);
```

### AddChartExtendedLine() <a href="#addchartextendedline" id="addchartextendedline"></a>

#### Description <a href="#description_8" id="description_8"></a>

AddChartExtendedLine() draws a line with an infinite end point.

See [*AddChartLine()*](#addchartline), [*AddChartHorizontalLine()*](#addcharthorizontalline),[ *AddChartVerticalLine()*](#addchartverticalline), [*AddChartRay()*](#addchartray).

#### Usage <a href="#usage_8" id="usage_8"></a>

```csharp
AddChartExtendedLine(string name, int barsBackStart, double startY, int barsBackEnd, double endY, Color color)
AddChartExtendedLine(string name, bool autoScale, int barsBackStart, double startY, int barsBackEnd, double endY, Color color, DashStyle dashStyle, int width)
AddChartExtendedLine(string name, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, DashStyle dashStyle, int width)
```

#### Return Value <a href="#return-value_8" id="return-value_8"></a>

A drawing object of the type IExtendedLine (interface)

#### Parameter <a href="#parameter_8" id="parameter_8"></a>

|               |                                                                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety                 |
| barsBackStart | Number of bars ago for the start point                                                                  |
| startTime     | Date/time for the start point                                                                           |
| startY        | y-value for the start point                                                                             |
| barsBackEnd   | Number of bars ago for the second point (a true end point does not exist; the line extends to infinity) |
| endTime       | Date/time for the end point                                                                             |
| endY          | y-value for the end point                                                                               |
| color         | Color of the drawing object                                                                             |
| dashStyle     | LevelLine styl :                                                                                        |
|               | DashStyle.Dash                                                                                          |
|               | DashStyle.DashDot                                                                                       |
|               | DashStyle.DashDotDot                                                                                    |
|               | DashStyle.Dot                                                                                           |
|               | DashStyle.Solid                                                                                         |
|               |                                                                                                         |
|               | You may have to integrate: using System.Drawing.Drawing2D;                                              |
| width         | LevelLine strength in points                                                                            |

#### Example <a href="#example_8" id="example_8"></a>

```csharp
// Draws a line without an end point
AddChartExtendedLine("MyExt.LevelLine-" + ProcessingBarIndex, false, 10, Close[10], 0, Close[0], Color.Black, DashStyle.Solid, 1);
```

### AddChartFibonacciCircle() <a href="#addchartfibonaccicircle" id="addchartfibonaccicircle"></a>

#### Description <a href="#description_9" id="description_9"></a>

AddChartFibonacciCircle() draws a Fibonacci circle.

#### Usage <a href="#usage_9" id="usage_9"></a>

```csharp
AddChartFibonacciCircle(string name, bool autoScale, int barsBackStart, double startY, int barsBackEnd, double endY)
AddChartFibonacciCircle(string name, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY)
```

#### Return Value <a href="#return-value_9" id="return-value_9"></a>

A drawing object of the type IFibonacciCircle (interface)

#### Parameter <a href="#parameter_9" id="parameter_9"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsBackStart | Defines the starting point in terms of bars ago                                         |
| startTime     | Date/time of the bar for the starting point                                             |
| startY        | y-value for the start of the Fibonacci circle                                           |
| barsBackEnd   | Defines the end point in terms of bars ago                                              |
| endTime       | Date/time for the end of the Fibonacci circle                                           |
| endY          | y-value for the end point of the Fibonacci circle                                       |

#### Example <a href="#example_9" id="example_9"></a>

```csharp
//Draws a Fibonacci circle
AddChartFibonacciCircle("MyFibCircle-" + ProcessingBarIndex, true, 5, Low[5], 0, High[0]);
```

### AddChartFibonacciExtensions() <a href="#addchartfibonacciextensions" id="addchartfibonacciextensions"></a>

#### Description <a href="#description_10" id="description_10"></a>

AddChartFibonacciExtensions() draws Fibonacci extensions.

#### Usage <a href="#usage_10" id="usage_10"></a>

```csharp
AddChartFibonacciExtensions(string name, bool autoScale, int start1BarsAgo, double start1Y, int start2BarsAgo, double start2Y, int start3BarsAgo, double start3Y)
AddChartFibonacciExtensions(string name, bool autoScale, DateTime start1Time, double start1Y, DateTime start2Time, double start2Y, DateTime start3Time, double start3Y)
```

#### Return Value <a href="#return-value_10" id="return-value_10"></a>

A drawing object of the type IFibonacciExtensions (interface)

#### Parameter <a href="#parameter_10" id="parameter_10"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| start1BarsAgo | Number of bars ago for start point 1                                                    |
| start1Time    | Date/time for start point 1                                                             |
| start1Y       | y-value for start point 1                                                               |
| start2BarsAgo | Number of bars ago for start point 2                                                    |
| start2Time    | Date/time for start point 2                                                             |
| start2Y       | y-value for the start point 2                                                           |
| start3BarsAgo | Number of bars ago for start point 3                                                    |
| start3Time    | Date/time for start point 3                                                             |
| start3Y       | y-value for start point 3                                                               |

#### Example <a href="#example_10" id="example_10"></a>

```csharp
// Draws Fibonacci extensions
AddChartFibonacciExtensions("MyFibExt-" + ProcessingBarIndex, true, 4, Low[4], 3, High[3], 1, Low[1]);
```

### AddChartFibonacciProjections() <a href="#addchartfibonacciprojections" id="addchartfibonacciprojections"></a>

#### Description <a href="#description_11" id="description_11"></a>

Draw Fibonacci Projections () sketches Fibonacci Projections.

#### Usage <a href="#usage_11" id="usage_11"></a>

```csharp
AddChartFibonacciProjections(string name, bool autoScale, DateTime start1Time, double start1Y,DateTime start2Time, double start2Y, DateTime start3Time, double start3Y)
```

#### Return Value <a href="#return-value_11" id="return-value_11"></a>

A drawing object of the type IFibonacciProjections (Interface)

#### Parameter <a href="#parameter_11" id="parameter_11"></a>

|            |                                                                                         |
| ---------- | --------------------------------------------------------------------------------------- |
| name       | A clearly identifiable name for the drawing object                                      |
| autoScale  | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| start1Time | Date/time for start point 1                                                             |
| start1Y    | y-value for start point 1                                                               |
| start2Time | Date/time for start point 2                                                             |
| start2Y    | y-value for the start point 2                                                           |
| start3Time | Date/time for start point 3                                                             |
| start3Y    | y-value for start point 3                                                               |

#### Example <a href="#example_11" id="example_11"></a>

```csharp
// zeichnet FibonacciProjections
AddChartFibonacciProjections("MyFibPro-" + ProcessingBarIndex, true, Low[4], 3, High[3], 1, Low[1], 2);
```

### AddChartFibonacciRetracements() <a href="#addchartfibonacciretracements" id="addchartfibonacciretracements"></a>

#### Description <a href="#description_12" id="description_12"></a>

AddChartFibonacciRetracements() draws Fibonacci retracements.

#### Usage <a href="#usage_12" id="usage_12"></a>

```csharp
AddChartFibonacciRetracements(string name, bool autoScale, int barsBackStart, double startY, int barsBackEnd, double endY)
AddChartFibonacciRetracements(string name, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY)
```

#### Return Value <a href="#return-value_12" id="return-value_12"></a>

A drawing object of the type IFibonacciRetracements (interface)

#### Parameter <a href="#parameter_12" id="parameter_12"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsBackStart | Defines how many bars ago the starting point of the Fibonacci retracement is located    |
| startTime     | Date/time of the bar at which the Fibonacci retracement should begin                    |
| startY        | y-value at which the Fibonacci retracement will begin                                   |
| barsBackEnd   | Defines how many bars ago the end point of the Fibonacci retracement is located         |
| endTime       | Date/time at which the Fibonacci retracement should end                                 |
| endY          | y-value at which the Fibonacci retracement should end                                   |

#### Example <a href="#example_12" id="example_12"></a>

```csharp
// Draws Fibonnaci retracements
AddChartFibonacciRetracements("MyFibRet-" + ProcessingBarIndex, true, 10, Low[10], 0, High[0]);
```

### AddChartFibonacciTimeExtensions() <a href="#addchartfibonaccitimeextensions" id="addchartfibonaccitimeextensions"></a>

#### Description <a href="#description_13" id="description_13"></a>

AddChartFibonacciTimeExtensions() draws Fibonacci time extensions.

#### Usage <a href="#usage_13" id="usage_13"></a>

```csharp
AddChartFibonacciTimeExtensions(string name, int barsBackStart, double startY, int barsBackEnd, double endY)
AddChartFibonacciTimeExtensions(string name, DateTime startTime, double startY, DateTime endTime, double endY)
```

#### Return Value <a href="#return-value_13" id="return-value_13"></a>

A drawing object of the type IFibonacciTimeExtensions (interface)

#### Parameter <a href="#parameter_13" id="parameter_13"></a>

|               |                                                       |
| ------------- | ----------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object    |
| barsBackStart | Defines how many bars ago the extensions should start |
| startTime     | Date/time at which the extensions should start        |
| startY        | y-value at which the extensions should start          |
| barsBackEnd   | Defines how many bars ago the extensions should end   |
| endTime       | Date/time at which the extensions should end          |
| endY          | y-value at which the extensions should end            |

#### Example <a href="#example_13" id="example_13"></a>

```csharp
// Draws Fibonacci time extensions
AddChartFibonacciTimeExtensions("MyFibTimeExt-" + ProcessingBarIndex, 10, Low[10], 0, High[0]);
```

### AddChartGannFan() <a href="#addchartgannfan" id="addchartgannfan"></a>

#### Description <a href="#description_14" id="description_14"></a>

AddChartGannFan() draws a Gann fan.

#### Usage <a href="#usage_14" id="usage_14"></a>

```csharp
AddChartGannFan(string name, bool autoScale, int barsAgo, double y)
AddChartGannFan(string name, bool autoScale, DateTime time, double y)
```

#### Return Value <a href="#return-value_14" id="return-value_14"></a>

A drawing object of the type IGannFan (interface)

#### Parameter <a href="#parameter_14" id="parameter_14"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Sets the preceding bar on which the Gann fan should be drawn                            |
| time      | Date/time at which the Gann fan should start                                            |
| y         | y-value for the Gann fan                                                                |

#### Example <a href="#example_14" id="example_14"></a>

```csharp
// Shows a Gann fan at the low of the bar from 10 periods ago
AddChartGannFan("MyGannFan-" + ProcessingBarIndex, true, 10, Low[10]);
```

### AddChartHorizontalLine() <a href="#addcharthorizontalline" id="addcharthorizontalline"></a>

#### Description <a href="#description_15" id="description_15"></a>

AddChartHorizontalLine() draws a horizontal line in the chart.

See [*AddChartLine()*](#addchartline), [A*ddChartVerticalLine()*](#addchartverticalline),[ *AddChartVerticalLine()*](#addchartverticalline), [*AddChartRay()*](#addchartray).

#### Usage <a href="#usage_15" id="usage_15"></a>

```csharp
AddChartHorizontalLine(string name, double y, Color color)
AddChartHorizontalLine(string name, bool autoScale, double y, Color color, DashStyle dashStyle, int width)
```

#### Return Value <a href="#return-value_15" id="return-value_15"></a>

A drawing object of the type IHorizontalLine (interface)

#### Parameter <a href="#parameter_15" id="parameter_15"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| y         | Any double value of your choice                                                         |
| color     | LevelLine color                                                                         |
| dashStyle | LevelLine style:                                                                        |
|           | DashStyle.Dash                                                                          |
|           | DashStyle.DashDot                                                                       |
|           | DashStyle.DashDotDot                                                                    |
|           | DashStyle.Dot                                                                           |
|           | DashStyle.Solid                                                                         |
|           |                                                                                         |
|           | You may have to integrate: using System.Drawing.Drawing2D;                              |
| width     | LevelLine strength                                                                      |

#### Example <a href="#example_15" id="example_15"></a>

```csharp
// Draws a horizontal line at y=10
AddChartHorizontalLine("MyHorizontalLine-" + ProcessingBarIndex, 10, Color.Black);
```

### AddChartLine() <a href="#addchartline" id="addchartline"></a>

#### Description <a href="#description_16" id="description_16"></a>

AddChartLine() draws a (trend) line.

See [*AddChartLine()*](#addchartline), [A*ddChartVerticalLine()*](#addchartverticalline),[ *AddChartVerticalLine()*](#addchartverticalline), [*AddChartExtendedLine()*](#addchartextendedline), [*AddChartRay()*](#addchartray).

#### Usage <a href="#usage_16" id="usage_16"></a>

```csharp
AddChartLine(string name, int barsBackStart, double startY, int barsBackEnd, double endY, Color color)
AddChartLine(string name, bool autoScale, int barsBackStart, double startY, int barsBackEnd, double endY, Color color, DashStyle dashStyle, int width)
AddChartLine(string name, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, DashStyle dashStyle, int width)
```

#### Return Value <a href="#return-value_16" id="return-value_16"></a>

A drawing object of the type ITrendLine (interface).

#### Parameter <a href="#parameter_16" id="parameter_16"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsBackStart | Number of bars ago for the starting point                                               |
| startTime     | Date/time for the starting point                                                        |
| startY        | y-value for the starting point                                                          |
| barsBackEnd   | Number of bars ago for the end point                                                    |
| endTime       | Date/time for the end point                                                             |
| endY          | y-value for the end point                                                               |
| color         | Color of the drawing object                                                             |
| dashStyle     | LevelLine style:                                                                        |
|               | DashStyle.Dash                                                                          |
|               | DashStyle.DashDot                                                                       |
|               | DashStyle.DashDotDot                                                                    |
|               | DashStyle.Dot                                                                           |
|               | DashStyle.Solid                                                                         |
|               |                                                                                         |
|               | You may have to integrate: using System.Drawing.Drawing2D;                              |
| width         | LevelLine strength in points                                                            |

#### Example <a href="#example_16" id="example_16"></a>

```csharp
// Draws a line
AddChartLine("MyLine-" + ProcessingBarIndex, false, 10, Close[10], 0, Close[0], Color.Black, DashStyle.Solid, 1);
```

### AddChartRay() <a href="#addchartray" id="addchartray"></a>

#### Description <a href="#description_17" id="description_17"></a>

AddChartRay() draws a (trend) line and extends it to infinity.

See [*AddChartLine()*](#addchartline), [*AddChartHorizontalLine()*](#addcharthorizontalline),[ *AddChartVerticalLine()*](#addchartverticalline), [*AddChartExtendedLine()*](#addchartextendedline), [*AddChartRay()*](#addchartray).

#### Usage <a href="#usage_17" id="usage_17"></a>

```csharp
AddChartRay(string name, int start1BarsAgo, double start1Y, int start2BarsAgo, double start2Y, Color color)
AddChartRay(string name, bool autoScale, int start1BarsAgo, double start1Y, int start2BarsAgo, double start2Y, Color color, DashStyle dashStyle, int width)
AddChartRay(string name, bool autoScale, DateTime start1Time, double start1Y, DateTime start2Time, double start2Y, Color color, DashStyle dashStyle, int width)
```

#### Return Value <a href="#return-value_17" id="return-value_17"></a>

A drawing object of the type IRay (interface)

#### Parameter <a href="#parameter_17" id="parameter_17"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| start1BarsAgo | Number of bars ago for start point 1                                                    |
| start1Time    | Date/time for anstartchor point 1                                                       |
| start1Y       | y-value for start point 1                                                               |
| start2BarsAgo | Number of bars ago for start point 2                                                    |
| start2Time    | Date/time for start point 2                                                             |
| start2Y       | y-value for start point 2                                                               |
| color         | Color of the drawing object                                                             |
| dashStyle     | LevelLine style                                                                         |
|               | DashStyle.Dash                                                                          |
|               | DashStyle.DashDot                                                                       |
|               | DashStyle.DashDotDot                                                                    |
|               | DashStyle.Dot                                                                           |
|               | DashStyle.Solid                                                                         |
|               |                                                                                         |
|               | You may have to integrate: using System.Drawing.Drawing2D;                              |
| width         | LevelLine strength                                                                      |

#### Example <a href="#example_17" id="example_17"></a>

```csharp
// Draws a line from the bar from 10 periods ago to the current bar (x-axis)
// --> line is extended to the right
// from y=3 to y=7
AddChartRay("MyRay-" + ProcessingBarIndex, 10, 3, 0, 7, Color.Green);
// Draws a line from the current bar to the bar from 10 periods ago
// --> line is extended to the left
// from y=3 to y=7
AddChartRay("MyRay-" + ProcessingBarIndex, 0, 3, 10, 7, Color.Green);
```

### AddChartRectangle() <a href="#addchartrectangle" id="addchartrectangle"></a>

#### Description <a href="#description_18" id="description_18"></a>

AddChartRectangle() draws a rectangle.

#### Usage <a href="#usage_18" id="usage_18"></a>

```csharp
AddChartRectangle(string name, int barsBackStart, double startY, int barsBackEnd, double endY, Color color)
AddChartRectangle(string name, bool autoScale, int barsBackStart, double startY, int barsBackEnd, double endY, Color color, Color areaColor, int areaOpacity)
AddChartRectangle(string name, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, Color areaColor, int areaOpacity)
```

#### Return Value <a href="#return-value_18" id="return-value_18"></a>

A drawing object of the type IRectangle (interface)

#### Parameter <a href="#parameter_18" id="parameter_18"></a>

|               |                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                                            |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety                       |
| barsBackStart | Sets the preceding bar at which the one corner of the rectangle should be located (0 = current bar)           |
| startTime     | Date/time at which the start of the one rectangle corner should be located                                    |
| startY        | y-value at which the one corner of the rectangle should be located                                            |
| barsBackEnd   | Sets the preceding bar at which the second corner of the rectangle should be located (0 = current bar)        |
| endTime       | Date/time of the second rectangle corner                                                                      |
| endY          | y-value of the second rectangle corner                                                                        |
| color         | Color of the drawing object                                                                                   |
| areaColor     | Fill color of the drawing object                                                                              |
| areaOpacity   | Transparency of the fill color. Value between 0 and 255 (0 = completely transparent, 255 = completely opaque) |

#### Example <a href="#example_18" id="example_18"></a>

```csharp
// Draws a green rectangle from the low of 10 periods ago to the high of 5 periods ago
// with a fill color of pale green and a transparency of 2
AddChartRectangle("MyRect-" + ProcessingBarIndex, true, 10, Low[10], 5, High[5], Color.PaleGreen, Color.PaleGreen, 2);
```

### AddChartRegion() <a href="#addchartregion" id="addchartregion"></a>

#### Description <a href="#description_19" id="description_19"></a>

AddChartRegion() fills a specific area on a chart.

#### Usage <a href="#usage_19" id="usage_19"></a>

```csharp
AddChartRegion(string name, int barsBackStart, int barsBackEnd, IDataSeries series, double y, Color outlineColor, Color areaColor, int areaOpacity)
AddChartRegion(string name, int barsBackStart, int barsBackEnd, IDataSeries series1, IDataSeries series2, Color outlineColor, Color areaColor, int areaOpacity)
AddChartRegion(string name, DateTime startTime, DateTime endTime, IDataSeries series, double y, Color outlineColor, Color areaColor, int areaOpacity)
AddChartRegion(string name, DateTime startTime, DateTime endTime, IDataSeries series1, IDataSeries series2, Color outlineColor, Color areaColor, int areaOpacity)
```

#### Return Value <a href="#return-value_19" id="return-value_19"></a>

A drawing object of the type IRegion (interface)

#### Parameter <a href="#parameter_19" id="parameter_19"></a>

|                  |                                                                                                                                                            |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name             | A clearly identifiable name for the drawing object                                                                                                         |
| barsBackStart    | Sets the preceding bar at which the drawing should begin (0 = current bar)                                                                                 |
| startTime        | Start time for the drawing                                                                                                                                 |
| barsBackEnd      | Sets the preceding bar at which the drawing should end (0 = current bar)                                                                                   |
| endTime          | End time for the drawing                                                                                                                                   |
| series1, series2 | Every data series, for example an indicator, close, high, low and so on. The respective value of the data series for the current bar is used as a y-value. |
| y                | Any double value                                                                                                                                           |
| outlineColor     | Color for the border                                                                                                                                       |
| areaColor        | Fill color for the area                                                                                                                                    |
| areaOpacity      | Transparency of the fill color. Value between 0 and 255 (0 = completely transparent, 255 = completely opaque)                                              |

#### Example <a href="#example_19" id="example_19"></a>

```csharp
// Fills the area between the upper and lower Bollinger Bands
AddChartRegion("MyRegion-" + ProcessingBarIndex, ProcessingBarIndex, 0, Bollinger(2, 14).Upper, Bollinger(2, 14).Lower, Color.Empty, Color.Lime, 100);
```

### AddChartRegressionChannel() <a href="#addchartregressionchannel" id="addchartregressionchannel"></a>

#### Description <a href="#description_20" id="description_20"></a>

AddChartRegressionChannel() draws a regression channel.

#### Usage <a href="#usage_20" id="usage_20"></a>

```csharp
AddChartRegressionChannel(string name, int barsBackStart, int barsBackEnd, Color color)
AddChartRegressionChannel(string name, bool autoScale, int barsBackStart, int barsBackEnd, Color upperColor, DashStyle upperDashStyle, int upperWidth, Color middleColor, DashStyle middleDashStyle, int middleWidth, Color lowerColor, DashStyle lowerDashStyle, int lowerWidth)
AddChartRegressionChannel(string name, bool autoScale, DateTime startTime, DateTime endTime, Color upperColor, DashStyle upperDashStyle, int upperWidth, Color middleColor, DashStyle middleDashStyle, int middleWidth, Color lowerColor, DashStyle lowerDashStyle, int lowerWidth)
```

#### Return Value <a href="#return-value_20" id="return-value_20"></a>

A drawing object of the type IRegressionChannel (interface)

#### Parameter <a href="#parameter_20" id="parameter_20"></a>

|                                                 |                                                                                         |
| ----------------------------------------------- | --------------------------------------------------------------------------------------- |
| name                                            | A clearly identifiable name for the drawing object                                      |
| autoScale                                       | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsBackStart                                   | Sets the preceding bar at which the regression channel should start (0 = current bar)   |
| startTime                                       | Start time for the regression channel                                                   |
| barsBackEnd                                     | Sets the preceding bar at which the regression channel should end (0 = current bar)     |
| endTime                                         | End time for the regression channel                                                     |
| color                                           | Color of the drawing object                                                             |
| upperDashStyle, middleDashStyle, lowerDashStyle | LevelLine style:                                                                        |
|                                                 | DashStyle.Dash                                                                          |
|                                                 | DashStyle.DashDot                                                                       |
|                                                 | DashStyle.DashDotDot                                                                    |
|                                                 | DashStyle.Dot                                                                           |
|                                                 | DashStyle.Solid                                                                         |
|                                                 |                                                                                         |
|                                                 | You may have to integrate: using System.Drawing.Drawing2D;                              |
| upperColor, middleColor, lowerColor             | LevelLine color                                                                         |
|                                                 |                                                                                         |
| upperWidth, middleWidth, lowerWidth             | LevelLine strength                                                                      |
|                                                 |                                                                                         |

#### Example <a href="#example_20" id="example_20"></a>

```csharp
// Draws a regression channel from the low of the bar from 10 days ago to the high of the bar from 5 days ago.
AddChartRegressionChannel("MyRegChannel-" + ProcessingBarIndex, 10, 0, Color.Black);
```

### AddChartSquare() <a href="#addchartsquare" id="addchartsquare"></a>

#### Description <a href="#description_21" id="description_21"></a>

AddChartSquare() draws a square:

![AddChartSquare()](https://agenatrader.github.io/AgenaScript-documentation/media/image26.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleDown()*](#addcharttriangledown).

#### Usage <a href="#usage_21" id="usage_21"></a>

```csharp
DrawSqare(string name, bool autoScale, int barsAgo, double y, Color color)
DrawSqare(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_21" id="return-value_21"></a>

A drawing object of the type ISquare (interface)

#### Parameter <a href="#parameter_21" id="parameter_21"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Sets the preceding bar at which the square should be drawn (0 = current bar)            |
| Time      | Date/time of the bar at which the square should be drawn                                |
| Y         | y-value for the square                                                                  |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_21" id="example_21"></a>

```csharp
// Draws a dark red square at the current bar 10 ticks above the high
AddChartSquare("MySquare-" + ProcessingBarIndex, true, 0, High[0] + 10*TickSize, Color.DarkRed);
```

### AddChartText() <a href="#addcharttext" id="addcharttext"></a>

#### Description <a href="#description_22" id="description_22"></a>

AddChartText() writes whatever text you want onto the chart using price and datetime coordinates.

See [*AddChartTextFixed()*.](#addcharttextfixed)

#### Usage <a href="#usage_22" id="usage_22"></a>

```csharp
AddChartText(string tag, string text, int barsAgo, double y, Color color);
AddChartText(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color areaColor, int areaOpacity);
AddChartText(string tag, string text, int barsAgo, double y, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity);
AddChartText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity);
AddChartText(string tag, bool autoScale, string text, DateTime x, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity);
AddChartText(string tag, bool autoScale, string text, DateTime x, double y, int pixelOffset, Color textColor, Font font, StringAlignment alignment, HorizontalAlignment hAlign, VerticalAlignment vAlign, Color outlineColor, Color areaColor);
AddChartText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, HorizontalAlignment hAlign, VerticalAlignment vAlign, Color outlineColor, Color areaColor, int areaOpacity);
AddChartText(string tag, bool autoScale, string text, DateTime x, double y, int pixelOffset, Color textColor, Font font, StringAlignment alignment, HorizontalAlignment hAlign, VerticalAlignment vAlign, Color outlineColor, Color areaColor);   
```

**Important note:** When using signatures that contain horizontal alignment and vertical alignment, you need to add the following lines:

```csharp
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
```

#### Return Value <a href="#return-value_22" id="return-value_22"></a>

A drawing object of the type IText (interface)

#### Parameter <a href="#parameter_22" id="parameter_22"></a>

|              |                                                                                                               |
| ------------ | ------------------------------------------------------------------------------------------------------------- |
| name         | A clearly identifiable name for the drawing object                                                            |
| autoScale    | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety                       |
| Text         | Text to be displayed (may contain escape sequences)                                                           |
| barsAgo      | Sets how many bars ago the text should be displayed                                                           |
| Time         | Date/time of the bar at which the text should begin                                                           |
| Y            | y-value at which the text should be written                                                                   |
| yPixelOffset | Vertical offset of the text; positive numbers move it up, and negative numbers move it down                   |
| textColor    | Text color                                                                                                    |
| Font         | Font                                                                                                          |
| Alignment    | Possible values are: StringAlignment.Center, StringAlignment.Far, StringAlignment.Near                        |
| HAlign       | Possible values are: HorizontalAlign.Left, HorizontalAlign.Center, HorizontalAlign.Right                      |
| VAlign       | Possible values are: VerticalAlign.Top, VerticalAlign.Center, VerticalAlign.Bottom                            |
| outlineColor | Border color around the text (for no border, select Color.Empty)                                              |
| areaColor    | Fill color for the text box                                                                                   |
| areaOpacity  | Transparency of the fill color. Value between 0 and 255 (0 = completely transparent, 255 = completely opaque) |

#### Example <a href="#example_22" id="example_22"></a>

```csharp
// writes text at y=3.0
AddChartText("MyText-" + ProcessingBarIndex, "This is sample text.", 10, 3, Color.Black);
// writes red text in the font Arial 7
AddChartText("MyText-" + ProcessingBarIndex, false, "This is sample text.", Time[0], Close[0]+50*TickSize, 0,
Color.Red, new Font("Arial",7), StringAlignment.Center, Color.Blue, Color.DarkOliveGreen, 10);
```

This leads to the following result:

![AddChartText()](https://agenatrader.github.io/AgenaScript-documentation/media/image27.png)

```csharp
AddChartText("MyTag-" + ProcessingBarIndex,true,"Text",1,
// barsAgo
High[1], // y
10, // yPixelOffset
Color.Blue, // Text color
new Font("Arial", 10, FontStyle.Bold),
StringAlignment.Center,
HorizontalAlignment.Center,
VerticalAlignment.Bottom,
Color.Red, // Outline color
Color.Yellow, // Fill color
100); // Opacity
```

### AddChartTextFixed() <a href="#addcharttextfixed" id="addcharttextfixed"></a>

#### Description <a href="#description_23" id="description_23"></a>

AddChartTextFixed() writes text into one of 5 predetermined locations on the chart.

See [*AddChartText()*](#addcharttext).

#### Usage <a href="#usage_23" id="usage_23"></a>

```csharp
AddChartTextFixed(string tag, string text, TextPosition textPosition);
AddChartTextFixed(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color areaColor);
AddChartTextFixed(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color areaColor, int areaOpacity);
```

#### Return Value <a href="#return-value_23" id="return-value_23"></a>

A drawing object of the type ITextFixed (interface)

#### Parameter <a href="#parameter_23" id="parameter_23"></a>

|              |                                                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------------------------------- |
| name         | A clearly identifiable name for the drawing object                                                                  |
| text         | The text to be displayed                                                                                            |
| TextPosition | TextPosition.BottomLeft, TextPosition.BottomRight, TextPosition.Center, TextPosition.TopLeft, TextPosition.TopRight |
| textColor    | Text color                                                                                                          |
| font         | Font                                                                                                                |
| outlineColor | Color for the border around the text. For no border color, use Color.Empty                                          |
| areaColor    | Fill color of the text box. For no fill color, use Color.Empty                                                      |
| areaOpacity  | Transparency of the fill color. Value between 0 and 255 (0 = completely transparent, 255 = completely opaque)       |

#### Example <a href="#example_23" id="example_23"></a>

```csharp
// Writes text into the middle of the chart
AddChartTextFixed("MyText", "This is sample text.", TextPosition.Center);
// Writes red text with a blue border into the middle of the chart
AddChartTextFixed("MyText", "This is sample text.", TextPosition.Center, Color.Red, new Font("Arial",35), Color.Blue, Color.Empty, 10);
```

### AddChartTrendChannel() <a href="#addcharttrendchannel" id="addcharttrendchannel"></a>

#### Description <a href="#description_24" id="description_24"></a>

AddChartTrendChannel() draws a trend channel.

#### Usage <a href="#usage_24" id="usage_24"></a>

```csharp
AddChartTrendChannel(string name, bool autoScale, int start1BarsAgo, double start1Y, int start2BarsAgo, double start2Y, int start3BarsAgo, double start3Y)
AddChartTrendChannel(string name, bool autoScale, DateTime start1Time, double start1Y, DateTime start2Time, double start2Y, DateTime start3Time, double start3Y)
```

#### Return Value <a href="#return-value_24" id="return-value_24"></a>

A drawing object of the type ITrendChannel (interface)

#### Parameter <a href="#parameter_24" id="parameter_24"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                      |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| start1BarsAgo | Number of bars ago for start point 1 (x-axis)                                           |
| start1Time    | Date/time for start point 1 (x-axis)                                                    |
| start1Y       | y-value for start point 1                                                               |
| start2BarsAgo | Number of bars ago for start point 2 (x-axis)                                           |
| start2Time    | Date/time for start point 2 (x-axis)                                                    |
| start2Y       | y-value for start point 2                                                               |
| start3BarsAgo | Number of bars ago for start point 3 (x-axis)                                           |
| start3Time    | Date/time for start point 3 (x-axis)                                                    |
| start3Y       | y-value for start point 3                                                               |

#### Example <a href="#example_24" id="example_24"></a>

```csharp
// Draws a trend channel
AddChartTrendChannel("MyTrendChannel-" + ProcessingBarIndex, true, 10, Low[10], 0, High[0], 10, High[10] + 5 * TickSize);
```

### AddChartTriangle() <a href="#addcharttriangle" id="addcharttriangle"></a>

#### Description <a href="#description_25" id="description_25"></a>

AddChartTriangle() draws a triangle.

#### Usage <a href="#usage_25" id="usage_25"></a>

```csharp
AddChartTriangle(string name, int start1BarsAgo, double start1Y, int start2BarsAgo, double start2Y, int start3BarsAgo, double start3Y, Color color)
AddChartTriangle(string name, bool autoScale, int start1BarsAgo, double start1Y, int start2BarsAgo, double start2Y, int start3BarsAgo, double start3Y, Color color, Color areaColor, int areaOpacity)
AddChartTriangle(string name, bool autoScale, DateTime start1Time, double start1Y, DateTime start2Time, double start2Y, DateTime start3Time, double start3Y, Color color, Color areaColor, int areaOpacity)
```

#### Return Value <a href="#return-value_25" id="return-value_25"></a>

A drawing object of the type ITriangle (interface)

#### Parameter <a href="#parameter_25" id="parameter_25"></a>

|               |                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| name          | A clearly identifiable name for the drawing object                                                            |
| autoScale     | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety                       |
| start1BarsAgo | Number of bars ago for start point 1 (x-axis)                                                                 |
| start1Time    | Date/time for start point 1 (x-axis)                                                                          |
| start1Y       | y-value for start point 1                                                                                     |
| start2BarsAgo | Number of bars ago for start point 2 (x-axis)                                                                 |
| start2Time    | Date/time for start point 2 (x-axis)                                                                          |
| start2Y       | y-value for start point 2                                                                                     |
| start3BarsAgo | Number of bars ago for start point 3 (x-axis)                                                                 |
| start3Time    | Date/time for start point 3 (x-axis)                                                                          |
| start3Y       | y-value for start point 3                                                                                     |
| color         | Color of the drawing object                                                                                   |
| areaColor     | Fill color of the drawing object                                                                              |
| areaOpacity   | Transparency of the fill color. Value between 0 and 255 (0 = completely transparent, 255 = completely opaque) |

#### Example <a href="#example_25" id="example_25"></a>

```csharp
// Draws a green triangle
AddChartTriangle("tag1-" + ProcessingBarIndex, 4, Low[4], 3, High[3], 1, Low[1], Color.Green);
```

### AddChartTriangleDown() <a href="#addcharttriangledown" id="addcharttriangledown"></a>

#### Description <a href="#description_26" id="description_26"></a>

AddChartTriangleDown() draws a small downwards-pointing triangle:

![AddChartTriangleDown()](https://agenatrader.github.io/AgenaScript-documentation/media/image29.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleU*p()](#addcharttriangleup).

#### Usage <a href="#usage_26" id="usage_26"></a>

```csharp
AddChartTriangleDown(string name, bool autoScale, int barsAgo, double y, Color color)
AddChartTriangleDown(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_26" id="return-value_26"></a>

A drawing object of the type ITriangleDown (interface)

#### Parameter <a href="#parameter_26" id="parameter_26"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Sets how many bars ago the triangle should be drawn                                     |
| time      | Date/time for the bar at which the triangle should be drawn                             |
| Y         | y-value at which the triangle should be drawn                                           |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_26" id="example_26"></a>

```csharp
// Draws a small red triangle at the current bar 10 ticks above the high
AddChartTriangleDown("MyTriangleDown-" + ProcessingBarIndex, true, 0, High[0] + 10*TickSize, Color.Red);
```

### AddChartTriangleUp() <a href="#addcharttriangleup" id="addcharttriangleup"></a>

#### Description <a href="#description_27" id="description_27"></a>

AddChartTriangleUp() draws a small upwards-pointing triangle:

![AddChartTriangleUp()](https://agenatrader.github.io/AgenaScript-documentation/media/image28.png)

See [*AddChartArrowUp()*](#addchartarrowup), [*AddChartArrowDown()*](#addchartarrowdown), [*AddChartDiamond()*](#addchartdiamond),[ *AddChartDot()*](#addchartdot), [*AddChartSquare()*](#addchartsquare), [*AddChartTriangleUp()*](#addcharttriangleup), [*AddChartTriangleDown()*](#addcharttriangledown).

#### Usage <a href="#usage_27" id="usage_27"></a>

```csharp
AddChartTriangleUp(string name, bool autoScale, int barsAgo, double y, Color color)
AddChartTriangleUp(string name, bool autoScale, DateTime time, double y, Color color)
```

#### Return Value <a href="#return-value_27" id="return-value_27"></a>

A drawing object of the type ITriangleUp (interface)

#### Parameter <a href="#parameter_27" id="parameter_27"></a>

|           |                                                                                         |
| --------- | --------------------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                                      |
| autoScale | Adjusts the scale of the y-axis so that drawing objects can be viewed in their entirety |
| barsAgo   | Sets how many bars ago the triangle should be drawn                                     |
| time      | Date/time for the bar at which the triangle should be drawn                             |
| y         | y-value at which the triangle should be drawn                                           |
| color     | Color of the drawing object                                                             |

#### Example <a href="#example_27" id="example_27"></a>

```csharp
// Draws a small light green triangle at the current bar 10 ticks below the low
AddChartTriangleUp("MyTriangleUp-" + ProcessingBarIndex, true, 0, Low[0] - 10*TickSize, Color.LightGreen);
```

### AddChartVerticalLine() <a href="#addchartverticalline" id="addchartverticalline"></a>

#### Description <a href="#description_28" id="description_28"></a>

AddChartVerticalLine() draws a vertical line in the chart.

See [*AddChartLine()*](#addchartline), [*AddChartHorizontalLine()*](#addcharthorizontalline), [*AddChartExtendedLine()*](#addchartextendedline),[ *AddChartRay()*](#addchartray).

#### Usage <a href="#usage_28" id="usage_28"></a>

```csharp
AddChartVerticalLine(string name, int barsAgo, Color color)
AddChartVerticalLine(string name, int barsAgo, Color color, DashStyle dashStyle, int width)
AddChartVerticalLine(string name, DateTime time, Color color, DashStyle dashStyle, int width)
```

#### Return Value <a href="#return-value_28" id="return-value_28"></a>

A drawing object of the type IVerticalLine (interface)

#### Parameter <a href="#parameter_28" id="parameter_28"></a>

|           |                                                                            |
| --------- | -------------------------------------------------------------------------- |
| name      | A clearly identifiable name for the drawing object                         |
| barsAgo   | Sets how many bars ago the vertical line should be drawn (0 = current bar) |
| time      | Date/time of the bar at which the vertical line should be drawn            |
| color     | LevelLine color                                                            |
| dashStyle | LevelLine style                                                            |
|           | DashStyle.Dash                                                             |
|           | DashStyle.DashDot                                                          |
|           | DashStyle.DashDotDot                                                       |
|           | DashStyle.Dot                                                              |
|           | DashStyle.Solid                                                            |
| width     | LevelLine strength                                                         |

#### Example <a href="#example_28" id="example_28"></a>

```csharp
// Draws a vertical line at the bar from 10 periods ago
AddChartVerticalLine("MyVerticalLine-" + ProcessingBarIndex, 10, Color.Black);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://script.agenatrader.com/drawingobjects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
