Re: DSL (Discontinued Signal Line) indicators

691
太虚一毫 wrote: Thu Feb 16, 2023 2:07 pm Operating normally! The buttons are perfect. :thumbup:

But the algorithm is slightly different from the old version? Seems older versions signal better (fewer signals).
Was checking my comments when I first posted it looks like I made a separate setting for the dsl signal period something the mt5 version didn't have, must have had a larger signal period to have fewer signals, anyway, added a signal period.

PS: To avoid confusion, the updated version has been attached to the original post.
These users thanked the author mrtools for the post (total 3):
太虚一毫, iPar, talaate


Re: DSL (Discontinued Signal Line) indicators

693

Code: Select all

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 mHalfTrendNew : Indicator
    {
        [Parameter("Period (5) ", DefaultValue = 5, Group = "Main")]
        public int inpAmplitude { get; set; }
        [Parameter("MA Smooth Type", DefaultValue = MovingAverageType.Simple, Group = "Main")]
        public MovingAverageType MaTypeSmooth { get; set; }
 
 
        [Output("Half Trend New", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outHTn { get; set; }
        [Output("Half Trend New - Bullish", LineColor = "Green", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries outHTnBullish { get; set; }
        [Output("Half Trend New - Bearish", LineColor = "Red", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries outHTnBearish { get; set; }
 
 
        private MovingAverage _mah;
        private MovingAverage _mal;
        private IndicatorDataSeries _hh;
        private IndicatorDataSeries _ll;
        private IndicatorDataSeries _htn;
        private IndicatorDataSeries _htnbullish;
        private IndicatorDataSeries _htnbearish;
 
 
        protected override void Initialize()
        {
            _mah = Indicators.MovingAverage(Bars.HighPrices, inpAmplitude, MaTypeSmooth);
            _mal = Indicators.MovingAverage(Bars.LowPrices, inpAmplitude, MaTypeSmooth);
            _hh = CreateDataSeries();
            _ll = CreateDataSeries();
            _htn = CreateDataSeries();
            _htnbullish = CreateDataSeries();
            _htnbearish = CreateDataSeries();
        }
 
        public override void Calculate(int i)
        {
            if (i < inpAmplitude + 2)
            {
                _htn[i] = _htnbullish[i] = _htnbearish[i] = Bars.ClosePrices[i];
                outHTn[i] = _htn[i];
                outHTnBullish[i] = _htnbullish[i];
                outHTnBearish[i] = _htnbearish[i];
                return;
            }
 
            _hh[i] = Bars.HighPrices.Maximum(inpAmplitude - 1);
            _ll[i] = Bars.LowPrices.Minimum(inpAmplitude - 1);
 
 
            _htn[i] = _htn[i - 1];
            _htnbullish[i] = _htnbullish[i - 1];
            _htnbearish[i] = _htnbearish[i - 1];
 
            if (_mah.Result[i] < _htn[i - 1] && _mal.Result[i] < _htn[i - 1] && _hh[i - 1] < _htn[i - 1])
            {
                _htn[i] = _hh[i - 1];
 
            }
            if (_mah.Result[i] > _htn[i - 1] && _mal.Result[i] > _htn[i - 1] && _ll[i - 1] > _htn[i - 1])
            {
                _htn[i] = _ll[i - 1];
 
            }
 
 
 
            if (_htn[i] > _htn[i - 1])
            {
                _htnbullish[i] = _htn[i];
                _htnbearish[i] = double.NaN;
            }
            if (_htn[i] < _htn[i - 1])
            {
                _htnbullish[i] = double.NaN;
                _htnbearish[i] = _htn[i];
            }
 
            outHTn[i] = _htn[i];
            outHTnBullish[i] = _htnbullish[i];
            outHTnBearish[i] = _htnbearish[i];
        }
    }
}
0 + 0 = 0
Infinite / Infinite = 1
1 way to Heaven & it matters

Re: DSL (Discontinued Signal Line) indicators

695
Kalman Filter with All Averages with DSL (levels) Non-linear

This is the non-linear Kalman filter with all the averages that can be used for pre-smoothing the values also with dsl type levels.

Please see here for the Deviation filters version. A PDF has been attached below which describes (in pictures) how a Kalman filter works.
These users thanked the author mrtools for the post (total 13):
Chickenspicy, kvak, Krunal Gajjar, iPar, Jimmy, josi, Jedidiah, sylvester21, alexm, RodrigoRT7, 太虚一毫, thomdel, ionone


Re: DSL (Discontinued Signal Line) indicators

696
DSL Heiken Ashi (Smoothed) Velocity

This is a dsl of the heiken ashi smoothed velocity, with fill and colored lines on the break of the dsl levels. Lower screenshot non-anchored levels.

PS: If you're new to Anchored & Non-anchored levels, please see: What are Anchored & Non-anchored DSL levels?
These users thanked the author mrtools for the post (total 13):
太虚一毫, iPar, Jimmy, kvak, josi, alexm, BeatlemaniaSA, nathanvbasko, Jedidiah, FXSurf, RodrigoRT7, Chickenspicy, ParallelNative

Re: DSL (Discontinued Signal Line) indicators

699
太虚一毫 wrote: Tue Apr 11, 2023 12:18 am This connection is the original version of the Sentiment zone oscillator.

MrTools / KVAK teachers have upgraded this indicator many times and in all directions, and it is extremely perfect. is one of my favorite metrics.

Looking forward to adding the latest (all) averages .
DSL Sentimental Zone Oscillator with E-Averages (MA Filters)

Hello, I made this version for test.... with averages
These users thanked the author kvak for the post (total 13):
太虚一毫, Krunal Gajjar, Jimmy, josi, ParallelNative, iPar, Gethsemane, Mundu19, Jedidiah, Abdi, alexm, vvFish, RodrigoRT7

Re: DSL (Discontinued Signal Line) indicators

700
kvak wrote: Thu Jul 28, 2022 8:12 am This is kind of experiment, percentage price oscillator with levels.
Fast and slow price is possibly calculate not only with EMA but list of averages.
MTF, arrows, alerts.
Coloring is possibly not only with levels, but possibly on slope, signal cross or zero level cross.

PS: For those who are new to DSL and looking for information on what it is, please see: What is DSL Discontinued Signal Line?
Image

Image

does this indicator repaint?


Who is online

Users browsing this forum: ChatGPT [Bot], DotNetDotCom [Bot], eka2, Google [Bot], kvak, Proximic [Bot], ssscary, Xxcoincoin and 118 guests