is there any way to get bordercolor same as candle color using ternary in the code below
C#
2
Posts
2
Posters
7
Views
1
Watching
-
namespace ATAS.Indicators.Technical
{
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Windows.Media;using ATAS.Indicators.Technical.Properties; using OFT.Attributes; \[DisplayName("5.Heiken Ashi Z")\] \[Category("# 1234")\] public class HeikenAshiz : Indicator { private readonly CandleDataSeries \_candles = new CandleDataSeries("Heiken Ashi Z"){ Visible = true }; private readonly PaintbarsDataSeries \_bars= new PaintbarsDataSeries("Bars Z"){ Visible = false }; public HeikenAshiz() { Panel = IndicatorDataProvider.NewPanel; DataSeries\[0\]= \_bars; DataSeries.Add(\_candles); } protected override void OnCalculate(int bar, decimal value) { var candle = GetCandle(bar); \_bars\[bar\] = Colors.Transparent; if (bar == 0) { \_candles\[bar\] = new Candle() { Close = candle.Close, High = candle.High, Low = candle.Low, Open = candle.Open }; } else { var prevCandle = \_candles\[bar - 1\]; \_candles\[bar\] = new Candle() { Close = (candle.Open+candle.Close+candle.High+candle.Low)\*0.25m, High = candle.High, Low = candle.Low, Open = (prevCandle.Open+ prevCandle.Close)\*0.5m, }; } } protected override void OnApplyDefaultColors() { if (ChartInfo is null) return; \_candles.UpCandleColor = Color.FromRgb(14, 203, 129); \_candles.DownCandleColor = Color.FromRgb(246, 70, 93); \_candles.BorderColor = Color.FromRgb(127, 127, 127); } }
}
-
namespace ATAS.Indicators.Technical
{
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Windows.Media;using ATAS.Indicators.Technical.Properties; using OFT.Attributes; \[DisplayName("5.Heiken Ashi Z")\] \[Category("# 1234")\] public class HeikenAshiz : Indicator { private readonly CandleDataSeries \_candles = new CandleDataSeries("Heiken Ashi Z"){ Visible = true }; private readonly PaintbarsDataSeries \_bars= new PaintbarsDataSeries("Bars Z"){ Visible = false }; public HeikenAshiz() { Panel = IndicatorDataProvider.NewPanel; DataSeries\[0\]= \_bars; DataSeries.Add(\_candles); } protected override void OnCalculate(int bar, decimal value) { var candle = GetCandle(bar); \_bars\[bar\] = Colors.Transparent; if (bar == 0) { \_candles\[bar\] = new Candle() { Close = candle.Close, High = candle.High, Low = candle.Low, Open = candle.Open }; } else { var prevCandle = \_candles\[bar - 1\]; \_candles\[bar\] = new Candle() { Close = (candle.Open+candle.Close+candle.High+candle.Low)\*0.25m, High = candle.High, Low = candle.Low, Open = (prevCandle.Open+ prevCandle.Close)\*0.5m, }; } } protected override void OnApplyDefaultColors() { if (ChartInfo is null) return; \_candles.UpCandleColor = Color.FromRgb(14, 203, 129); \_candles.DownCandleColor = Color.FromRgb(246, 70, 93); \_candles.BorderColor = Color.FromRgb(127, 127, 127); } }
}
I'll bite. The "border" of what? And if you say window ...
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I