protected override void CalcBar() { var m_avg = m_AverageFC[0]; var m_shift = NumAtrs * this.AverageTrueRange(Length); m_LowerBand.Value = m_avg - m_shift; if (Bars.CurrentBar > 1 && Price.CrossesUnder(m_LowerBand, ExecInfo.MaxBarsBack)) { m_bSetupSE.Value = true; m_CrossingLow.Value = Bars.Low[0]; } else { if (m_bSetupSE.Value && (PublicFunctions.DoubleGreater(Price[0], m_avg) || PublicFunctions.DoubleLessEquals(Bars.Low[0], m_CrossingLow.Value - Bars.Point))) { m_bSetupSE.Value = false; } } if (m_bSetupSE.Value) { m_KltChSE.Send(m_CrossingLow.Value - Bars.Point); } }
protected override void CalcBar() { m_avgexp.Value = m_xaverage1[0]; if (((displace >= 0) || Bars.CurrentBar > Math.Abs(displace))) { Plot1.Set(displace, m_avgexp.Value); if ((displace <= 0)) { if (((PublicFunctions.DoubleGreater(price[0], m_avgexp.Value) && PublicFunctions.DoubleGreater(m_avgexp.Value, m_avgexp[1])) && PublicFunctions.DoubleLessEquals(m_avgexp[1], m_avgexp[2]))) { Alerts.Alert("Indicator turning up"); } else { if (((PublicFunctions.DoubleLess(price[0], m_avgexp.Value) && PublicFunctions.DoubleLess(m_avgexp.Value, m_avgexp[1])) && PublicFunctions.DoubleGreaterEquals(m_avgexp[1], m_avgexp[2]))) { Alerts.Alert("Indicator turning down"); } } } } }
protected override void CalcBar() { if (PublicFunctions.DoubleLessEquals(Bars.Close.RateOfChange(length), pctdn)) { Plot1.Set(0, Bars.High[0]); Plot2.Set(0, Bars.Low[0]); Alerts.Alert(); } else { Plot1.Reset(); } }
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_adxvalue.Value = m_adx1[0]; Plot1.Set(0, m_adxvalue.Value); if (PublicFunctions.DoubleGreater(m_adxvalue.Value, m_adxvalue[1]) && PublicFunctions.DoubleLessEquals(m_adxvalue[1], m_adxvalue[2])) { Alerts.Alert("Indicator turning up"); } else { if (PublicFunctions.DoubleLess(m_adxvalue.Value, m_adxvalue[1]) && PublicFunctions.DoubleGreaterEquals(m_adxvalue[1], m_adxvalue[2])) { Alerts.Alert("Indicator turning down"); } } }
protected override void CalcBar() { if (m_SwingLow[0] > 0) { m_Setup.Value = true; m_PivotLow.Value = Bars.Low[Strength]; } else { if (m_Setup.Value && PublicFunctions.DoubleLessEquals(Bars.Low[0], m_PivotLow.Value - Bars.Point)) { m_Setup.Value = false; } } if (m_Setup.Value) { m_PivRevSE.Send(m_PivotLow.Value - Bars.Point); } }
protected override void CalcBar() { m_tsf.Value = m_timeseriesforecast1[0]; Plot1.Set(0, m_tsf.Value); if (((PublicFunctions.DoubleGreater(Bars.Close[0], m_tsf.Value) && PublicFunctions.DoubleGreater(m_tsf.Value, m_tsf[1])) && PublicFunctions.DoubleLessEquals(m_tsf[1], m_tsf[2]))) { Alerts.Alert("Indicator turning up"); } else { if (((PublicFunctions.DoubleLess(Bars.Close[0], m_tsf.Value) && PublicFunctions.DoubleLess(m_tsf.Value, m_tsf[1])) && PublicFunctions.DoubleGreaterEquals(m_tsf[1], m_tsf[2]))) { Alerts.Alert("Indicator turning down"); } } }
protected override void CalcBar() { m_dirmovement1.Call(); Plot1.Set(0, m_dirmovement1.ADX.Value); Plot2.Set(0, m_dirmovement1.ADXR.Value); if (PublicFunctions.DoubleGreater(m_dirmovement1.ADXR.Value, m_dirmovement1.ADXR[1]) && PublicFunctions.DoubleLessEquals(m_dirmovement1.ADXR[1], m_dirmovement1.ADXR[2])) { Alerts.Alert("ADXR turning up"); } else { if (PublicFunctions.DoubleLess(m_dirmovement1.ADXR.Value, m_dirmovement1.ADXR[1]) && PublicFunctions.DoubleGreaterEquals(m_dirmovement1.ADXR[1], m_dirmovement1.ADXR[2])) { Alerts.Alert("ADXR turning down"); } } }
protected override void CalcBar() { if (Bars.LastBarOnChart && Bars.Status != EBarState.Close) { var m_myvol = Bars.TrueVolume()[0]; if (Bars.CurrentBar > m_mycurrentbar.Value) { m_volumeatbid.Value = 0; m_volumeatask.Value = 0; m_bavolratio.Value = 0; m_voltmp.Value = 0; m_mycurrentbar.Value = Bars.CurrentBar; } if (PublicFunctions.DoubleLess(Bars.StatusLine.Bid, Bars.StatusLine.Ask)) { if (PublicFunctions.DoubleLessEquals(Bars.Close[0], Bars.StatusLine.Bid)) { m_volumeatbid.Value = ((m_volumeatbid.Value + m_myvol) - m_voltmp.Value); } else { if (PublicFunctions.DoubleGreaterEquals(Bars.Close[0], Bars.StatusLine.Ask)) { m_volumeatask.Value = ((m_volumeatask.Value + m_myvol) - m_voltmp.Value); } } } if ((PublicFunctions.DoubleGreater(m_volumeatbid.Value, 0) && PublicFunctions.DoubleGreater(m_volumeatask.Value, 0))) { m_bavolratio.Value = PublicFunctions.Iff(uselog, Math.Log((m_volumeatask.Value / ((m_volumeatbid.Value)))), (m_volumeatask.Value / ((m_volumeatbid.Value)))); } m_voltmp.Value = m_myvol; Plot1.Set(0, m_bavolratio.Value); } Plot2.Set(0, 0); }
protected override void CalcBar() { m_barnum.Value = m_barnumber1[0]; if ((hilo == 1)) { m_neckswbar.Value = m_swinglowbar1[0]; m_hnsswbar.Value = m_swinghighbar1[0]; m_neckswprice.Value = Bars.Low[0]; m_hnsswprice.Value = Bars.High[0]; } else { if ((hilo == (-1))) { m_neckswbar.Value = m_swinghighbar2[0]; m_hnsswbar.Value = m_swinglowbar2[0]; m_neckswprice.Value = Bars.High[0]; m_hnsswprice.Value = Bars.Low[0]; } } if ((m_neckswbar.Value == neckswstrength)) { m_neckswings[0][((1)), 0] = m_neckswings[0][0, 0]; m_neckswings[0][((1)), ((1))] = m_neckswings[0][0, ((1))]; m_neckswings[0][((1)), ((2))] = m_neckswings[0][0, ((2))]; m_neckswings[0][((1)), ((3))] = m_neckswings[0][0, ((3))]; m_neckswings[0][0, 0] = m_barnum[neckswstrength]; m_neckswings[0][0, ((1))] = Bars.Time[neckswstrength].ToOADate(); m_neckswings[0][0, ((2))] = Bars.Time[neckswstrength].ToOADate(); m_neckswings[0][0, ((3))] = m_neckswprice[neckswstrength]; } if ((m_hnsswbar.Value == hnsswstrength)) { for (var m_value1 = 1; PublicFunctions.DoubleGreaterEquals(m_value1, 0); m_value1 = (m_value1 - 1)) { m_hnsswings[0][m_value1 + 1, 0] = m_hnsswings[0][m_value1, 0]; m_hnsswings[0][m_value1 + 1, ((1))] = m_hnsswings[0][m_value1, ((1))]; m_hnsswings[0][m_value1 + 1, ((2))] = m_hnsswings[0][m_value1, ((2))]; m_hnsswings[0][m_value1 + 1, ((3))] = m_hnsswings[0][m_value1, ((3))]; m_hnsswings[0][m_value1 + 1, ((4))] = m_hnsswings[0][m_value1, ((4))]; } m_hnsswings[0][0, 0] = m_barnum[hnsswstrength]; m_hnsswings[0][0, ((1))] = Bars.Time[hnsswstrength].ToOADate(); m_hnsswings[0][0, ((2))] = Bars.Time[hnsswstrength].ToOADate(); m_hnsswings[0][0, ((3))] = m_hnsswprice[hnsswstrength]; m_hnsswings[0][0, ((4))] = Bars.TrueVolume().Average(hnsswstrength * 2); var m_hororder = ((((m_hnsswings[0][0, 0] > m_neckswings[0][0, 0]) && (m_neckswings[0][0, 0] > m_hnsswings[0][((1)), 0])) && (m_hnsswings[0][((1)), 0] > m_neckswings[0][((1)), 0])) && (m_neckswings[0][((1)), 0] > m_hnsswings[0][((2)), 0])); if ((hilo == 1)) { m_vertorder_hvss.Value = ((m_hnsswings[0][((1)), ((3))] > m_hnsswings[0][((2)), ((3))]) && (m_hnsswings[0][((1)), ((3))] > m_hnsswings[0][0, ((3))])); m_vertorder_nvss.Value = ((m_neckswings[0][0, ((3))] < m_hnsswings[0][((2)), ((3))]) && (m_neckswings[0][((1)), ((3))] < m_hnsswings[0][0, ((3))])); m_necklinelimit.Value = PublicFunctions.Min(m_neckswings[0][0, ((3))], m_neckswings[0][((1)), ((3))]); m_maxnecktoheaddist.Value = (m_hnsswings[0][((1)), ((3))] - m_necklinelimit.Value); } else { if ((hilo == (-1))) { m_vertorder_hvss.Value = ((m_hnsswings[0][((1)), ((3))] < m_hnsswings[0][((2)), ((3))]) && (m_hnsswings[0][((1)), ((3))] < m_hnsswings[0][0, ((3))])); m_vertorder_nvss.Value = ((m_neckswings[0][0, ((3))] > m_hnsswings[0][((2)), ((3))]) && (m_neckswings[0][((1)), ((3))] > m_hnsswings[0][0, ((3))])); m_necklinelimit.Value = PublicFunctions.Max(m_neckswings[0][0, ((3))], m_neckswings[0][((1)), ((3))]); m_maxnecktoheaddist.Value = (m_necklinelimit.Value - m_hnsswings[0][((1)), ((3))]); } } var m_necklinetilt = Math.Abs((m_neckswings[0][0, ((3))] - m_neckswings[0][((1)), ((3))])); if ((m_maxnecktoheaddist.Value != 0)) { m_vertproportion.Value = PublicFunctions.DoubleLess((m_necklinetilt / ((m_maxnecktoheaddist.Value))), vertproportionlimit); } else { m_vertproportion.Value = false; } if ((((m_hororder && m_vertorder_hvss.Value) && m_vertorder_nvss.Value) && m_vertproportion.Value)) { if ((m_color.Value == color2)) { m_color.Value = color1; } else { m_color.Value = color2; } var m_textref = DrwText.Create( new ChartPoint(DateTime.FromOADate(m_hnsswings[0][0, ((2))]), m_hnsswings[0][0, ((3))]), "Shoulder"); m_textref.Color = m_color.Value; m_textref.HStyle = (ETextStyleH)2; m_textref.VStyle = 0; m_textref = DrwText.Create( new ChartPoint(DateTime.FromOADate(m_hnsswings[0][((1)), ((2))]), m_hnsswings[0][((1)), ((3))]), "Head"); m_textref.Color = m_color.Value; m_textref.HStyle = (ETextStyleH)2; m_textref.VStyle = 0; m_textref = DrwText.Create( new ChartPoint(DateTime.FromOADate(m_hnsswings[0][((2)), ((2))]), m_hnsswings[0][((2)), ((3))]), "Shoulder"); m_textref.Color = m_color.Value; m_textref.HStyle = (ETextStyleH)2; m_textref.VStyle = 0; if (confirmvolume) { var m_avgvolfast = Bars.TrueVolume().Average(hnsswstrength); string m_msg; if ((PublicFunctions.DoubleGreater(m_avgvolfast, m_hnsswings[0][0, ((4))]) && PublicFunctions.DoubleGreater(m_avgvolfast, m_hnsswings[0][((2)), ((4))]))) { m_msg = "Volume confirm"; } else { m_msg = "Vol non-confirm"; } m_textref = DrwText.Create( new ChartPoint(DateTime.FromOADate(m_neckswings[0][((1)), ((2))]), m_necklinelimit.Value), m_msg); m_textref.Color = m_color.Value; m_textref.HStyle = 0; m_textref.VStyle = (ETextStyleV)1; } if (drawneckline) { m_tlref = DrwTrendLine.Create( new ChartPoint(DateTime.FromOADate(m_neckswings[0][((1)), ((2))]), m_neckswings[0][((1)), ((3))]), new ChartPoint(DateTime.FromOADate(m_neckswings[0][0, ((2))]), m_neckswings[0][0, ((3))])); m_tlref.ExtLeft = false; m_tlref.ExtRight = false; m_tlref.Color = m_color.Value; m_confirmbarnum.Value = m_barnum.Value; } } } if ((null != m_tlref && m_tlref.Exist && m_lastcrossedtl.Value != m_tlref.ID && PublicFunctions.DoubleLessEquals((m_barnum.Value - m_confirmbarnum.Value), barspast))) { var m_tl_value = m_tlref.PriceValue(Bars.Time[0]); if ((((hilo == 1) && PublicFunctions.DoubleLess(Bars.Close[0], m_tl_value)) || ((hilo == (-1)) && PublicFunctions.DoubleGreater(Bars.Close[0], m_tl_value)))) { Plot1.Set(0, m_neckswprice.Value, m_color.Value); Alerts.Alert(); m_lastcrossedtl.Value = m_tlref.ID; } else { Plot1.Reset(); } } }
protected override void CalcBar() { var m_newswingprice = m_swinghigh1[0]; if ((m_newswingprice != (-1))) { if ((PublicFunctions.DoubleLessEquals(m_tldir.Value, 0) && PublicFunctions.DoubleGreaterEquals(m_newswingprice, (m_swingprice.Value * m_retracefctrup)))) { m_saveswing.Value = true; m_addtl.Value = true; m_tldir.Value = 1; } else { if (((m_tldir.Value == 1) && PublicFunctions.DoubleGreaterEquals(m_newswingprice, m_swingprice.Value))) { m_saveswing.Value = true; m_updatetl.Value = true; } } } else { m_newswingprice = m_swinglow1[0]; if ((m_newswingprice != (-1))) { if ((PublicFunctions.DoubleGreaterEquals(m_tldir.Value, 0) && PublicFunctions.DoubleLessEquals(m_newswingprice, (m_swingprice.Value * m_retracefctrdn)))) { m_saveswing.Value = true; m_addtl.Value = true; m_tldir.Value = (-1); } else { if (((m_tldir.Value == (-1)) && PublicFunctions.DoubleLessEquals(m_newswingprice, m_swingprice.Value))) { m_saveswing.Value = true; m_updatetl.Value = true; } } } } if (m_saveswing.Value) { m_swingprice.Value = m_newswingprice; m_swingtime.Value = Bars.Time[1]; m_saveswing.Value = false; } if (m_addtl.Value) { m_tlref.Value = DrwTrendLine.Create(new ChartPoint(m_swingtime.Value, m_swingprice.Value), new ChartPoint(m_swingtime[1], m_swingprice[1])); m_tlref.Value.ExtLeft = false; m_tlref.Value.ExtRight = false; m_tlref.Value.Size = ((int)(linewidth)); m_tlref.Value.Color = linecolor; m_addtl.Value = false; } else { if (m_updatetl.Value) { m_tlref.Value.End = new ChartPoint(m_swingtime.Value, m_swingprice.Value); m_updatetl.Value = false; } } }