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

PanagiotisCharalampous
22 Mar 2018, 16:14

Hi all,

Linked charts are planned for the next versions of both cTrader Web and cTrader Desktop. So I am pretty confident that you will have them in less than two years :)

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Mar 2018, 14:45

Hi irmscher9,

If you don't perform any extraordinary calculations before sending the order, i don't think you will have a problem. Computation-wise, sending an order is a submillisecond process.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Mar 2018, 14:04

Hi irmscher9,

There is no single answer to this question. It depends what your needs are e.g. how many robots are you running at the same time, what are their processing needs, how often do they trade etc

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Mar 2018, 11:15

Hi jjwes76@gmail.com,

The code snippet is just an example. You need to adjust it based on your code.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Mar 2018, 11:03 ( Updated at: 21 Dec 2023, 09:20 )

Hi ceacuk,

This seems to be happening because of a weekend gap between the 21st and 24th of April. See below

Let me know if this addresses your concerns.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Mar 2018, 09:31

Hi jjwes76@gmail.com,

You can use a condition like the one below

            if (_sma.Result.LastValue > position.EntryPrice)
                ExecuteMarketOrder(TradeType.Buy, Symbol, 1000);

Let me know if this helps,

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Mar 2018, 09:26

Hi Anton,

You could try to use a condition like the sample below

           if(DateTime.UtcNow.Hour >= 8 && DateTime.UtcNow.Hour < 4)
           {
           // Do something...
           }

Let me know if this helps,

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 18:01

Hi Gwave,

Unfortunately, I cannot engage into developing custom cBots for traders. If you need professional help, you could contact a Consultant or post a Job.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 17:45

Hi ceakuk,

We would be able to help you if you share with us the cBot code and steps to reproduce the results. Only by seeing an image, we cannot come to any conclusions.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 17:31

Hi Gwave,

Thanks for posting in our forum. An idea would be to keep in the counter trade position a reference to the original position e.g. keep the id in the label, and then, on OnPositionsClosed, track if there is a referenced position and close it as well. However this needs some coding to be achieved...

Let me know if I was helpful.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 15:10

Hi ciawynne,

You get these warnings because you still use local variables when getting the indicators

            var EMA_9 = Indicators.ExponentialMovingAverage(SourceSeries, EMA_9_period);
            var EMA_3 = Indicators.ExponentialMovingAverage(SourceSeries, EMA_3_period);

it should be

            EMA_9 = Indicators.ExponentialMovingAverage(SourceSeries, EMA_9_period);
            EMA_3 = Indicators.ExponentialMovingAverage(SourceSeries, EMA_3_period);

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 12:06

Please also note that DateTime is not supported as an input parameter

        [Parameter()]
        public DateTime TimeSeries { get; set; }

 


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 11:37

Hi cianwynne,

Thanks for the cBot. The provided code does not build but the error I receive is about EMA_3 and EMA_9 not being declared in the OnBar method. When I uncomment the relevant properties, it builds fine. Am i missing something?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 10:59

Hi cianwynne,

It would be much easier for us to help you if you could share with us the cBot code so that we can reproduce your issue.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 09:44

Hi Alexander,

It doesn't need to be Excel or SQL. A simple csv would be enough. There are plenty of examples on how to do this like this one.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Mar 2018, 09:25

Hi Alexander,

Yes you could store this information in a file if you would like it not to be lost on a restart. I agree with you that using the TP is not a good idea.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Mar 2018, 17:34

Hi Alexander,

From what I understand you need to track which positions have been modified and not modify them again in case they have. You could hold all the modified positions in a separate list and before modifying a position check if the position is in the list or not.

Let me know what you think of this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Mar 2018, 11:13 ( Updated at: 21 Dec 2023, 09:20 )

Hi ceakuk,

I have tried this but does not seem to be true. See my examples below

Indicator

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class LastValueIndicator : Indicator
    {
        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }


        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            Result[index] = MarketSeries.Close.LastValue;
        }
    }
}

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
    {

        private LastValueIndicator _ind;
        protected override void OnStart()
        {
            _ind = Indicators.GetIndicator<LastValueIndicator>();
        }

        protected override void OnTick()
        {
            Print("cBot Last Value: " + MarketSeries.Close.LastValue);
            Print("Indicator Last Value:" + _ind.Result.LastValue);
        }

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

Results

Let me know if I am missing something.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Mar 2018, 10:36

Hi leonardo,

Currently there is no such functionality in cAlgo.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Mar 2018, 09:29

Hi cianwyinne,

Thamks for posting in our forum. Here is a guide on how to use custom indicators in your cBots. Let me know if it is helpful.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous