Topics
Replies

firemyst
03 Jun 2024, 13:09 ( Updated at: 04 Jun 2024, 05:26 )

RE: RE: RE: My ctrader freeze when i'm using my cbot

PanagiotisCharalampous said: 

firemyst said: 

PanagiotisCharalampous said: 

Hi guys,

Thank you for contacting Spotware. If you are looking to delete your demo accounts, you can  use the link below. Please make sure you have closed all your positions and canceled all your orders before deleting your accounts.

https://id.ctrader.com/my/settings/accounts

You can use the link below to delete your cTrader ID. Note that in order to delete your cTrader ID, all your accounts need to be deleted first.

https://id.ctrader.com/my/settings/credentials 

Best regards, 


 

You didn't respond to the poster's concerns about cTrader and cBots freezing on users. Is @Spotware actually aware of and investigating this issue? 

Or do you need to see a video of it happening?

Hi firemyst,

Sorry I responded to the wrong post. Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.

Best regards,


 

 

I have sent an email to community @ spotware with a private youtube link where the issue can be viewed, steps on how to reproduce, and a zip archive with an algo file, cs file, cbotset file, and a README file with all the information that should be needed to reproduce. 

Strong suggestion: I would have some overlapping logger going on, because when cTrader freezes, it's toast. There's no way to get into anything in it, including any logging tabs or other areas. 


@firemyst

firemyst
03 Jun 2024, 12:41 ( Updated at: 04 Jun 2024, 05:26 )

RE: RE: RE: My ctrader freeze when i'm using my cbot

PanagiotisCharalampous said: 

firemyst said: 

PanagiotisCharalampous said: 

Hi guys,

Thank you for contacting Spotware. If you are looking to delete your demo accounts, you can  use the link below. Please make sure you have closed all your positions and canceled all your orders before deleting your accounts.

https://id.ctrader.com/my/settings/accounts

You can use the link below to delete your cTrader ID. Note that in order to delete your cTrader ID, all your accounts need to be deleted first.

https://id.ctrader.com/my/settings/credentials 

Best regards, 


 

You didn't respond to the poster's concerns about cTrader and cBots freezing on users. Is @Spotware actually aware of and investigating this issue? 

Or do you need to see a video of it happening?

Hi firemyst,

Sorry I responded to the wrong post. Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.

Best regards,


 

I can't do the trouble shooting information. cTrader COMPLETELY freezes. The only way to do anything is to kill it in task manager. 

That's the problem. Something in this latest release causes it to complete freeze up, yet leaving the rest of the computer responsive.

I will post a video. 


@firemyst

firemyst
03 Jun 2024, 10:25 ( Updated at: 03 Jun 2024, 10:53 )

RE: My ctrader freeze when i'm using my cbot

PanagiotisCharalampous said: 

Hi guys,

Thank you for contacting Spotware. If you are looking to delete your demo accounts, you can  use the link below. Please make sure you have closed all your positions and canceled all your orders before deleting your accounts.

https://id.ctrader.com/my/settings/accounts

You can use the link below to delete your cTrader ID. Note that in order to delete your cTrader ID, all your accounts need to be deleted first.

https://id.ctrader.com/my/settings/credentials 

Best regards, 


 

You didn't respond to the poster's concerns about cTrader and cBots freezing on users. Is @Spotware actually aware of and investigating this issue? 

Or do you need to see a video of it happening?


@firemyst

firemyst
02 Jun 2024, 12:07 ( Updated at: 03 Jun 2024, 05:09 )

I have the same issue with cTrader freezing completely and being totally unusable. For me, it always occurs on Renko Charts. 

Other users have reported this issue as well, so we're not alone:

https://ctrader.com/forum/ctrader-algo/44016

https://ctrader.com/forum/ctrader-support/43974

 

I've made a video showing the issue, and will try to email Spotware soon showing the problem when I can upload the video to YouTube.


@firemyst

firemyst
02 Jun 2024, 12:06 ( Updated at: 03 Jun 2024, 05:09 )

I have the same issue with cTrader freezing completely and being totally unusable. For me, it always occurs on Renko Charts. 

Other users have reported this issue as well, so we're not alone:

https://ctrader.com/forum/ctrader-algo/44014

https://ctrader.com/forum/ctrader-support/43974

 

I've made a video showing the issue, and will try to email Spotware soon showing the problem when I can upload the video to YouTube.


@firemyst

firemyst
02 Jun 2024, 12:06 ( Updated at: 03 Jun 2024, 05:09 )

I have the same issue! For me, it always occurs on Renko Charts. 

Other users have reported this issue as well, so we're not alone:

https://ctrader.com/forum/ctrader-algo/44014

https://ctrader.com/forum/ctrader-algo/44016

I've made a video showing the issue, and will try to email Spotware soon showing the problem when I can upload the video to YouTube.


@firemyst

firemyst
31 May 2024, 05:58 ( Updated at: 31 May 2024, 08:09 )

RE: RE: Position average price triggers

MongolTrader said: 

f

Please tell me how to add filter when label starts with some prefix when i try use startswith function it gives error as like as below.

AveragePips = Positions.Where(x => x.Label.StartsWith(Name)).Average(y => y.Pips);

Error message is → | Crashed in OnBarClosed with NullReferenceException: Object reference not set to an instance of an object.

 

When you place an order, you can create a “label” for the order. Example:

https://clickalgo.com/ctrader-market-orders

 

Your code will crash because if there's no label, “Label” will be null. Also, if you have no position, you're telling the code to look through the Positions collection, which will be null. So you need to check to make sure you actually have at least one open position first.


@firemyst

firemyst
29 May 2024, 07:12

RE: RE: RE: RE: RE: Log window not showing the correct time

PanagiotisCharalampous said: 

I have developed hundreds of strategies and almost all of them need a fixed timezone regardless where the cBot is running.

So just program in something like the following to get the time based on a fixed time zone and compare whatever actions you need that are time based agains the _Dt datetime variable instead. This has been available since .Net 3.5 I think:

Datetime _Dt = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Server.TimeInUtc, "Eastern Standard Time"); //or use DateTime.Now in the API call to get the time if more appropriate

 

Decisions need to be taken at specific times no matter if the code is executed in London, New York or Beijing. 

Then if the programmer isn't going to get time based on a specific time zone, they can have it coded in the bot to look at specific times with the C# UTC setting such as getting the time in UTC time and adding an offset. For example:

//if you know the specific time, add it to UTC
TimeSpan LocalUTCTimeSpanOffset = new TimeSpan(2, 0, 0);
DateTime _Dt = Server.TimeInUtc + LocalUTCTimeSpanOffset;

//or if the user knows what time they want things to happen in a specific time zone:
Datetime _Dt = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, "Eastern Standard Time");
//then just compare _localDt to the specific time they need things to happen

//or the user specifies the timezone in the directive tag as is currently implemented

Using the above, you have the best of both worlds – implementing the above, users can have their bots make decisions at specific times as they see fit regardless of what timezone cTrader or the server is set to and the code is running in; 

when no time zone is provided in the directive and the bots are being run somewhere locally via cTrader, use the timezone the user set in cTrader so those people who travel from Spain (UTC + 2) to London (UTC + 1) to New York (UTC - 4) and back can update their cTrader setting and have the logs and other info with timestamps without having to recompile and redeploy code.

 

 

 

 


@firemyst

firemyst
29 May 2024, 00:15 ( Updated at: 29 May 2024, 05:14 )

RE: RE: RE: Log window not showing the correct time

PanagiotisCharalampous said: 

firemyst said: 

PanagiotisCharalampous said: 

It uses your cBot's timezone. If there isn't one set, it's UTC+0

Well, that's annoying. According to the way it's implemented, if I wanted any cBot to log in local time for the time zones I go through because I travel often, I would have to update, recompile, and redeploy the bot every single time I cross a timezone to update the bot instances with the timezone I'm in? 

Who decided that?! O.M.G. face palm

cTrader can certainly determine if the cBot is running locally (and not in the cloud), and can also determine if there's a timezone set or not.

If I start a cBot on a VPS that's set for my local time zone running an instance of cTrader bot locally (not in the cloud) set to the current timezone I want to use, then why doesn't the bot, by default if no time zone is specified and it's running locally, use the local time zone?! 

It makes more sense to use the timezone the user has selected in cTrader in than a default UTC+0.

 

This is not something that works out of the box, automatic timezone detection needs to be developed. Feel free to post a suggestion in the Suggestions and we will consider it for future releases.

 

This really shouldn't have to be a suggestion. 

Seriously, who releases software so that when a user changes time zones, the user needs to recompile and redeploy their code to pick up the new time zone? 

When a bot is loaded, and before it's started, cTrader should already know if a timezone is specified or not from the bot's header directive. 

If there is none specified, Spotware should read the timezone the user sets in cTrader itself. 

Otherwise, what's the point of having that?

Again, facepalm

 

I'll save Spotware's team 10 seconds with this link:

https://learn.microsoft.com/en-us/dotnet/api/system.timezone.currenttimezone?view=net-8.0


@firemyst

firemyst
28 May 2024, 06:49

RE: Log window not showing the correct time

PanagiotisCharalampous said: 

It uses your cBot's timezone. If there isn't one set, it's UTC+0

Well, that's annoying. According to the way it's implemented, if I wanted any cBot to log in local time for the time zones I go through because I travel often, I would have to update, recompile, and redeploy the bot every single time I cross a timezone to update the bot instances with the timezone I'm in? 

Who decided that?! O.M.G. face palm

cTrader can certainly determine if the cBot is running locally (and not in the cloud), and can also determine if there's a timezone set or not.

If I start a cBot on a VPS that's set for my local time zone running an instance of cTrader bot locally (not in the cloud) set to the current timezone I want to use, then why doesn't the bot, by default if no time zone is specified and it's running locally, use the local time zone?! 

It makes more sense to use the timezone the user has selected in cTrader in than a default UTC+0.

 


@firemyst

firemyst
28 May 2024, 00:13

is this a beta version?

Speaking of issues, look how much more memory this new version requires. I used to be able to run 2 copies of version 4.18 on a VPS with 4GB of ram and still have plenty of memory space left over. 

Now when I start 2 copies of cTrader 5.0.xx on a VPS with 4GB of ram, there's only like 740k of memory left. The VPS hasn't changed, so it can't be blamed on Windows.


@firemyst

firemyst
27 May 2024, 05:47 ( Updated at: 27 May 2024, 11:23 )

RE: RE: How to calculate stop out level?

savetree.eatbeaver said: 

firemyst said: 

Try going through this example:

 

https://help.ctrader.com/trading-with-ctrader/conditions/#fair-stop-out

 

 

Thank you, I know this example, but it doesnt help me.

Lets assume I have 100USD on my account (leverage 1:500). I want to open only one position (LONG) on that account (EURUSD).

And I want this position to be stopped out by the broker when market drops for 20 pips.

How can I calculate size for that position?

 

Using Google? First result for me:

https://www.earnforex.com/forum/threads/how-to-calculate-maximum-position-size-by-stop-out-level-and-margin-leverage.48897/

 

 


@firemyst

firemyst
25 May 2024, 13:37 ( Updated at: 26 May 2024, 06:44 )

Try going through this example:

 

https://help.ctrader.com/trading-with-ctrader/conditions/#fair-stop-out

 

 


@firemyst

firemyst
25 May 2024, 13:32

Well, does the file actually exist there? if not, that's obviously why you're getting that error.


@firemyst

firemyst
20 May 2024, 23:54 ( Updated at: 21 May 2024, 05:35 )

Search for the error and Read the documentation:

 

https://help.ctrader.com/ctrader-algo/compiling/#parameters

 


@firemyst

firemyst
15 May 2024, 14:09 ( Updated at: 16 May 2024, 05:31 )

Have you Googled for samples using C#?

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/advanced/how-to-add-data-to-the-clipboard?view=netframeworkdesktop-4.8

In your cBot, you may need it to have elevated permissions. For example:

 [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]

 


@firemyst

firemyst
03 May 2024, 20:58

Let's start simple. Does your indicator work as expected?


@firemyst

firemyst
03 May 2024, 20:56

The short answer is I don't believe it's possible. Once a cbot starts, it only operates on the current account. That's it.


@firemyst

firemyst
02 May 2024, 16:52

I believe you have to set it for each symbol and it “remembers” your last setting.

So try the following:

  1. switch to your demo account
  2. place an order with the lot size you want for each symbol you are going to trade
  3. switch back to your live account, open up the order window, and see if it remembers the last trade you did.

@firemyst