Replies

Clark22
14 Jun 2024, 04:48

RE: Universal Instance Creation Bug?

PanagiotisCharalampous said: 

Hi there,

Your description is not clear. Can you please share some screenshots/videos that will help us understand what you are looking at?

Best regards,

Panagiotis

1 of the cbots in the list had two instances which i had created, and now all of the sample bots have instances for the same instruments, somehow automatically created by ctrader.


@Clark22

Clark22
14 Jun 2024, 04:34

RE: RE: Help please. I've deleted my code :(

fahim36912 said: 

Clark22 said: 

I'd be happy to send the algo file if ctrader chaps would be kind enough to restore my code for me.

 

Cheers,

Naseem

When you right click on them and select export you might have an option of “export with source code”. Do you have that?

Too late for that. I only have built algo files


@Clark22

Clark22
12 Jun 2024, 13:48

I'd be happy to send the algo file if ctrader chaps would be kind enough to restore my code for me.

 

Cheers,

Naseem


@Clark22

Clark22
11 Jun 2024, 14:05

RE: Text on the different lines

PanagiotisCharalampous said: 

Hi there,

There is no built in feature for this. You would need to develop your own functionality to achieve this.

Best regards,

Panagiotis

Labels are definitely needed for all elements so that they can be identified and manipulated.


@Clark22

Clark22
11 Jun 2024, 13:55

I already reported this security issue. It's exposing people's ctrader ID to other users. It needs fixing.


@Clark22

Clark22
11 Jun 2024, 13:52

check/print the spread when executing the order with SL. 


@Clark22

Clark22
11 Jun 2024, 01:49

Seconded.

And the ability to re-order them!


@Clark22

Clark22
03 Jun 2024, 13:35

RE: ....

PanagiotisCharalampous said: 

Hi there,

I do not understand the problem. Can you please explain with more details?

Best regards,

Panagiotis

 

Hi,

Has this security issue been investigated?

 

Cheers,

Clark


@Clark22

Clark22
31 May 2024, 11:05 ( Updated at: 31 May 2024, 11:52 )

RE: RE:

haohan51 said: 

amusleh said:

Hi,

For now there is no such feature in cTrader automate API, you can open a thread under suggestions section for this feature.

Thank you for your reply - I've created this Suggestion.

Please could anyone interested help with a vote on this:

https://ctrader.com/forum/suggestions/38094

 

If you want to exit trade at a price below current then that's a Stop Loss. As for avoiding slippage on closing a position, wouldn't that be lovely?! 🤣


@Clark22

Clark22
31 May 2024, 10:45

Fortunately, this does not extend to id.ctrader.com. when I clicked on the profile link it took me to my own profile - Clark22


@Clark22

Clark22
31 May 2024, 10:26

RE: RE: RE: ....

Clark22 said: 

Clark22 said: 

PanagiotisCharalampous said: 

Hi there,

I do not understand the problem. Can you please explain with more details?

Best regards,

Panagiotis

The problem is that the server session tokens have intermixed or something like that. I had access to this account last night without doing anything.

One moment I am Clark22 and the next moment I am R4PTUR3. I was able to see the CT ID and to post this thread under the account.

It's a serious security issue that needs to be fixed ASAP. All accounts are potentially compromised.

I recommend that everyone deletes all open sessions under their profiles and log back in. And also log out after every usage in the meantime to reduce exposure to this security issue, until it is fixed.

 

Not my account:

 


@Clark22

Clark22
31 May 2024, 10:20

RE: RE: ....

Clark22 said: 

PanagiotisCharalampous said: 

Hi there,

I do not understand the problem. Can you please explain with more details?

Best regards,

Panagiotis

The problem is that the server session tokens have intermixed or something like that. I had access to this account last night without doing anything.

One moment I am Clark22 and the next moment I am R4PTUR3. I was able to see the CT ID and to post this thread under the account.

It's a serious security issue that needs to be fixed ASAP. All accounts are potentially compromised.

I recommend that everyone deletes all open sessions under their profiles and log back in. And also log out after every usage in the meantime to reduce exposure to this security issue, until it is fixed.


@Clark22

Clark22
31 May 2024, 10:17

RE: ....

PanagiotisCharalampous said: 

Hi there,

I do not understand the problem. Can you please explain with more details?

Best regards,

Panagiotis

The problem is that the server session tokens have intermixed or something like that. I had access to this account last night without doing anything.

One moment I am Clark22 and the next moment I am R4PTUR3. I was able to see the CT ID and to post this thread under the account.

It's a serious security issue that needs to be fixed ASAP. All accounts are potentially compromised.


@Clark22

Clark22
31 May 2024, 06:49

RE: Disable Parameters/Groups

PanagiotisCharalampous said: 

Hi there,

No there is no such option.

Best regards,

Panagiotis

It would be useful if the Parameter annotations (decorator pattern) could have an additional attribute to configure that, I think.

 

Cheers,

Clark


@Clark22

Clark22
30 May 2024, 18:51

I like new releases. I'll take a look. Thanks!

Can we have a Label attribute added to drawings (such as on trend lines) in the next release please?

I want them to make the drawing identifiable on the chart, and also to use them to direct different trading strategies.

 

Cheers,

Clark

 


@Clark22

Clark22
27 May 2024, 15:57 ( Updated at: 28 May 2024, 05:39 )

RE: RE: RE: Stop() Asynchronous?

PanagiotisCharalampous said: 

Clark22 said: 

Spotware said: 

Hi there,

This is an expected behavior when programming in .Net. If you want to break an execution immediately, throw an exception.

Regarding the Promise/Future question, read below

https://stackoverflow.com/questions/70992438/how-to-control-c-sharp-task-async-await-in-same-way-as-javascript-promise

Best regards,

Panagiotis

Hi Panagiotis,

 

Are you saying that the TradeResult is a Task type?

Also, regarding the Stop() method behaviour. It's not listed as Async even though it behaves as such.

 

Cheers,

Clark 

Hi Clark,

Are you saying that the TradeResult is a Task type?

TradeResult is a type on its own

Also, regarding the Stop() method behaviour. It's not listed as Async even though it behaves as such.

It's not Async, the execution is stopped after the calling method has been executed too. If you don't want to execute the code after the Stop() method, you need to rethink your implementation.

Best regards,

Panagiotis

Understood. Thanks 👍 


@Clark22

Clark22
27 May 2024, 11:10 ( Updated at: 27 May 2024, 11:23 )

RE: Stop() Asynchronous?

Spotware said: 

Hi there,

This is an expected behavior when programming in .Net. If you want to break an execution immediately, throw an exception.

Regarding the Promise/Future question, read below

https://stackoverflow.com/questions/70992438/how-to-control-c-sharp-task-async-await-in-same-way-as-javascript-promise

Best regards,

Panagiotis

Hi Panagiotis,

 

Are you saying that the TradeResult is a Task type?

Also, regarding the Stop() method behaviour. It's not listed as Async even though it behaves as such.

 

Cheers,

Clark 


@Clark22

Clark22
27 May 2024, 11:03 ( Updated at: 27 May 2024, 11:05 )

RE: Optimisation Not Working

PanagiotisCharalampous said: 

Hi there,

Please share with us your cBot code and all the relevant optimization settings so that we can reproduce the issue.

Best regards,

Panagiotis

It also failed after 1 hour with the screen open although the screen wasn't black it was frozen.

It's not bot specific so I'm sure you can reproduce it with any bot code from the samples, and I'm sure you can understand that it's not always possible to share code. Mine manages X number of runs over a 1 year period, placing approx. 600 trades. and after about an hour it freezes up, running in Genetic mode against tick data.

It's frozen with another bot also, handling 70 trades over 3 months. 

From my user perspective, the optimisation feature doesn't work, which is a pity as it would be very useful.

What about anyone else's experiences?

 

Cheers,

Clark


@Clark22

Clark22
27 May 2024, 10:49

RE: Cancelled Order Identification Problem

PanagiotisCharalampous said: 

Hi Clark,

You can keep track of which orders you are cancelling yourself by keeping them in a collection on the client side. Then you can check if the cancelled order exists in your collection or not.

Best regards,

Panagiotis

Panagiotis 

Thanks Panagiotis, yes I decided to use async and count bot cancellations in the callback, which helps. But I would still like to see events for server cancellations and manual cancellations. When a StopLimitOrder isn't filled because the price is outside of range then there's no event or log. It's just another cancellation.


@Clark22

Clark22
24 May 2024, 20:19 ( Updated at: 26 May 2024, 06:44 )

RE: Stop() Asynchronous?
PanagiotisCharalampous said:

Hi there,

Can you share some code and instructions to reproduce this behavior?

Best regards,

Panagiotis

 

Please see below for the Stop() (it uses an underlying Executor Service so it seems async and behaves as async as per the output). 
 

I am also interested to know how to handle the Async calls for executing orders. Are the return types a Promise/Future? I have issues with the bot prematurely meeting exit conditions when using those calls which only return after the bot has shutdown.

I don't want to await each of them immediately (making them synchronous), but rather check up on them later (before stopping).

 

Cheers,

Clark

 

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

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None, AddIndicators = true)]
    public class StopTest : Robot
    {
        [Parameter(DefaultValue = "Hello world!")]
        public string Message { get; set; }

        protected override void OnStart()
        {
            // To learn more about cTrader Automate visit our Help Center:
            // https://help.ctrader.com/ctrader-automate
            
            Stop();
            Print(Message);
        }

        protected override void OnTick()
        {
            // Handle price updates here
        }

        protected override void OnStop()
        {
            // Handle cBot stop here
        }
    }
}

24/05/2024 20:08:30.031 | Info | CBot instance [StopTest, AUDCAD_SB, h1] started.
24/05/2024 20:08:30.094 | Info | Hello world!
24/05/2024 20:08:30.140 | Info | CBot instance [StopTest, AUDCAD_SB, h1] stopped.

@Clark22