Replies

PanagiotisCharalampous
19 Jun 2019, 15:16

Hi a.fernandez.martinez,

Probably you are using v3.3 Note that this is available only in v3.5.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 15:08

Hi a.fernandez.martinez,

Here is an example

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            foreach (var watchlist in Watchlists)
            {
                foreach (var symbol in Symbols)
                    Print(watchlist.Name + " - " + symbol);
            }
        }

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

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

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 14:13

Hi aloz82,

Thanks for posting in our forum. At the moment Fibonacci Arc is available only on cTrader Web. If you notice, the link you sent os from cTrader Web section.

Regarding

The second question is whether there is an option to make all the objects in the chart appear temporarily. Temporarily hide all objects in the chart. 

There is no such option I am afraid.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 14:07

Hi a.fernandez.martinez,

Can you post a code sample showing how you are using Watchlists?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 11:51

Hi Chris,

If you are not familiar with C# then I don't think it will help you in anyway to run the demo app. The whole point would be to compare your implementation with the example project. Else you will just confirm yourself that the message is correct and that you get a response from the server. In any case, based on the available information, I guess that there should be something wrong with your implementation since everything else seems correct. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 11:40

Hi FireMyst,

It is async, meaning that it will be executed at a later point of time, when the event is received. It is not multi-threaded thought, it is still a single thread running and when the event is received, the handler will wait for its turn to be executed. So if the while loop is blocking the thread, then no events can be received and no handlers can executed.

You say

 I have the while loop is I don't want any other code to execute until both callback actions have completed.

and indeed this is what happens. No other code is execured, including callback actions, therefore you are stuck there forever :).

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 11:13

Hi Firemyst,

It's simple. It is a sequential single threaded execution. If the while loop is reached before the callbacks are executed or the IsExecuting is set to true then you will have a deadlock. As long as the while loop is executed, nothing else can be executed until the loop is finished. So if the code enters that loop there is no way out. As is the loop is actually useless.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 11:07

Hi Chris,

Thanks for posting in our forum. Your message seems correct. I also tried it with the example application and I had no issues, response is received. Could you try it as well?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 11:04

Hi FireMyst,

You have a while loop on example 2 as well. This is why the callback action is not called. The while loop blocks the execution. Since you have flags in the callback actions, why do you need that loop?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Jun 2019, 10:49

Hi FireMyst,

The problem is with the while loops. They block the execution of the thread. If you want to execute operations after a successful position opening I suggess to use the asynchronous callback event raised by this function.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:45

Hi FireMyst,

Can you please share a complete cBot code that reproduces the issue?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:40

Hi cysecsbin.01,

No this is not possible. cTrader Automate API is not an open source API.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:38

Hi DontAlgoMe,

No there is no such option at the moment.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:35

Hi lec0456,

There is no way to use older versions at the moment. The issue with the non persistent cBot parameters has been forwarded to the team and they possible solutions are under consideration.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:28

Hi Danial,

You cannot use chart operations on backtesting e.g. drawing objects in your chart. If you want to optimize your cBot, you need to remove this functionality from the code.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:26

Hi skalikas,

There is no built-in functionality for this. You need to develop such functionality yourself.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:23

Hi tentcows,

Thanks for posting in our forum. We have a new function for Market Range orders now. See here.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 12:18

Hi zedodia,

I accidentally used the opposite values. See below the correct piece of code.

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter("Fractal Period", DefaultValue = 5)]
        public int _period { get; set; }

        private Fractals _fractal;

        protected override void OnStart()
        {
            _fractal = Indicators.GetIndicator<Fractals>(_period);
        }

        protected override void OnBar()
        {
            var _fractaldown = Math.Round(_fractal.UpFractal.LastValue, Symbol.Digits);
            var _fractalup = Math.Round(_fractal.DownFractal.LastValue, Symbol.Digits);

            var position = ExecuteMarketOrder(TradeType.Buy, Symbol, 1000).Position;
            position.ModifyTakeProfitPrice(_fractaldown);
            position.ModifyStopLossPrice(_fractalup);
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 11:54

Hi Kafeldom,

We are planning improvements in the zooming functionality. Stay tuned!

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Jun 2019, 11:52

Hi Bjorn,

If you need assistance in developing your cBot, you can always contact a Consultant or post a Job.

Best Regards,

Panagiotis


@PanagiotisCharalampous