Weekly High&Low
Created at 09 Dec 2013, 16:01
Weekly High&Low
09 Dec 2013, 16:01
English is not good at me.
It may be hard to come, but, please tell me someone.
The code below is the indicator to draw line on the highs and lows of the current week.
using System; using cAlgo.API; namespace cAlgo.Indicators { [Indicator(IsOverlay = true, AutoRescale = false)] public class WeeklyHighLow : Indicator { public override void Calculate(int index) { double high = MarketSeries.High.LastValue; double low = MarketSeries.Low.LastValue; for (int i = MarketSeries.Close.Count - 2; i > 0; i--) { if (MarketSeries.OpenTime[i].DayOfWeek < DayOfWeek.Monday) break; high = Math.Max(high, MarketSeries.High[i]); low = Math.Min(low, MarketSeries.Low[i]); } ChartObjects.DrawHorizontalLine("high", high, Colors.Red); ChartObjects.DrawHorizontalLine("low", low, Colors.Blue); } } }
Display is to be in this code, separate the time deviated.
I want to match (UTC +2) start 0:00.
This code does not draw a line only the highs and lows from 3:00 or 2:00.
And did you or try to add the Timezone, but it did not go well.
Whether, thank you.
st0424
09 Dec 2013, 16:27
I have solved the problem.
@st0424