protected override void CalcBar() { m_rs_dailydataarray1.Call(); if (Bars.CurrentBar == 1 || Bars.Time[0].Date != Bars.Time[1].Date) { m_rs_extremes1.Call(); var m_startday = (numdays - oldqualdays); m_qualhi.Value = (PublicFunctions.DoubleLessEquals(m_oprevhighestday.Value, m_startday) && PublicFunctions.DoubleGreater(m_oprevhighestday.Value, newqualdays)); m_quallo.Value = (PublicFunctions.DoubleLessEquals(m_oprevlowestday.Value, m_startday) && PublicFunctions.DoubleGreater(m_oprevlowestday.Value, newqualdays)); } if (((m_qualhi.Value && PublicFunctions.DoubleGreater(Bars.High[0], m_oprevhighest.Value)) && PublicFunctions.IffLogic((m_dataarray[0][((12)), ((m_index.Value))] == m_subarray[0][((3))]), PublicFunctions.DoubleLessEquals(m_subarray[0][((1))], m_oprevhighest.Value), true))) { if ((Bars.Time[0] != m_prevnewhidate.Value)) { Plot1.Set(0, Bars.High[0]); } m_prevnewhidate.Value = Bars.Time[0]; } else { if (((m_quallo.Value && PublicFunctions.DoubleLess(Bars.Low[0], m_oprevlowest.Value)) && PublicFunctions.IffLogic((m_dataarray[0][((12)), ((m_index.Value))] == m_subarray[0][((3))]), PublicFunctions.DoubleGreaterEquals(m_subarray[0][((2))], m_oprevlowest.Value), true))) { if ((Bars.Time[0] != m_prevnewlodate.Value)) { Plot2.Set(0, Bars.Low[0]); } m_prevnewlodate.Value = Bars.Time[0]; } } Plot3.Set(0, m_oprevhighest.Value); Plot4.Set(0, m_oprevlowest.Value); if (m_qualhi.Value) { Plot3.Widths[0] = 2; } if (m_quallo.Value) { Plot4.Widths[0] = 2; } }
protected override void CalcBar() { m_rs_dailydataarray1.Call(); var m_barnum = m_barnumber1[0]; var m_barssincedayhi = (m_barnum - m_dataarray[0][10, m_index.Value]); var m_barssincedaylo = (m_barnum - m_dataarray[0][11, m_index.Value]); var mBbminus1 = (barsbetween - 1); m_qualhi.Value = PublicFunctions.DoubleGreaterEquals(m_barssincedayhi, mBbminus1); m_quallo.Value = PublicFunctions.DoubleGreaterEquals(m_barssincedaylo, mBbminus1); if (requirereversalgap) { if (((Bars.CurrentBar == 1) || (Bars.Time[0].Date != Bars.Time[1].Date))) { m_rs_extremes1.Call(); var m_gapup = PublicFunctions.DoubleGreater(m_dataarray[0][((1)), ((m_index.Value))], m_oprevhighest.Value); var m_gapdn = PublicFunctions.DoubleLess(m_dataarray[0][((1)), ((m_index.Value))], m_oprevlowest.Value); var m_thirdprevavg = m_rs_average1[0]; var m_secondprevavg = m_rs_average2[0]; var m_prevavg = m_rs_average3[0]; var m_uptrend = (PublicFunctions.DoubleGreater(m_prevavg, m_secondprevavg) && PublicFunctions.DoubleGreater(m_secondprevavg, m_thirdprevavg)); var m_dntrend = (PublicFunctions.DoubleLess(m_prevavg, m_secondprevavg) && PublicFunctions.DoubleLess(m_secondprevavg, m_thirdprevavg)); m_revgapup.Value = (m_dntrend && m_gapup); m_revgapdn.Value = (m_uptrend && m_gapdn); } } else { m_revgapup.Value = true; m_revgapdn.Value = true; } if ((Bars.Time[0].Date == Bars.Time[1].Date)) { var m_newdayhi = (m_barssincedayhi == 0 && m_qualhi[1] && m_revgapup.Value); var m_newdaylo = (m_barssincedaylo == 0 && m_quallo[1] && m_revgapdn.Value); if ((m_newdayhi && m_newdaylo)) { Plot1.Set(0, Bars.Close[0], Color.White); } else { if (m_newdayhi) { Plot1.Set(0, Bars.High[0], Color.Yellow); } else { if (m_newdaylo) { Plot1.Set(0, Bars.Low[0], Color.Cyan); } } } } var _now_time = new DateTime(1, 1, 1, Bars.Time[0].Hour, Bars.Time[0].Minute, Bars.Time[0].Second); if (_now_time < startbartime || _now_time > endbartime) { Plot1.Colors[0] = Color.DarkGray; } if (requirereversalgap) { if (m_revgapup.Value) { Plot2.Set(0, Bars.Close[0], Color.Blue); } else { if (m_revgapdn.Value) { Plot2.Set(0, Bars.Close[0], default(Color)); } } } Plot3.Set(0, m_dataarray[0][((2)), ((m_index.Value))]); Plot4.Set(0, m_dataarray[0][((3)), ((m_index.Value))]); if (m_qualhi.Value) { Plot3.Widths[0] = 2; } if (m_quallo.Value) { Plot4.Widths[0] = 2; } }