---
id: "M:cAlgo.API.Indicator.SetLineAppearance(cAlgo.API.IndicatorLineOutput,System.Int32,cAlgo.API.Color)"
kind: "method"
type: "T:cAlgo.API.Indicator"
url: "https://help.ctrader.com/ctrader-algo/references/General/Indicator/SetLineAppearance/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Indicator.SetLineAppearance

Member of [Indicator](https://help.ctrader.com/ctrader-algo/references/General/Indicator/index.md).

## SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color)

Sets appearance of an indicator line output from startIndex to last index.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No effect; arguments are still validated (ArgumentException on bad count or all-null values).
- Cloud: No effect; arguments are still validated (ArgumentException on bad count or all-null values).

C#:

```csharp
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color)
```

Python:

```python
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, color: Color) -> None
```

### Parameters

- `lineOutput` (`IndicatorLineOutput`, Python `IndicatorLineOutput`): Indicator Line Output
- `startIndex` (`int`, Python `int`): Start Index
- `color` (`Color`, Python `Color`): Color

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Result[index] = Bars.ClosePrices[index];
var color = Bars.ClosePrices[index] >= Bars.OpenPrices[index] ? Color.Green : Color.Red;
SetLineAppearance(Result.LineOutput, index, color);
```

Python:

```python
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index]
    color = Color.Green if api.Bars.ClosePrices[index] >= api.Bars.OpenPrices[index] else Color.Red
    api.SetLineAppearance(api.Result.LineOutput, index, color)
```

config.json:

```json
{
  "AccessRights": "None",
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color, int thickness)

Sets appearance of an indicator line output from startIndex to last index.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No effect; arguments are still validated (ArgumentException on bad count or all-null values).
- Cloud: No effect; arguments are still validated (ArgumentException on bad count or all-null values).

C#:

```csharp
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color, int thickness)
```

Python:

```python
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, color: Color, thickness: int) -> None
```

### Parameters

- `lineOutput` (`IndicatorLineOutput`, Python `IndicatorLineOutput`): Indicator Line Output
- `startIndex` (`int`, Python `int`): Start Index
- `color` (`Color`, Python `Color`): Color
- `thickness` (`int`, Python `int`): Thickness

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Result[index] = Bars.ClosePrices[index];
var color = Bars.ClosePrices[index] >= Bars.OpenPrices[index] ? Color.Green : Color.Red;
SetLineAppearance(Result.LineOutput, index, color, 3);
```

Python:

```python
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index]
    color = Color.Green if api.Bars.ClosePrices[index] >= api.Bars.OpenPrices[index] else Color.Red
    api.SetLineAppearance(api.Result.LineOutput, index, color, 3)
```

config.json:

```json
{
  "AccessRights": "None",
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color, int thickness, LineStyle lineStyle)

Sets appearance of an indicator line output from startIndex to last index.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No effect; arguments are still validated (ArgumentException on bad count or all-null values).
- Cloud: No effect; arguments are still validated (ArgumentException on bad count or all-null values).

C#:

```csharp
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color, int thickness, LineStyle lineStyle)
```

Python:

```python
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, color: Color, thickness: int, lineStyle: LineStyle) -> None
```

### Parameters

- `lineOutput` (`IndicatorLineOutput`, Python `IndicatorLineOutput`): Indicator Line Output
- `startIndex` (`int`, Python `int`): Start Index
- `color` (`Color`, Python `Color`): Color
- `thickness` (`int`, Python `int`): Thickness
- `lineStyle` (`LineStyle`, Python `LineStyle`): LineStyle

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Result[index] = Bars.ClosePrices[index];
if (Bars.ClosePrices[index] < Bars.OpenPrices[index])
    SetLineAppearance(Result.LineOutput, index, Color.Red, 2, LineStyle.Dots);
```

Python:

```python
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index]
    if api.Bars.ClosePrices[index] < api.Bars.OpenPrices[index]:
        api.SetLineAppearance(api.Result.LineOutput, index, Color.Red, 2, LineStyle.Dots)
```

config.json:

```json
{
  "AccessRights": "None",
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color)

Sets appearance of an indicator line output from startIndex to startIndex + count.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No effect; arguments are still validated (ArgumentException on bad count or all-null values).
- Cloud: No effect; arguments are still validated (ArgumentException on bad count or all-null values).

C#:

```csharp
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color)
```

Python:

```python
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, count: int, color: Color) -> None
```

### Parameters

- `lineOutput` (`IndicatorLineOutput`, Python `IndicatorLineOutput`): Indicator Line Output
- `startIndex` (`int`, Python `int`): Start Index
- `count` (`int`, Python `int`): Index count
- `color` (`Color`, Python `Color`): Color

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Result[index] = Bars.ClosePrices[index];
if (IsLastBar)
    SetLineAppearance(Result.LineOutput, Math.Max(0, index - 10), 10, Color.Orange);
```

Python:

```python
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index]
    if api.IsLastBar:
        api.SetLineAppearance(api.Result.LineOutput, max(0, index - 10), 10, Color.Orange)
```

config.json:

```json
{
  "AccessRights": "None",
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color, int thickness)

Sets appearance of an indicator line output from startIndex to startIndex + count.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No effect; arguments are still validated (ArgumentException on bad count or all-null values).
- Cloud: No effect; arguments are still validated (ArgumentException on bad count or all-null values).

C#:

```csharp
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color, int thickness)
```

Python:

```python
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, count: int, color: Color, thickness: int) -> None
```

### Parameters

- `lineOutput` (`IndicatorLineOutput`, Python `IndicatorLineOutput`): Indicator Line Output
- `startIndex` (`int`, Python `int`): Start Index
- `count` (`int`, Python `int`): Index count
- `color` (`Color`, Python `Color`): Color
- `thickness` (`int`, Python `int`): Thickness

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Result[index] = Bars.ClosePrices[index];
if (IsLastBar)
    SetLineAppearance(Result.LineOutput, Math.Max(0, index - 10), 10, Color.Orange, 3);
```

Python:

```python
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index]
    if api.IsLastBar:
        api.SetLineAppearance(api.Result.LineOutput, max(0, index - 10), 10, Color.Orange, 3)
```

config.json:

```json
{
  "AccessRights": "None",
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color, int thickness, LineStyle lineStyle)

Sets appearance of an indicator line output from startIndex to startIndex + count.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No effect; arguments are still validated (ArgumentException on bad count or all-null values).
- Cloud: No effect; arguments are still validated (ArgumentException on bad count or all-null values).

C#:

```csharp
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color, int thickness, LineStyle lineStyle)
```

Python:

```python
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, count: int, color: Color, thickness: int, lineStyle: LineStyle) -> None
```

### Parameters

- `lineOutput` (`IndicatorLineOutput`, Python `IndicatorLineOutput`): Indicator Line Output
- `startIndex` (`int`, Python `int`): Start Index
- `count` (`int`, Python `int`): Index count
- `color` (`Color`, Python `Color`): Color
- `thickness` (`int`, Python `int`): Thickness
- `lineStyle` (`LineStyle`, Python `LineStyle`): LineStyle

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Result[index] = Bars.ClosePrices[index];
if (IsLastBar)
    SetLineAppearance(Result.LineOutput, Math.Max(0, index - 10), 10, Color.Orange, 2, LineStyle.DotsRare);
```

Python:

```python
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index]
    if api.IsLastBar:
        api.SetLineAppearance(api.Result.LineOutput, max(0, index - 10), 10, Color.Orange, 2, LineStyle.DotsRare)
```

config.json:

```json
{
  "AccessRights": "None",
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

