Indicator.SetLineAppearance
method · Indicator · cAlgo.API Since 5.4
Sets appearance of an indicator line output from startIndex to last index.
Environment behaviour
CLI — not supported. No effect; arguments are still validated (ArgumentException on bad count or all-null values).
Cloud — not supported. No effect; arguments are still validated (ArgumentException on bad count or all-null values).
Overloads
SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color)
Sets appearance of an indicator line output from startIndex to last index.
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color)
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, color: Color) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
lineOutput | IndicatorLineOutput | IndicatorLineOutput | Indicator Line Output |
startIndex | int | int | Start Index |
color | Color | Color | Color |
Examples
Result[index] = Bars.ClosePrices[index];
var color = Bars.ClosePrices[index] >= Bars.OpenPrices[index] ? Color.Green : Color.Red;
SetLineAppearance(Result.LineOutput, index, color);
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)
{
"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.
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color, int thickness)
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, color: Color, thickness: int) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
lineOutput | IndicatorLineOutput | IndicatorLineOutput | Indicator Line Output |
startIndex | int | int | Start Index |
color | Color | Color | Color |
thickness | int | int | Thickness |
Examples
Result[index] = Bars.ClosePrices[index];
var color = Bars.ClosePrices[index] >= Bars.OpenPrices[index] ? Color.Green : Color.Red;
SetLineAppearance(Result.LineOutput, index, color, 3);
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)
{
"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.
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, Color color, int thickness, LineStyle lineStyle)
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, color: Color, thickness: int, lineStyle: LineStyle) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
lineOutput | IndicatorLineOutput | IndicatorLineOutput | Indicator Line Output |
startIndex | int | int | Start Index |
color | Color | Color | Color |
thickness | int | int | Thickness |
lineStyle | LineStyle | LineStyle | LineStyle |
Examples
Result[index] = Bars.ClosePrices[index];
if (Bars.ClosePrices[index] < Bars.OpenPrices[index])
SetLineAppearance(Result.LineOutput, index, Color.Red, 2, LineStyle.Dots);
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)
{
"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.
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color)
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, count: int, color: Color) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
lineOutput | IndicatorLineOutput | IndicatorLineOutput | Indicator Line Output |
startIndex | int | int | Start Index |
count | int | int | Index count |
color | Color | Color | Color |
Examples
Result[index] = Bars.ClosePrices[index];
if (IsLastBar)
SetLineAppearance(Result.LineOutput, Math.Max(0, index - 10), 10, Color.Orange);
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)
{
"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.
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color, int thickness)
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, count: int, color: Color, thickness: int) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
lineOutput | IndicatorLineOutput | IndicatorLineOutput | Indicator Line Output |
startIndex | int | int | Start Index |
count | int | int | Index count |
color | Color | Color | Color |
thickness | int | int | Thickness |
Examples
Result[index] = Bars.ClosePrices[index];
if (IsLastBar)
SetLineAppearance(Result.LineOutput, Math.Max(0, index - 10), 10, Color.Orange, 3);
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)
{
"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.
protected void SetLineAppearance(IndicatorLineOutput lineOutput, int startIndex, int count, Color color, int thickness, LineStyle lineStyle)
api.SetLineAppearance(lineOutput: IndicatorLineOutput, startIndex: int, count: int, color: Color, thickness: int, lineStyle: LineStyle) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
lineOutput | IndicatorLineOutput | IndicatorLineOutput | Indicator Line Output |
startIndex | int | int | Start Index |
count | int | int | Index count |
color | Color | Color | Color |
thickness | int | int | Thickness |
lineStyle | LineStyle | LineStyle | LineStyle |
Examples
Result[index] = Bars.ClosePrices[index];
if (IsLastBar)
SetLineAppearance(Result.LineOutput, Math.Max(0, index - 10), 10, Color.Orange, 2, LineStyle.DotsRare);
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)
{
"AccessRights": "None",
"LineOutputs": [
{
"Name": "Result",
"DisplayName": "Main"
}
]
}