1000%/year BOLLINGER BANDS EUR-USD H8 free

Description

This bot use Bollinger bands to trade, After many time backtest I have  good parameters to take profit on this trading system.

The following show the result on Free Version And Pro version

Pro version: ​ Dragon Bollinger Bands Pro H8, EUR- USD Cbot 1000% a year ​

Free version:

Parameter:

-Source, BandPeriods,Std,MAType: Is Bollinger Bands parameters,

-Initial Volume Percent: % money you trade (default 1% balance)

-Stop Loss: Stop Loss on Pip

-Take Profit: Take Profit by Pip


 

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.UTC, AccessRights = AccessRights.None)]
    public class DragonBollingerBands : Robot
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }
        [Parameter("BandPeriods", DefaultValue = 19)]
        public int BandPeriod { get; set; }
        [Parameter("Std", DefaultValue = 1.6)]
        public double std { get; set; }
        [Parameter("MAType")]
        public MovingAverageType MAType { get; set; }
        [Parameter("Initial Volume Percent", DefaultValue = 1, MinValue = 0)]
        public double InitialVolumePercent { get; set; }
        [Parameter("Stop Loss", DefaultValue = 80)]
        public int StopLoss { get; set; }
        [Parameter("Take Profit", DefaultValue = 60)]
        public int TakeProfit { get; set; }

        private BollingerBands boll;

        protected override void OnStart()
        {
            // Put your initialization logic here
            if (RunningMode == RunningMode.RealTime || RunningMode == RunningMode.VisualBacktesting)
            {
                Chart.DrawStaticText("download_PRO", "\n\n\n\n\n\nTo download the PRO Version please visit: https://gum.co/ZLmfl" + "\n\nContacts please write to: nghiand.amz@gmail.com", VerticalAlignment.Top, HorizontalAlignment.Center, Color.Yellow);
            }

            boll = Indicators.BollingerBands(Source, BandPeriod, std, MAType);
        }

        protected override void OnBar()
        {

            if (Positions.FindAll("ndnghiaBollinger").Length >= 1)
            {
                return;
            }

            var volumne = Math.Floor(Account.Balance * 10 * InitialVolumePercent / 1000) * 1000;

            Print("Volume{0}", volumne);
            Print("Balance{0}", Account.Balance);
            Print("Equity{0}", Account.Equity);

            if (Bars.Last(2).Close > boll.Top.Last(2))
            {
                if (Bars.Last(1).Close > boll.Top.Last(1))
                {
                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volumne, "ndnghiaBollinger", StopLoss, TakeProfit);
                }
                else
                {
                    ExecuteMarketOrder(TradeType.Sell, Symbol.Name, volumne, "ndnghiaBollinger", StopLoss, TakeProfit);
                }
            }
            else if (Bars.Last(2).Close < boll.Bottom.Last(2))
            {
                if (Bars.Last(1).Close < boll.Bottom.Last(1))
                {

                    ExecuteMarketOrder(TradeType.Sell, Symbol.Name, volumne, "ndnghiaBollinger", StopLoss, TakeProfit);
                }
                else
                {

                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volumne, "ndnghiaBollinger", StopLoss, TakeProfit);
                }
            }


        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}
Comments

trading.ternet - September 15, 2020 @ 11:17

Thank you  nghiand for cBot
Just a suggestion on this script :
On initialization : Chart.DrawStaticText ... crashes Optimization and backtest without visual mode test
Just add

if (RunningMode == RunningMode.RealTime || RunningMode == RunningMode.VisualBacktesting)
    Chart.DrawStaticText("download_PRO"...........
Without this, optimization gives all the line with zero result.
Have a good day
Michel

0