OrglobalFxBOT Simple SSL V1.0 free

by orglobalng in category Trend at 04/07/2021
Description

OrglobalFxBOT Simple SSL V1.0

 

Telegram : @orglobalng

 

Logic: Takes and Close Trades by SSL flips

Warning! Executing the following cBot may result in loss of funds. Use it at your own risk.
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: cAlgo
´╗┐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);
            }
        }
    }
}
Comments
0