Category Trend  Published on 30/07/2022

Gold cbot no Loss by> Durrani

Description

always use 1 minute or 5 minute chart (candlestick)

always use 0.01 lot for good returns

only work on XAUUSD 

open and close bot on same day after 24 hours or after sufficient profit 

close the bot after the target is achieved

 


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

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None)]
    public class NdnghiaMACD : Robot
    {
        private MacdCrossOver _MACD;

        [Parameter("Initial Volume Percent", DefaultValue = 0.01, MinValue = 0.01)]
        public double InitialVolumePercent { get; set; }

        [Parameter("Period", DefaultValue = 1100)]
        public int Period { get; set; }

        [Parameter("Long Cycle", DefaultValue = 2)]
        public int LongCycle { get; set; }

        [Parameter("Short Cycle", DefaultValue = 1)]
        public int ShortCycle { get; set; }

        [Parameter("Stop Loss", DefaultValue = 200)]
        public int StopLoss { get; set; }
        [Parameter("Take Profit", DefaultValue = 200)]
        public int TakeProfit { get; set; }

        [Parameter("Signal-line crossover true:if Signal-line crossover false: Zero crossover", DefaultValue = true)]
        public bool IsSignalLineCrossover { get; set; }

        protected override void OnStart()
        {
            _MACD = Indicators.MacdCrossOver(LongCycle, ShortCycle, Period);
        }

        protected override void OnBar()
        {
            var volumne = Math.Floor(Account.Balance * 0 * InitialVolumePercent / 100) + 1;


            {


                if (_MACD.MACD.Last(2) < _MACD.Signal.Last(2) && _MACD.MACD.Last(1) > _MACD.Signal.Last(1))
                {
                    var position = Positions.Find("NdnghiaMACD");
                    if (position != null && position.TradeType == TradeType.Sell)
                    {

                    }
                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volumne, "NdnghiaMACD", 0, 60);

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

                if (_MACD.MACD.Last(2) < _MACD.Signal.Last(2) && _MACD.MACD.Last(1) > _MACD.Signal.Last(1))
                {
                    var position = Positions.Find("NdnghiaMACD");
                    if (position != null && position.TradeType == TradeType.Buy)
                    {

                    }
                    ExecuteMarketOrder(TradeType.Sell, Symbol.Name, volumne, "NdnghiaMACD", 0, 60);
                    // ExecuteMarketOrder(TradeType.Sell, Symbol.Name, volumne, "NdnghiaMACD", StopLoss, TakeProfit);
                }


                {

                    {

                    }
                }
            }
        }

    }

}


SA
sameershaikh.ss13477

Joined on 01.08.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Gold cbot no Loss.algo
  • Rating: 5
  • Installs: 3015
  • Modified: 30/07/2022 11:53
Comments
Log in to add a comment.
EJ
ejvaleting23 · 10 months ago

Hi.can anyone help my code bot to my mt5 please..I have always wanted to own a bot 

LE
lefeberic · 1 year ago

Nice bot - Note that SL and TP are not taken into account as the code has // in front of the logic.

Enjoy

IA
IandelMar · 1 year ago

@padik11  yes i do ;-)

PA
padik11 · 1 year ago

Do you think you will make money on a free bot? Don't be naïve

IA
IandelMar · 1 year ago

Hello, could you please ad Include Trading Hours and a Profit Target in % and $. Thanks

EK
ekram.ali · 2 years ago

I am testing this bot on a demo account but its not profitable. Anything I am missing. I run the bot at the start of Tokyo session and wait for 5-10 percent profit on a $1000 ac with .01 lot but it never achieves it.

Any help would be appreciated.

Thanks nd Regards!

CU
cuervotorres.r · 2 years ago

tjhurry well, that doesn't work, but if in each instance it operates with 0.01 lots what you can do is start two or three instances at the same time, it's the same

CU
cuervotorres.r · 2 years ago

tjhurry If you cannot directly from the settings you can duplicate the bot and replace the default values ​​from the code. Find the number that matches the lots you are buying and simply change the number (Duplicate it and rename the copy, try not to break anything)

CU
cuervotorres.r · 2 years ago

But let me tell you something, if you set the tp to 10pips the profit is much more sustained and healthy. Stop holding many failed trades throughout the day, hold much less, that allows you to have a much healthier floating drowdown and always have liquidity to open new trades during the day. Also being able to always follow the price closely and have a profit when you turn off at any time, without waiting. And the profit in the end will be similar, you are taking profit from all the micro movements continuously the same. Just replace the "60s" with "10s" and you're good to go. And don't use the automatic backtest. Use it for a few days in demo better. Looks very different. :)

TJ
tjhurry · 2 years ago

Hi, how can you increase the lot size to 0.02, 0.05, and so on? Nice cbot by the way thanks.

CU
cuervotorres.r · 2 years ago

Man, this is great, it really works no matter what the price does. Floating drowdown stays more or less the same throughout the day, but the gains add up over time and always outweigh it. With an account of 10,000 and 0.01 lots it works perfectly. Starting with the Tokyo session and turning it off an hour or two before the next one. It's really great. Thank you (I have been using it for 10 days and all of them have been a significant gain)

CI
ciyep55675 · 2 years ago

Wendy's is one of America's favorite fast-food restaurants, it was founded in 1969, and since then, it has been looking for the best mechanisms to keep its customers happy. However, Apple Pay is not part of their payment methods - does wendy's take apple pay

DO
DonDemon · 2 years ago

Any chance to limit the open orders with max open positions or something like that?

Great bot thank you..:)

GM
gmkenneyy · 2 years ago

Anything multiplied by zero would equal zero

Your formula for volume is a bit flawed "Account.Balance * 0 * InitialVolumePercent" - The zero should be 1

PE
pewiyit443 · 2 years ago

Nice bot, thanks. I use it to spend less time and to automate the process. This link will also help you to enjoy the process

SA
sameershaikh.ss13477 · 2 years ago

celsodonini profits have to be closed after target achieved manually 

and bot is running well any problem

 

CE
celsodonini · 2 years ago

sameershaikh.ss13477 Congratulations on the robot, I've been running it for a week without loss. One question, can you insert into the schedule a command to close all orders when you reach profit?

PA
padik · 2 years ago

The stop loss activates itself at the set value. Test a few days days and you will see how the account is reset.

CE
celsodonini · 2 years ago

Orders are coming in without stop loss, how do I activate stop in bot?

PA
padik11 · 2 years ago

Is the stop loss hidden from the broker or is it removed / sent?

SA
sameershaikh.ss13477 · 2 years ago

if 

account size is 10000 Dollar lot size 0.50 lot max 

means 0.50percent risk per cbot trade

SA
sameershaikh.ss13477 · 2 years ago

Rule: Daily closing at 5 percent or 10 percent gain 

start cBot at tokyo session or as per your risk no 1 cbot  happy journey

JF
JFXLive · 2 years ago

Problem is, it keeps on booking small profits...and at the same time, it will be accumulating loosing trades as Floating Negative Balance. It will eventually blow the account.  Daily reset of the Bot is something to test.

SA
sameershaikh.ss13477 · 2 years ago

its hedging strategy 

 

EV
evgrinaus · 2 years ago

Looks like a Martingale system?

SA
sameershaikh.ss13477 · 2 years ago

only use on 1 minute and 5 minute 

only XAUUSD

use 0.01 lot size