Topics
Replies

firemyst
18 May 2025, 03:18

Then you need to post it in the “Suggestions” forum and hope they see it. Spotware doesn't come here looking for suggestions since this is a tech support forum


@firemyst

firemyst
14 May 2025, 06:55

Why did you need to post multiple times? This is very basic…


@firemyst

firemyst
14 May 2025, 06:54

Why did you need to post multiple times? This is very basic…


@firemyst

firemyst
14 May 2025, 06:54

Why did you need to post multiple times? This is very basic…


@firemyst

firemyst
14 May 2025, 06:54

Why did you need to post multiple times? This is very basic…


@firemyst

firemyst
14 May 2025, 06:54

Why did you need to post multiple times? This is very basic…


@firemyst

firemyst
14 May 2025, 06:52

If you want to run without the interface, you need to do so on Windows. There appears to be no support for it in Linux.

 

 help . ctrader . com /ctrader-algo/ctrader-cli/


@firemyst

firemyst
14 May 2025, 06:49

Duplicate.

See  /forum/ctrader-algo/47055/


@firemyst

firemyst
13 May 2025, 03:38

Hard code it in there as a parameter and see if that works.

eg: MarketData.GetBars(lTimeFrame, “EURGBP”)

 

If you have a spread-betting account, some times those accounts have slightly different symbol names to indicate they're spread betting.


@firemyst

firemyst
10 May 2025, 11:41

What does the logs say on the output?

Have you tried putting any print statements to see where it gets to?

Have you tried debugging in Visual Studio to see what happens?

What have you tried?


@firemyst

firemyst
10 May 2025, 11:38 ( Updated at: 10 May 2025, 11:39 )

Symbol.MarketHours.IsOpened() is returning true when the market is closed

What symbol market are you looking at and at what time? 

It's returning closed for me on the weekend. 


@firemyst

firemyst
06 May 2025, 00:01

 

  1. Not that I'm aware of. However, you can adjust it somewhat depending on the order you have the plots listed in output. 
  2. Nope. that's a severe limitation with how cTrader stupidly implemented their system. The only way around it is instead of using the “output” feature, you have to draw individual trend-lines for each plot. Then that presents another issue is after about 500 drawing objects on the chart, cTrader's performance significantly degrades. So what I've done is keep track internally of what I draw, and every time a new bar is drawn, I remove all the drawings I had from 200 bars ago. 

Welcome to one of Spotware's many poor architectural designs. 


@firemyst

firemyst
03 May 2025, 06:44

While it may be an issue, why don't you implement a work around yourself?

For instance, on every new trading day, have your bot start its own new log file to write to. 

So you have one log file for every day.

 

I say it “may be an issue” because there are text file size limitations with programs, even in Windows. On Windows 11, Notepad uses the RichEdit control. The size limit was raised to about 1 GB, and attempting to open any file larger than that shows a dialog box suggesting that the user open it with a different text editor. In Windows 10 any Notepad large than 32MB can become unstable. So even if built in windows programs have issues with huge text file log sizes. you should expect other programs to as well.

 

Realistically, if you're logging that much information, you should be checking it regularly and clearing out the logs. Writing to huge log files will slow down any program as it waits for write actions to complete, and with automated trading, every nano-second counts when evaluating tick data.

 


@firemyst

firemyst
03 May 2025, 06:25

Duplicate of /forum/ctrader-support/46987/


@firemyst

firemyst
03 May 2025, 06:24

If you're disconnected from the internet, when your connection comes back cTrader will automatically connect again for you


@firemyst

firemyst
02 May 2025, 08:17

RE: RE: RE: RE: RE: RE: Clipboard.GetText() not working

eynt said: 

These are all too complex, I don't see a reason why a simple copy-paste shouldn't wotk

 

Setting a global static C# variable is took complex? 

All you do is assign it or read it like any other variable. If that's too complex, I'm not sure you should be coding anything.

//To create a "global variable", it should be public and static, and declared in a public static class. 
//In .NET it's a common way to declare constants (e.g. Math.PI), but they're not variables!

public static class EveryoneCanSeeMe
{
    public static string EveryOneCanReadAndModifyMe;
}

 

And as for reading/writing files, the first method below uses just as many lines of code as you need to read/write to the clipboard:

//Method #1 -----------------------
// Writing the string to the file 
File.WriteAllText(yourSavedFilePath, createText); 
  
// Reading the contents of the file 
string readText = File.ReadAllText(yourSavedFilePath); 

//Method #2 -----------------------
//WRite file
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(yourSavedFilePath, false))
{
	sw.Flush();
}

//Read file
if (System.IO.File.Exists(yourSavedFilePath)) 
{
    inputString = System.IO.File.ReadAllText(yourSavedFilePath));
    System.IO.File.Delete(yourSavedFilePath);
}

 

Again, nothing complex about them when you actually try instead of immediately dismissing because it's not how you would like to do it.

 


@firemyst

firemyst
02 May 2025, 06:04

RE: RE: RE: RE: Clipboard.GetText() not working

eynt said: 

I create a button which once clicked gets the text from the clipboard and runs code based on it

 

And that text can't be written to a text file instead and read from there? 

Or copied into a parameter text input field and then the parameter's value read? 

Or set in a global static variable?


@firemyst

firemyst
02 May 2025, 05:55

RE: RE: Clipboard.GetText() not working

eynt said: 

Hi

 

This is the print I got from the code below after copying some text to the clipboard. The a and b prints are working well but not the one of the Clipboard.GetText():

 

02/05/2025 05:46:32.491 | Info | Indicator instance [CopyText, EURUSD, h1] loaded.
02/05/2025 05:46:35.257 | Info | a
02/05/2025 05:46:35.272 | Info | 
02/05/2025 05:46:35.272 | Info | b
 

namespace cAlgo{    [Indicator(IsOverlay = true, AccessRights = AccessRights.FullAccess)]    public class CopyText : Indicator    {        [STAThread]        protected override void Initialize()        {            Print("a");            string text = System.Windows.Forms.Clipboard.GetText();            Print(text);            Print("b");        }        public override void Calculate(int index)        {        }    }}

The Clipboard might not even be available in bots. They do have limitations. Not sure why you'd want access to the clipboard anyway for an indicator?


@firemyst

firemyst
02 May 2025, 00:30

stackoverflow . com /questions/4648718/why-doesnt-clipboard-gettext-work


@firemyst

firemyst
30 Apr 2025, 01:12

If restarting cTrader doesn't fix the issue, then contact your broker as it sounds like they changed pip sizes.


@firemyst