PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
29 Nov 2021, 08:27

Hi DemoTrader01,

Every transaction taking place in your your account will cause position readjustment to maintain the equity to equity ratio. There is no automatic way to receive dividends in another account at the moment. 

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
29 Nov 2021, 08:23

Hi blockchainTrader1,

Please use the correct topics for your posts.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
29 Nov 2021, 08:20

Hi Suminda,

This feature is under development. It has been presented in this webinar.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
26 Nov 2021, 16:59

Hi sirinath,

You can use PendingOrders.Filled event to get notified when your order has been filled.

Note that Limit orders are not converted to Market order but executed as Limit orders and Stop Limit orders are implelemted as per the industry standand and not like they are implemented by MetaTrader.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 


@PanagiotisCharalampous

PanagiotisCharalampous
26 Nov 2021, 09:50

Hi yuval.ein,

Yes correct.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
26 Nov 2021, 08:37

Hi gummire,

No this is not possible unfortunately.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 


@PanagiotisCharalampous

PanagiotisCharalampous
26 Nov 2021, 08:35

Hi yuval.ein,

1. Yes it is.

2. No it is not possible.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 


@PanagiotisCharalampous

PanagiotisCharalampous
26 Nov 2021, 08:31

Hi phill.beaney,

Try changing the graphics card used for cTrader to NVIDIA. Read here how.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 


@PanagiotisCharalampous

PanagiotisCharalampous
24 Nov 2021, 15:06

Hi phill.beaney,

The thread I posted advises to update your Inter Iris drivers. Did you try that?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 


@PanagiotisCharalampous

PanagiotisCharalampous
22 Nov 2021, 10:33

Hi there, 

You need to reach out to your broker regarding this issue.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
22 Nov 2021, 08:32

Hi lisardy11,

ADX is a part of the Directional Movement System indicator.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
22 Nov 2021, 08:29

Hi crobbeandersson,

You should post your suggestions in the Suggestions section.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
19 Nov 2021, 15:45 ( Updated at: 21 Dec 2023, 09:22 )

Hi bowen.guo.kaust,

In the exact same way as simple moving average. Quoting the formula again

The mean value is the average and is the number of periods.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
19 Nov 2021, 14:45 ( Updated at: 21 Dec 2023, 09:22 )

Hi haohan51,

Send it like this

Also make sure there are no indicators/cBots running in cTrader Automate

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
19 Nov 2021, 12:21

Hi haohan51,

You can send us some troubleshooting info when this happens (Ctrl+Alt+Shift+T). However I am 99% sure this is happening because of your cBot.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
18 Nov 2021, 21:26

Hi there,

That's normal. Read here. You need to apply rounding.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
18 Nov 2021, 15:21

Hi MATRIXTRADER,

See your modified strategy, using BarOpened instead, below

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Diagnostics;
using Microsoft.Win32;
using cAlgo.API.Requests;
using System.Text;


namespace cAlgo
{

    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class MultyTraDinGPro : Robot
    {

        [Parameter("Use CHOOSE 1", DefaultValue = true)]
        public bool useCHOOSE1 { get; set; }

        [Parameter("CHOOSE SYMBOL 1", DefaultValue = "GER40")]
        public string Symbol1 { get; set; }

        [Parameter("Another Timeframe", DefaultValue = "HOUR")]
        public TimeFrame AnotherTimeFrame1 { get; set; }

        [Parameter("Label 1", DefaultValue = "dax")]
        public string RobotID1 { get; set; }

        [Parameter("Volume", DefaultValue = 0.6, MinValue = 0)]
        public double Volume1 { get; set; }

        [Parameter("SL ", DefaultValue = 60)]
        public double SL1 { get; set; }

        [Parameter("TP ", DefaultValue = 10)]
        public double TP1 { get; set; }

        [Parameter("MA_period", DefaultValue = 24)]
        public int MA_period1 { get; set; }

        [Parameter("MAType", DefaultValue = MovingAverageType.VIDYA)]
        public MovingAverageType MAType1 { get; set; }

        [Parameter("--------MACD-----------------", DefaultValue = "MACD")]
        public string Separator6 { get; set; }

        [Parameter("MACD LongCycle", DefaultValue = 30, MinValue = 1)]
        public int LongCycle1 { get; set; }

        [Parameter("MACD ShortCycle", DefaultValue = 2, MinValue = 1)]
        public int ShortCycle1 { get; set; }

        [Parameter("MACD Period", DefaultValue = 20, MinValue = 1)]
        public int MACDPeriod1 { get; set; }


        [Parameter("__________________________", DefaultValue = "___________")]
        public string Separator1 { get; set; }

        /////////////////////////////////////////////////////////////////////////////////////////////////////////

        [Parameter("Use CHOOSE 2", DefaultValue = true)]
        public bool useCHOOSE2 { get; set; }

        [Parameter("CHOOSE SYMBOL 2", DefaultValue = "GBPUSD")]
        public string Symbol2 { get; set; }

        [Parameter("Another Timeframe", DefaultValue = "HOUR")]
        public TimeFrame AnotherTimeFrame2 { get; set; }

        [Parameter("Label 1", DefaultValue = "gbp")]
        public string RobotID2 { get; set; }

        [Parameter("Volume", DefaultValue = 5000, MinValue = 0)]
        public double Volume2 { get; set; }

        [Parameter("SL ", DefaultValue = 110)]
        public double SL2 { get; set; }

        [Parameter("TP ", DefaultValue = 20)]
        public double TP2 { get; set; }


        [Parameter("MA_period", DefaultValue = 100)]
        public int MA_period2 { get; set; }

        [Parameter("MAType", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType MAType2 { get; set; }


        [Parameter("MACD LongCycle", DefaultValue = 21, MinValue = 1)]
        public int LongCycle2 { get; set; }

        [Parameter("MACD ShortCycle", DefaultValue = 12, MinValue = 1)]
        public int ShortCycle2 { get; set; }

        [Parameter("MACD Period", DefaultValue = 9, MinValue = 1)]
        public int MACDPeriod2 { get; set; }


        [Parameter("__________________________", DefaultValue = "___________")]
        public string Separator2 { get; set; }

        //////////////////////////////////////////////////////////////////////////////////////////////////////


        [Parameter("Use CHOOSE 3", DefaultValue = true)]
        public bool useCHOOSE3 { get; set; }

        [Parameter("CHOOSE SYMBOL 3", DefaultValue = "XAUUSD")]
        public string Symbol3 { get; set; }

        [Parameter("Another Timeframe", DefaultValue = "HOUR")]
        public TimeFrame AnotherTimeFrame3 { get; set; }

        [Parameter("Label 3", DefaultValue = "gold")]
        public string RobotID3 { get; set; }

        [Parameter("Volume", DefaultValue = 3, MinValue = 0)]
        public double Volume3 { get; set; }

        [Parameter("SL ", DefaultValue = 120)]
        public double SL3 { get; set; }

        [Parameter("TP ", DefaultValue = 15)]
        public double TP3 { get; set; }

        [Parameter("MA_period", DefaultValue = 200)]
        public int MA_period3 { get; set; }

        [Parameter("MAType", DefaultValue = MovingAverageType.Exponential)]
        public MovingAverageType MAType3 { get; set; }

        [Parameter("MACD LongCycle", DefaultValue = 32, MinValue = 1)]
        public int LongCycle3 { get; set; }

        [Parameter("MACD ShortCycle", DefaultValue = 14, MinValue = 1)]
        public int ShortCycle3 { get; set; }

        [Parameter("MACD Period", DefaultValue = 30, MinValue = 1)]
        public int MACDPeriod3 { get; set; }

        [Parameter("__________________________", DefaultValue = "___________")]
        public string Separator20E { get; set; }


        private MovingAverage MA1;
        private MacdHistogram _macd1;


        private MovingAverage MA2;
        private MacdHistogram _macd2;



        private MovingAverage MA3;
        private MacdHistogram _macd3;


        private Symbol _symbol1;
        private Symbol _symbol2;
        private Symbol _symbol3;


        /////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void InitializeSeries(string symbolCode)
        {
            _symbol1 = Symbols.GetSymbol(Symbol1);
            _symbol2 = Symbols.GetSymbol(Symbol2);
            _symbol3 = Symbols.GetSymbol(Symbol3);


        }
        protected override void OnStart()
        {
            InitializeSeries(Symbol1);
            InitializeSeries(Symbol2);
            InitializeSeries(Symbol3);
            {
                var bars = MarketData.GetBars(AnotherTimeFrame1, Symbol1);
                bars.BarOpened += Bars_BarOpened;
                MA1 = Indicators.MovingAverage(bars.ClosePrices, MA_period1, MAType1);
                _macd1 = Indicators.MacdHistogram(bars.ClosePrices, LongCycle1, ShortCycle1, MACDPeriod1);



                var bars2 = MarketData.GetBars(AnotherTimeFrame2, Symbol2);
                bars.BarOpened += Bars_BarOpened1;
                MA2 = Indicators.MovingAverage(bars2.ClosePrices, MA_period2, MAType2);
                _macd2 = Indicators.MacdHistogram(bars2.ClosePrices, LongCycle2, ShortCycle2, MACDPeriod2);



                var bars3 = MarketData.GetBars(AnotherTimeFrame3, Symbol3);
                bars3.BarOpened += Bars3_BarOpened;
                MA3 = Indicators.MovingAverage(bars3.ClosePrices, MA_period3, MAType3);
                _macd3 = Indicators.MacdHistogram(bars3.ClosePrices, LongCycle3, ShortCycle3, MACDPeriod3);



            }
        }

        private void Bars3_BarOpened(BarOpenedEventArgs obj)
        {
            ManagePositions3();
        }

        private void Bars_BarOpened1(BarOpenedEventArgs obj)
        {
            ManagePositions2();
        }

        private void Bars_BarOpened(BarOpenedEventArgs obj)
        {
            ManagePositions1();
        }


        private void ManagePositions1()
        {



            if (useCHOOSE1 == true)
            {
                var cBotPositions = Positions.FindAll(RobotID1);

                if (cBotPositions.Length >= 1)
                    return;


                {


                    if (MA1.Result.IsRising() && _macd1.Signal.IsRising())
                    {

                        ExecuteMarketOrder(TradeType.Buy, _symbol1, Volume1, RobotID1, SL1, TP1);


                        {


                            if (MA1.Result.IsFalling() && _macd1.Signal.IsFalling())
                            {

                                ExecuteMarketOrder(TradeType.Sell, Symbol1, Volume1, RobotID1, SL1, TP1);



                            }
                        }

                    }
                }
            }
        }





        //////////////////////////////////////////////////////////////////


        private void ManagePositions2()
        {



            if (useCHOOSE2)
            {

                var cBotPositions = Positions.FindAll(RobotID2);

                if (cBotPositions.Length >= 1)
                    return;


                {


                    if (MA2.Result.IsRising() && _macd2.Signal.IsRising())
                    {

                        ExecuteMarketOrder(TradeType.Buy, _symbol2, Volume2, RobotID2, SL2, TP2);

                        {


                            if (MA2.Result.IsFalling() && _macd2.Signal.IsFalling())
                            {

                                ExecuteMarketOrder(TradeType.Sell, _symbol2, Volume2, RobotID2, SL2, TP2);




                            }
                        }
                    }

                }
            }
        }





        //////////////////////////////////////////////////////////////////

        private void ManagePositions3()
        {


            //
            if (useCHOOSE3 == true)
            {

                var cBotPositions = Positions.FindAll(RobotID3);

                if (cBotPositions.Length >= 1)
                    return;


                {


                    if (MA3.Result.IsRising() && _macd3.Signal.IsRising())
                    {

                        ExecuteMarketOrder(TradeType.Buy, _symbol3, Volume3, RobotID3, SL3, TP3);
                        {
                            if (MA3.Result.IsFalling() && _macd3.Signal.IsFalling())
                            {

                                ExecuteMarketOrder(TradeType.Sell, _symbol3, Volume3, RobotID3, SL3, TP3);



                            }
                        }
                    }

                }
            }
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
18 Nov 2021, 11:39

Hi there,

Please explain what do you thing s wrong here. The results seem correct to me.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
18 Nov 2021, 09:02

Hi haohan51,

Is this likely the underlying issue?

It's a probable cause

If so, are you able to make any suggestions?

Either get a VPS with higher specs or optimize your code

The code at the moment uses the "Async" method to operate, such as "ModifyPendingOrderAsync" and "ModifyPositionAsync". Does this add extra workload onto the CPU because it's trying to do everything in parallel? Would using non-Async method reduce the CPU load?

It could decrease the CPU load but it will make execution slower. If your trading decisions are time critical, then opt for a VPS with more cores.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2021, 08:54

Hi blockchainTrader1,

This can also happen earlier. It depends on your broker's stop out level.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 


@PanagiotisCharalampous