Using markers with indicators
Mark some specific point or set of points on indicator's line
// Mark the current bar of first indicator line with Yellow color
LinesSeries[0].SetMarker(0, Color.Yellow)


Last updated
Was this helpful?
Mark some specific point or set of points on indicator's line
// Mark the current bar of first indicator line with Yellow color
LinesSeries[0].SetMarker(0, Color.Yellow)


Last updated
Was this helpful?
Was this helpful?
// Mark current bar with yellow color and flag icon in the top position
LinesSeries[0].SetMarker(0, new IndicatorLineMarker(Color.Yellow, IndicatorLineMarkerIconType.Flag));/// <summary>
/// Calculation entry point. This function is called when a price data updates.
/// </summary>
protected override void OnUpdate(UpdateArgs args)
{
// Use open price as a source for our indicator
SetValue(Open());
// We are looking for 5 bars with same direction
int amountofBars = 5;
// Not enough data yet - skip calculations
if (Count < amountofBars)
return;
// Going though last 5 bars
int trendValue = 0;
for (int i = 0; i < amountofBars; i++)
{
// Is it growing bar?
if (Close(i) > Open(i))
trendValue += 1;
// Is it falling bars?
else if (Open(i) > Close(i))
trendValue += -1;
}
// If all 5 bars were growing - mark with green up arrow on bottom
if (trendValue == amountofBars)
LinesSeries[0].SetMarker(0, new IndicatorLineMarker(Color.Green, bottomIcon: IndicatorLineMarkerIconType.UpArrow));
// If all 5 bars were falling - mark with red down arrow on top
else if (trendValue == -amountofBars)
LinesSeries[0].SetMarker(0, new IndicatorLineMarker(Color.Red, upperIcon: IndicatorLineMarkerIconType.DownArrow));
}