Description
You can see cci from higher or lower timeframes. multitimeframe cci for free.
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;
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class MultiTimeframeCCI : Indicator
{
private CommodityChannelIndex _cci;
private Bars _series;
private int _timeframeIndex;
[Parameter("CCI Period", DefaultValue = 14, MinValue = 1)]
public int _period { get; set; }
[Parameter("Timeframe", DefaultValue = "Hour1")]
public TimeFrame _timeframe { get; set; }
[Output("CCI", LineColor = "Red", PlotType = PlotType.Line)]
public IndicatorDataSeries _cciOutput { get; set; }
protected override void Initialize()
{
_series = MarketData.GetBars(_timeframe);
_cci = Indicators.CommodityChannelIndex(_series, _period);
}
public override void Calculate(int index)
{
_timeframeIndex = _series.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
_cciOutput[index] = _cci.Result[_timeframeIndex];
}
}
}
DA
davidmwabuka
Joined on 07.03.2023
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Mwabuka_MultiTimeframeCCI mtf.algo
- Rating: 0
- Installs: 487
- Modified: 18/03/2024 09:52
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.