Category Trend  Published on 08/02/2022

Customizable SMA FDGG

Description
CUSTOMIZABLE SMA FDGG
Customizable Simple Moving Average made by FDGG goup.
Enjoy ;)

// -------------------------------------------------------------------------------------------------
//
//    This code is a cTrader Automate API example.
//    
//    All changes to this file might be lost on the next application update.
//    If you are going to modify this file please make a copy using the "Duplicate" command.
//
// -------------------------------------------------------------------------------------------------

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;


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

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

        [Parameter("Offset Orizzontale (Candles)", DefaultValue = 1)]
        public int VerticalOffsetPips { get; set; }

        [Parameter("Offset Verticale (Pips)", DefaultValue = 1)]
        public int HorizontalOffset { get; set; }

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



        public override void Calculate(int index)
        {
            double sum = 0.0;
            double VerticalOffsetPrice = VerticalOffsetPips * 0.0001;

            for (int i = index - Periods + 1; i <= index; i++)
            {
                sum += Source[i];
            }
            Result[index + HorizontalOffset] = sum / Periods + VerticalOffsetPrice;
        }
    }
}


GI
GiacomoGiannandrea

Joined on 08.02.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Customizable_SMA_FDGG.algo
  • Rating: 0
  • Installs: 1200
  • Modified: 08/02/2022 10:09
Comments
Log in to add a comment.
BE
bekeanloinse · 1 year ago

Thanks for posting it!

EL
elijahnelsonne · 1 year ago

thanks...
mapquest driving directions
Please, confirm

EM
emilyburank · 2 years ago

Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.  personal financial advisor