makhzen
makhzen's avatar

Info

Username:makhzen
Name:makhzen
Member since: 23 Nov 2020

About

None

Signature

None

Last Forum Posts

@My cbot work on backtest but not in the Market:  14 Jul 2022, 12:50


makhzen said:

PanagiotisCharalampous said:

Hi makhzen,

Did you check your logs? Do you get any errors?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Hello Panagiotis ,

I restarted ctrader yesterday i forgot to check the log...but since yesterday i have this (from 

Maybe the problem is about the SL/TP based on ATR ? 

Thank you,

Makhzen

i think error come from here i changed

            var StopLoss = (MarketSeries.Close.Last(1) + (_averageTrueRange.Result.Last(1) / Symbol.PipSize * ATRfactor));
 

by

            var StopLoss = (MarketSeries.Close.Last(1) + (_averageTrueRange.Result.Last(1) / (Symbol.TickSize / Symbol.PipSize * Math.Pow(10, Symbol.Digits) * ATRfactor)));

You think it can be the source of the problem ?

Thank you

@My cbot work on backtest but not in the Market:  14 Jul 2022, 12:41


PanagiotisCharalampous said:

Hi makhzen,

Did you check your logs? Do you get any errors?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Hello Panagiotis ,

I restarted ctrader yesterday i forgot to check the log...but since yesterday i have this (from 

Maybe the problem is about the SL/TP based on ATR ? 

Thank you,

Makhzen

@My cbot work on backtest but not in the Market:  13 Jul 2022, 15:49


Hello, i have some troubles with my cbot, it work on backtest i can see the the past trades but in live account no order are sent

Here the code of my cbot

Thank you for help

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class GoldScalperPro : Robot
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }


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

        [Parameter("Risk", DefaultValue = 1)]
        public double Risk { get; set; }


        [Parameter("ATR multiple", DefaultValue = 2)]
        public double ATRfactor { get; set; }
        [Parameter("Start Hour", DefaultValue = 7)]
        public double StartTime { get; set; }

        [Parameter("Stop Hour", DefaultValue = 18)]
        public double StopTime { get; set; }

        public long Volume;
        private DateTime _startTime;
        private DateTime _stopTime;
        private AverageTrueRange _averageTrueRange;
        public ExponentialMovingAverage SlowEMA;
        private MacdCrossOver _MACD;






        protected override void OnStart()
        {

            _MACD = Indicators.MacdCrossOver(26, 12, 9);

            _averageTrueRange = Indicators.AverageTrueRange(14, MovingAverageType.Exponential);
            SlowEMA = Indicators.ExponentialMovingAverage(Bars.ClosePrices, 200);
            Positions.Closed += OnPositionClosed;
            _startTime = Server.Time.Date.AddHours(StartTime);
            _stopTime = Server.Time.Date.AddHours(StopTime);
            Volume = InitialVolume;


        }



        protected override void OnTick()
        {


            var currentHours = Server.Time.TimeOfDay.TotalHours;
            bool tradeTime = StartTime < StopTime ? currentHours > StartTime && currentHours < StopTime : currentHours < StopTime || currentHours > StartTime;

            var longPosition = Positions.Find("Gold Scalper Pro", SymbolName, TradeType.Buy);
            var shortPosition = Positions.Find("Gold Scalper Pro", SymbolName, TradeType.Sell);

            if (Trade.IsExecuting)
                return;

            {
                if (!tradeTime)
                    return;
                {


                    if (longPosition == null && Positions.Count(x => x.TradeType == TradeType.Buy) == 0)
                    {
                        if (MarketSeries.Close.Last(1) > SlowEMA.Result.Last(1) && (_MACD.MACD.Last(1) < _MACD.Signal.Last(1) && _MACD.MACD.Last(0) > _MACD.Signal.Last(0) && _MACD.Signal.Last(0) < 0))
                        {

                            Open(TradeType.Buy);


                        }
                        if (shortPosition == null && Positions.Count(x => x.TradeType == TradeType.Sell) == 0)
                        {
                            if (MarketSeries.Close.Last(1) < SlowEMA.Result.Last(1) && (_MACD.MACD.Last(1) > _MACD.Signal.Last(1) && _MACD.MACD.Last(0) < _MACD.Signal.Last(0) && _MACD.Signal.Last(0) > 0))


                                Open(TradeType.Sell);
                        }
                    }
                }
            }
        }


        private void Close(TradeType tradeType)
        {
            foreach (var position in Positions.FindAll("Gold Scalper Pro", Symbol, tradeType))
                ClosePosition(position);
        }



        private void Open(TradeType tradeType)
        {

            var atrInPips = _averageTrueRange.Result.Last(1) * (Symbol.TickSize / Symbol.PipSize * Math.Pow(10, Symbol.Digits));
            var StopLoss = (MarketSeries.Close.Last(1) + (_averageTrueRange.Result.Last(1) / Symbol.PipSize * ATRfactor));


            var TakeProfit = StopLoss;




            var cBotPositions = Positions.FindAll("Gold Scalper Pro");

            if (cBotPositions.Length >= 1)
                return;


            ExecuteMarketOrder(tradeType, Symbol, Volume, "Gold Scalper Pro", StopLoss, TakeProfit);

        }

        private long GetVolume(double risk, int stopLossPips)
        {


            var volume = Account.Equity / 10000 * Risk;
            var normalizedVolume = Symbol.NormalizeVolume(volume);

            return normalizedVolume;
        }

        private void OnPositionClosed(PositionClosedEventArgs args)
        {
            var risk = 0.25;
            var stopLossPips = 10;
            var volume = GetVolume(risk, stopLossPips);

            Print("Closed");

            var position = args.Position;

            if (position.Label != "Gold Scalper Pro" || position.SymbolCode != Symbol.Code)
                return;

            if (position.GrossProfit > 0)
            {
                Volume = volume;

            }

            else if (position.GrossProfit < 0)
            {
                Volume = position.Volume * 2;

            }
        }
    }
}

@Scammer strategy provider ?:  23 Dec 2020, 13:44


PanagiotisCharalampous said:

Hi makhzen,

What kind of support do you need?

Best Regards,

Panagiotis 

Join us on Telegram

Hello i want to know if this kind of provider methods are legal for you ?

They are not worried ? 

Thanks


 

@Scammer strategy provider ?:  23 Dec 2020, 02:01


hello, yesterday i invested 100€ into " 1 Shot 1 kill " stategy provider copy trader account 1188344

Today, the whole account has been lost with a lot of bad trades, the equity of copy provider was 10$

The fees was 19% of benefits + 19$ volume per millions, i think it was a scame because he just need to open a lot of bad trades and be paid by volume fees ?

How can I contact support for my account ? thanks

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.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.
MACD PIVOT POINT BOT
  2
  5
  2430
free  23 Nov 2020
Hi, Today i share my new cbot, not yet live tested but look profitable on backtest with different periods. Based from Pivot Point cbot found here i added MACD for filter entries. For exemple on DAX m5 results are pretty good  But i have a problem, it only open Buy positions....can someone help me to fix thanx guys.