Description
ATR in Deposit Currency is nothing other than the ATR indicator, but its values are expressed in money.
Parameters:
- Period - ATR period
- MAType - Moving average type for ATR
- Volume - volume for transfer rate movement to money
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class ATRinDepositCurrency : Indicator
{
private AverageTrueRange _atr;
[Parameter(DefaultValue = 14)]
public int Period { get; set; }
[Parameter(DefaultValue = MovingAverageType.Exponential)]
public MovingAverageType MAType { get; set; }
[Parameter(DefaultValue = 10000)]
public int Volume { get; set; }
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
protected override void Initialize()
{
_atr = Indicators.AverageTrueRange(Period, MAType);
}
public override void Calculate(int index)
{
Result[index] = _atr.Result[index] * Volume * (Symbol.PipValue / Symbol.PipSize);
}
}
}
modarkat
Joined on 25.12.2013
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: ATR in Deposit Currency.algo
- Rating: 0
- Installs: 3366
- Modified: 13/10/2021 09:54
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.
No comments found.