Indicators

Created at 07 Dec 2023, 13:03
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AH

ahmadtrader448

Joined 29.11.2023

Indicators
07 Dec 2023, 13:03


Hello there, I created a Moving average indicator that visualizes adaptive MA and horizontal line based on the last value of the moving average,

Is there any way to not visualize the adaptive moving average and use its data only?

Is there any way to hide data values from the title of the moving average?

 

thanks in advanced


using cAlgo.API;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)]
    public class SampleSMA: Indicator
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter(DefaultValue = 14)]
        public int Periods { get; set; }

        [Output("Main", LineColor = "Turquoise")]
        public IndicatorDataSeries Result { get; set; }

        public override void Calculate(int index)
        {
            var sum = 0.0;

            for (var i = index - Periods + 1; i <= index; i++)
                sum += Source[i];

            Result[index] = sum / Periods;
            
            
            var trendLine = Chart.DrawTrendLine("trendLine", Bars.OpenTimes.LastValue , Result.LastValue , Bars.OpenTimes.LastValue.AddYears(2), Result.LastValue , Color.Red, 1, LineStyle.Solid);
            trendLine.IsInteractive = true;     
        }
    }
}

 

 

 

 


@ahmadtrader448
Replies

firemyst
11 Dec 2023, 11:25 ( Updated at: 12 Dec 2023, 06:31 )

Yes.

Remove:

[Output("Main", LineColor = "Turquoise")]

 


@firemyst

Shares4UsDevelopment
11 Dec 2023, 15:13

Already tried:
      Color.Transparent 
     or “00000000” as color?
 


@Shares4UsDevelopment