Category Volatility  Published on 04/06/2019

[Weekly High And Low] Free =)

Description

dot dot dot


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


namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class WeeklyHighAndLow : Indicator
    {
        [Output("Weekly High", LineColor = "Red")]
        public IndicatorDataSeries LastWeeksHigh { get; set; }

        [Output("Weekly Low", LineColor = "Green")]
        public IndicatorDataSeries LastWeeksLow { get; set; }

        [Parameter("Number of Weeks", DefaultValue = 1, MinValue = 1, MaxValue = 2000, Step = 1)]
        public int NumberOfWeeks { get; set; }

        public MarketSeries WeeklyDataseries;

        protected override void Initialize()
        {
            WeeklyDataseries = MarketData.GetSeries(Symbol, TimeFrame.Weekly);
        }

        public override void Calculate(int index)
        {
            LastWeeksLow[index] = WeeklyDataseries.Low.Minimum(NumberOfWeeks);
            LastWeeksHigh[index] = WeeklyDataseries.High.Maximum(NumberOfWeeks);
        }

    }
}


TradeMingZhi's avatar
TradeMingZhi

Joined on 05.02.2019

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Weekly High And Low.algo
  • Rating: 0
  • Installs: 2251
Comments
Log in to add a comment.
BE
benchan1986 · 2 years ago

@Sigis , isn't that the whole point of this indicator? 2 simple lines that do not clutter my chart but allows me a quick visual of the weekly close and open.

 

Thank you @Quant_Vs_Market for the indicator. now I don't have to manually plot my weekly anymore. thanks alot!

TradeMingZhi's avatar
TradeMingZhi · 2 years ago

Hey @Sigis there are pratical use cases for having straight lines as you're strictly focused on last x weeks high/low.

I suggest you start coding yourself, give people free shit and they complain smh

SI
Sigis · 3 years ago

Just 2 straight lines across my charts.

Totally useless!