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

PanagiotisCharalampous
22 Jan 2018, 14:20

Dear leohermoso,

Can you please confirm that you are comparing the same conditions for live and backtesting results? In the post you mention January but in the results we can see only trade statistics for November. You did not provide the period for the backtesting results.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2018, 14:13

Hi irmscher9,

If you send us the cBot code and the backtesting parameters, maybe we can check out why the stop loss is ignored.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2018, 12:31

Dear Trader,

Thanks for posting in our forum. Functions cannot be defined within another function. See below how to define a new function in a cBot.

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 NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            // Put your initialization logic here
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

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

        protected int newFunction(int n)
        {
            int i = n * 10;
            return i;
        }
    }
}

Let me know if the above helps you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2018, 12:14

Dear Trader,

Thanks for posting in our forum. Unfortunately such functionality is not available currently.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2018, 11:13

Hi irmscher9,

Probably you have misunderstood what market range does. Market range specifes the amount of pips that you accept the price to move against you when closing a deal. If the calculated VWAP for the deal exceeds the market range, then it will be either executed partially, only for the liquidity available within the market rage or not executed at all. So there is actually one direction every time, up for buy orders and down for sell orders. Market range affects only the market order and not TP and SL. TP is a limit order therefore market range is not applicable (it can also be interpreted as market range of 0)  and SL is a stop order in which you will accept any market range since you need to stop losses and close the entire position.

Let me know if the above clarifies things for you.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2018, 10:55

Hi irmscher,

Yes you can specify market range in the ExecuteMarketOrder function.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jan 2018, 09:45

Hi aisaac,

Usually brokers offer online tools to enable traders to calculate the swap rates. I would advise you to contact your broker and ask if they offer such a tool.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jan 2018, 16:32

Hi mosaddequ@gmail.com,

This cBot will modify your positions SL and TP on start based on preset values. If this is what you are looking for then yes, it is ready to use.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jan 2018, 16:20

Dear mosaddequ@gmail.com,

Thanks for posting in our forum. You can try something like the following

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

        [Parameter(DefaultValue = 0.0)]
        public double StopLoss { get; set; }

        [Parameter(DefaultValue = 0.0)]
        public double TakeProfit { get; set; }

        protected override void OnStart()
        {
            foreach (var position in Positions)
            {
                ModifyPosition(position, StopLoss, TakeProfit);
            }
        }

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

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jan 2018, 10:05

Hi Surady,

See below a very simple example on how to calculate your average equity with samples taken on each bar change.

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 AverageEquity : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        private double _equity;
        private double _periodCount;

        protected override void OnStart()
        {
            ExecuteMarketOrder(TradeType.Buy, Symbol, 10000);
        }

        protected override void OnBar()
        {
            _equity += Account.Equity;
            _periodCount++;
            Print("Average Equity:" + (_equity / _periodCount));
        }

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

If you need something more complicated or any professional help in developing your cBot, you can post a Job or contact a professional Consultant.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jan 2018, 09:48

Hi irmscher,

Volume should work fine for indices. Can you tell us what is the problem you experience so that we can help?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Jan 2018, 17:20

Hi tmc.

API functions are not thread safe therefore they should be called in the main thread of a cBot. Therefore parallelization of this functionality is currently not possible.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Jan 2018, 17:07

Hi Drummond360,

Indeed it is a typo.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Jan 2018, 11:21

Hi Patrick, 

Thanks for notifying us for this. It seems to be a bug. I will notify the product team to have a look at this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jan 2018, 14:49

Hi dordkash@gmail.com,

This feature is currently only available in the backtesting chart. If you want you can post a suggestion in the Suggestions section for consideration by the product.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jan 2018, 12:19

Hi anghenly,

No, as soon as the order is sent then there isn't a way to stop it. If you are concerned about accidentally clicking this button, you might consider changing your QuickTrade settings and enable the Double-Click mode.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jan 2018, 11:52

Hi mindbreaker,

The problem here is that your Take Profit pips are a value higher than 50000 which is the maximum limit that cTrader accepts currently. We will remove this limitation in a future release.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jan 2018, 11:34

Hi hadikhalil86@gmail.com,

Did you check your spam folder in case these emails end up there?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jan 2018, 11:30

Hi dordkash@gmail.com,

Is the cAlgo screenshot from the actual symbol chart or from the backtesting chart?

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
15 Jan 2018, 16:30

Dear Patrick,

Thanks for taking the time to bring up this subject. This idea is already in the backlog for some time now and I have communicated with the product team to push the priority a bit more since it seems there is demand for this feature. Hopefully we will see this in one of the future releases of cTrader.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous