SSL

by cysecsbin.01 in category Trend at 11/07/2019
Description

Follow my cTrader Telegram group at https://t.me/cTraderCommunity; it's a new community but it will grow fast, plus everyone can talk about cTrader indicators and algorithm without restrictions, though it is not allowed to spam commercial indicators to sell them. There's also a Discord Server now @ https://discord.gg/5GAPMtp

This is the SSL indicator convertend from tradingview. It was a little request on my discord server, so here it is

For any bug report or suggestion, follow my telegram group or comment below

Download
86 downloads
How to install
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
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 SSL : Indicator
    {
        [Parameter("Length", DefaultValue = 10)]
        public int len { get; set; }

        [Output("SSLDown", LineColor = "Red")]
        public IndicatorDataSeries sslDown { get; set; }
        [Output("SSLUp", LineColor = "Green")]
        public IndicatorDataSeries sslUp { get; set; }

        private SimpleMovingAverage smaHigh, smaLow;
        private IndicatorDataSeries hlv;

        protected override void Initialize()
        {
            smaHigh = Indicators.SimpleMovingAverage(MarketSeries.High, len);
            smaLow = Indicators.SimpleMovingAverage(MarketSeries.Low, len);
            hlv = CreateDataSeries();
        }

        public override void Calculate(int index)
        {
            hlv[index] = MarketSeries.Close[index] > smaHigh.Result[index] ? 1 : MarketSeries.Close[index] < smaLow.Result[index] ? -1 : hlv[index - 1];
            sslDown[index] = hlv[index] < 0 ? smaHigh.Result[index] : smaLow.Result[index];
            sslUp[index] = hlv[index] < 0 ? smaLow.Result[index] : smaHigh.Result[index];
        }
    }
}
Comments

alexsanramon - July 11, 2019 @ 09:22

Thank you

5