ctid2948110
03 Oct 2023, 19:59
( Updated at: 05 Oct 2023, 18:21 )
Here is the source from the cTrader example not working ?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using cAlgo.API; using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo { // This sample indicator shows how to use IndicatorArea [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class IndicatorAreaSample : Indicator { private TextBlock _indicatorAreaNumberTextBlock; protected override void Initialize() { var grid = new Grid(1, 2) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, BackgroundColor = Color.Gold, Opacity = 0.7, Width = 200 }; grid.AddChild(new TextBlock { Text = "Indicator Area #", Margin = 5, FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Black }, 0, 0); _indicatorAreaNumberTextBlock = new TextBlock { Margin = 5, Text = Chart.IndicatorAreas.Count.ToString(), FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Black }; grid.AddChild(_indicatorAreaNumberTextBlock, 0, 1);
// SHOW GRID ########################################################################## // Chart.AddControl(grid); IndicatorArea.AddControl(grid);
using System; using System.Collections.Generic; using System.Linq; using System.Text; using cAlgo.API; using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo { // This sample indicator shows how to use IndicatorArea [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class IndicatorAreaSample : Indicator { private TextBlock _indicatorAreaNumberTextBlock; protected override void Initialize() { var grid = new Grid(1, 2) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, BackgroundColor = Color.Gold, Opacity = 0.7, Width = 200 }; grid.AddChild(new TextBlock { Text = "Indicator Area #", Margin = 5, FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Black }, 0, 0); _indicatorAreaNumberTextBlock = new TextBlock { Margin = 5, Text = Chart.IndicatorAreas.Count.ToString(), FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Black }; grid.AddChild(_indicatorAreaNumberTextBlock, 0, 1);
// SHOW GRID ########################################################################## // Chart.AddControl(grid); IndicatorArea.AddControl(grid);
This website uses cookies to enhance site navigation, analyze site usage, and assist in our marketing efforts. By clicking “Accept All” you are providing your consent to our use of all cookies. Alternatively, please provide your choice by pressing “Customize Cookies”. For more information, please read our Privacy policy
PanagiotisChar
02 Oct 2023, 06:04
Hi there,
If you share some code demonstrating what you are trying to do, it would be easier for somebody to help you.
@PanagiotisChar