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
Joined on 05.02.2019
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Weekly High And Low.algo
- Rating: 0
- Installs: 2378
- 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.
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
Just 2 straight lines across my charts.
Totally useless!
@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!