Category Trend  Published on 29/03/2022

OrglobalFxBOT Simple SSL V1.0

Description

OrglobalFxBOT Simple SSL V1.0

Tested on Renko

 

Telegram : @orglobalng

 

Logic: Takes and Close Trades by SSL flips


using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.WCentralAfricaStandardTime, AccessRights = AccessRights.None)]
    public class OrglobalFxBOT_Simple_SSL : Robot
    {
        [Parameter("Volume", DefaultValue = 1000)]
        public double _Volume { get; set; }
        [Parameter("Length", DefaultValue = 20)]
        public int _length { get; set; }
        [Parameter("MA Type", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType _MAType { get; set; }

        private SSLChannel _ssl;

        protected override void OnStart()
        {
            _ssl = Indicators.GetIndicator<SSLChannel>(_length, _MAType);
        }

        protected override void OnBar()
        {
            if (_ssl._sslUp.HasCrossedAbove(_ssl._sslDown, 1))
            {
                Close(TradeType.Sell, "OrgSSL");
                Open(TradeType.Buy, "OrgSSL");
            }
            else if (_ssl._sslUp.HasCrossedBelow(_ssl._sslDown, 1))
            {
                Close(TradeType.Buy, "OrgSSL");
                Open(TradeType.Sell, "OrgSSL");
            }
        }

        private void Close(TradeType tradeType, string Label)
        {
            foreach (var position in Positions.FindAll(Label, SymbolName, tradeType))
                ClosePosition(position);
        }

        private void Open(TradeType tradeType, string Label)
        {
            var position = Positions.Find(Label, SymbolName);
            if (position == null)
            {
                ExecuteMarketOrder(tradeType, SymbolName, 1000, Label);
            }
        }
    }
}


Orglobalfx01's avatar
Orglobalfx01

Joined on 03.03.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: OrglobalFxBOT_Simple_SSL.algo
  • Rating: 0
  • Installs: 1620
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
CU
cuervotorres.r · 1 year ago

Man, try that on heikin ashi bars.