Warning! This section will be deprecated on February 1st 2025. Please move all your Indicators to the cTrader Store catalogue.
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: 1258
- Modified: 08/02/2022 10:09
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
EL
thanks...
mapquest driving directions
Please, confirm
EM
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place. personal financial advisor
Thanks for posting it!