DrawText on Indicator when IsOverlay = false
DrawText on Indicator when IsOverlay = false
04 Dec 2018, 20:37
Hello, is it possible to draw text or lines in an indicator with IsOverlay = false?
AND, It is possible to paint text with different size in Charts?
Thanks!
Replies
bienve.pf
05 Dec 2018, 13:11
In this example it does not work. Do not draw the text in the Indicator ChartArea:
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class overlay : Indicator
{
[Parameter(DefaultValue = 0.0)]
public double Parameter { get; set; }
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
protected override void Initialize()
{
// Initialize and create nested indicators
}
public override void Calculate(int index)
{
// Calculate value at specified index
Result[index] = 1;
if( IsLastBar){
var txt = Chart.DrawText("txt", "EURUSD", index + 3, 1, Color.Orange);
}
}
}
}
@bienve.pf
PanagiotisCharalampous
05 Dec 2018, 14:43
Hi bienve.pf,
Use the following line of code
var txt = IndicatorArea.DrawText("txt", "EURUSD1", index + 3, 1, Color.Orange);
Best Regards,
Panagiotis
@PanagiotisCharalampous
nguyenluat.6996
05 Apr 2020, 14:12
I cannot draw text to chart anymore
var txt = IndicatorArea.DrawText("txt", "EURUSD1", index + 3, 1, Color.Orange);
It's not work anymore!
@nguyenluat.6996
PanagiotisCharalampous
06 Apr 2020, 09:07
Hi nguyenluat.6996,
Can you provide us the complete code?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Dec 2018, 12:06
Hi bienve.pf,
"Hello, is it possible to draw text or lines in an indicator with IsOverlay = false?"
Yes this is possible
"AND, It is possible to paint text with different size in Charts?"
It is not possible to set the text size at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous