No Chart / No ChartArea
No Chart / No ChartArea
19 Oct 2018, 13:16
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 Test : 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) { var line = Chart.DrawHorizontalLine("Test", Symbol.Bid, Colors.AliceBlue); } } }
Build error - Error CS0117: "cAlgo.API.Chart" does not contain a definition for "DrawHorizontalLine"
The Chart is a type, but how to get an instance of a current chart?
Replies
PanagiotisCharalampous
19 Oct 2018, 14:41
Hi freemangreat,
Thanks, use the code below
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 Test : 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) { ChartObjects.DrawHorizontalLine("Test", Symbol.Bid, Colors.AliceBlue); } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
freemangreat
19 Oct 2018, 15:05
Yes, ChartObjects works fine, but will there be the Chart / ChartArea interface available?
For example, to get BarsTotal, is only with Chart
and ChartArea had many methods for handling mouse events.
@freemangreat
PanagiotisCharalampous
19 Oct 2018, 15:19
Hi freemangreat,
The Chart object is available in Spotware cTrader Beta 3.3. It will be rolled out to brokers soon.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Oct 2018, 14:09
Hi freemangreat,
Which version of cTrader do you use?
Best Regards,
Panagiotis
@PanagiotisCharalampous