Gold Breakout candle Free free

Description

This Bot buy when current price larger than the highest price of last candle. Use only for Gold. Money Pairs I will code later. 

If you like my work and effort then please consider to make a donation via Paypal

Email: nghiand.amz@gmail.com

Facebook: https://www.facebook.com/nghiand.amz

Telegram: +84 969228100

Here is back test result on D2 candle

1. Param

2. Chart 

 

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 GoldTrend : Robot
    {

        [Parameter("Initial Volume Percent", DefaultValue = 1, MinValue = 0)]
        public double InitialVolumePercent { get; set; }
        [Parameter("Stop Loss", DefaultValue = 500)]
        public int StopLoss { get; set; }
        [Parameter("Take Profit", DefaultValue = 1000)]
        public int TakeProfit { get; set; }
        [Parameter("Source")]
        public DataSeries Source { get; set; }


        private double lastHight;

        protected override void OnStart()
        {


        }

        protected override void OnBar()
        {

        }

        protected override void OnTick()
        {
            var volumne = Math.Floor(Account.Balance * InitialVolumePercent / 1000) * 10;
            if (Positions.Count == 0)
            {
                // Put your core logic ere
                Print("Symbol.Bid {0}", Symbol.Bid);

                if (Bars.Last(1).High + Symbol.PipSize < Symbol.Ask)
                {
                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volumne, "NghiandLastBar", StopLoss, TakeProfit);
                }

            }


        }

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