Bollinger Band indicator on screen
Bollinger Band indicator on screen
09 Oct 2022, 14:03
I have a custom indicator which an addition to its use I want it to show a Bollinger Band indicator on screen. How can I do that?
Thanks
Replies
PanagiotisChar
13 Oct 2022, 07:42
( Updated at: 13 Oct 2022, 07:45 )
Hi Yuval,
Is there a way to set the bands color by code?
Unfortunately this is not possible.
Is there a way at least to set the default color value?
Yes see below
[Output("Main", LineColor = "Red")]
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
10 Oct 2022, 09:16
Hi Yuval,
Here is a starting point
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 { [Indicator(AccessRights = AccessRights.None, IsOverlay = true)] public class NewIndicator : Indicator { [Output("Main")] public IndicatorDataSeries Main { get; set; } [Output("Top")] public IndicatorDataSeries Top { get; set; } [Output("Bottom")] public IndicatorDataSeries Bottom { get; set; } BollingerBands _bb; protected override void Initialize() { _bb = Indicators.BollingerBands(Bars.ClosePrices, 20, 2, MovingAverageType.Simple); } public override void Calculate(int index) { // Calculate value at specified index Main[index] = _bb.Main[index]; Top[index] = _bb.Top[index]; Bottom[index] = _bb.Bottom[index]; } } }
Aieden Technologies
Trade with us
@PanagiotisChar