Gold Breakout candle Free free

by nghiand.amz in category Trend at 17/08/2020
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

kenneyy_eur - August 13, 2021 @ 17:18

Hello,

I downloaded & backtested your bot using the very same parameters you used. i.e.

Asset: XAUUSD

Timeframe: D2

From: 15/01/2020

To:     15/08/2021 (Not 2020)

SL:   500

TP:   1000  

I'm afraid i have very bad news! 

<B>-3318.74$ (-33%)</B> is the result i got. A profit factor of '0' 

I realise the bot you uploaded is not the one that gave you remarkable result you posted. May i ask for the actual bot or is this for sale?

kenneyy_eur - August 13, 2021 @ 17:23

I also reran the test after moving the code from the Ontick() event to the OnBar() event and used a SL of 1000 & TP of 1000. It resulted in a bad loss!!!

0