Topics
Replies
firemyst
08 Feb 2022, 15:31
RE:
nowewo5508 said:
PS : Is it possible to have the SL and TP choice buttons increase/decrease them by 1/10 of a pip rather than a full pip ? Haven't found how to configure that.
Yes.
Use the "step" attribute in the parameter as long as the parameter is declared as a "double" and not an "int".
Example:
[Parameter("Take Profit", DefaultValue = 15, MinValue = 1, Step = 0.1)]
public double TP { get; set; }
@firemyst
firemyst
08 Feb 2022, 15:22
You're trying to store the value from this:
Indicators.GetIndicator<FDGGCSMA>
which is an "FDGGCSMA" type into the variable "stochFast1", which is defined as an SMA:
private SimpleMovingAverage stochFast1;
We have no idea what you want to do, so the easiest thing to do is change the stochFast1 variable type:
private FDGGCSMA stochFast1;
@firemyst
firemyst
31 Jan 2022, 08:54
RE:
amusleh said:
Hi,
No, you can't, there is no way to re-initialize an indicator programmatically.
Please create a thread under suggestions section for this feature if you want to.
THanks amusleh ,
Just to confirm because maybe we're using different terms, I don't want to reinitialize the indicator per-se -- I just want to be able to display the indicator settings window programmatically. The user could close it without changing anything.
I don't think re-initializing occurs unless a user actually changes a parameter or setting in the pop-up config window before closing it or clicking "okay"?
@firemyst
firemyst
30 Jan 2022, 14:38
( Updated at: 21 Dec 2023, 09:22 )
RE:
PanagiotisCharalampous said:
Hi firemyst,
1) Yes
2) Yes
Best Regards,
Panagiotis
Is there a way, using the built in Dotfuscator tools that come with Visual Studio, to have the files obfuscated before they are compiled into the encrypted calgo files?
I haven't been successful in finding a way to compile a calgo project to a dll, run through the Dotfuscator, and then have it picked up and encrypted into a calgo file.
I know earlier in this thread you said it's pointless to obfuscate encrypted code, but I do have at least 2 clients who would like the code obfuscated regardless of how much cTrader encrypts.
Thank you.
@firemyst
firemyst
30 Jan 2022, 13:27
RE:
PanagiotisCharalampous said:
Hi firemyst,
Happy holidays! From the next update, there won't be any dependencies to the cTrader platform, therefore you will be able to use any IDE for .Net projects you wish.
Best Regards,
Panagiotis
To confirm (or not), will it support indicatror/cbot compilations in 64-bits? Or do we need to keep "any cpu / 32-bit" compilation options?
@firemyst
firemyst
28 Jan 2022, 17:23
RE: RE: RE:
amusleh said:
firemyst said:
Thanks amusleh ,
1) but that means we have what -- a total of 9 locations we can put controls on using the Horizontal/Vertical align parameters? Eg, Halign left valign top; halign right valign middle; etc etc.
2) Otherwise, when you say, "allow user change the location of controls by using indicator/cBot parameters", how do you mean? What parameters would you suggest? The Horizonal/Vertical align as in #1 above? Or something else?
3) And I noticed there appears to be no way to query the chart to see what controls are on the chart like we can query to find what "chart objects" are on the chart?
Hi,
1. No, you can use grids or any other panels, like canvas.
2. Yes, I mean the alignment properties.
3. For now there is no way to query chart controls, you can only add or remove them.
You can open a thread under suggestions section for your point #3 if you want to.
Thank you amusleh ,
That helps immensely.
@firemyst
firemyst
28 Jan 2022, 08:53
RE:
amusleh said:
Hi,
Your cBot/indicator doesn't know about other indicator/cBots controls, so you can't align your controls based on other indicators/cBots controls that are present on the chart.
The only option is to allow user change the location of controls by using indicator/cBot parameters, so he will be able to set the location somewhere that is free from other controls.
Thanks amusleh ,
1) but that means we have what -- a total of 9 locations we can put controls on using the Horizontal/Vertical align parameters? Eg, Halign left valign top; halign right valign middle; etc etc.
2) Otherwise, when you say, "allow user change the location of controls by using indicator/cBot parameters", how do you mean? What parameters would you suggest? The Horizonal/Vertical align as in #1 above? Or something else?
3) And I noticed there appears to be no way to query the chart to see what controls are on the chart like we can query to find what "chart objects" are on the chart?
@firemyst
firemyst
28 Jan 2022, 03:56
RE:
PanagiotisCharalampous said:
Hi freemangreat,
There is no such event at the moment.
Best Regards,
Panagiotis
Are there any plans for this?
We have a Panel control we place on the chart. This panel control can have multiple indicators that add their own button/checkbox/whatever to the panel. When the indicator is deleted from the chart, the whole Panel Control is removed as there appears to be no way to execute code when an indicator is deleted nor does there appear to be any sort of "indicatorremoved" event for the chart so we can tell our panel control to remove the child control that was added by the now-deleted indicator.
@firemyst
firemyst
17 Jan 2022, 15:47
You have yet to mention the specs of the machine or VPS that you're running your cTrader on.
We also have no idea what your bot is doing. What people say vs what code actually does is two different things. For all we know, you could have a massive loop in there somewhere.
Also there is nothing wrong with having 2 isntances of the same bot running on the same symbol, correct?
Correct.
@firemyst
firemyst
14 Jan 2022, 17:04
( Updated at: 21 Dec 2023, 09:22 )
HAve you monitored the computer's performance at all? Eg, how much, if at all, does memory usage go up? CPU usage?
In Windows Task Manager you can "tick" the cTrader process and see exactly how much memory and CPU it's using:
Does your bot or any indicators use a lot of "Print" statements that outputs to the logs? Those suck up lots of memory, which cannot be cleared except to close down cTrader and restart it.
@firemyst
firemyst
09 Jan 2022, 15:46
I'm not sure how you expect anyone to answer or reply to this when you haven't provided any information?
For instance, why do you think the stats are wrong? You say they "should", but you provide no explanation why.
If you're running a back test, you haven't provided any parameters, nor the code that you're running against, so someone can actually see what's going on and tell you why the numbers are as they are.
@firemyst
firemyst
09 Jan 2022, 15:43
A few questions:
1) have you looked in the "Log" tab when your bot is running to see what happens? If there's a crash or something?
2) Have you tried putting any "Print" statements in your code to output information to the log? for instance, how do you know all the following statements ever evaluate to "true" for the order to be opened?
if (UpHigh && UpTrend)
{
if (UpBreak || DownSpring)
{
if (UpKabuti)
{
Open_Buy_Order();
return;
}
}
}
For all you know, all those "if" statements may not be evaluating to true, and thus the "Open_Buy_Order" method is never executed.
So I would try putting in Print statements to log output, so you can see where the code is executing, and if it's even getting to the method to open an order.
@firemyst
firemyst
09 Jan 2022, 15:38
RE: RE:
triccomane said:
I made some progress. I succeeded in getting the two symbols on two different arrays, but I still cannot find a way to subtract each element of the first array to the second one
for (int i = 0; i < Periods; i++) { double close_nasdaq = (MarketData.GetSeries(MarketData.GetSymbol("US TECH 100"), TimeFrame.Daily).Close.Last(i)); Print("nasdaq close price: ", i, " ", close_nasdaq); double close_dowjones = (MarketData.GetSeries(MarketData.GetSymbol("US 30"), TimeFrame.Daily).Close.Last(i)); Print("dowjones close price: ", i, " ", close_dowjones); double downas; downas[i] = close_dowjones[i] - close_nasdaq[i]; //I get an erorr on this line
You're receiving an error on that line because you're treating a variable declared as a "double" as an array.
This is what you need to change that line to:
downas = close_dowjones - close_nasdaq;
which will save the single value.
If you want to keep an array of all the values, then your code needs some work. Here's a rough draft as I'm not in front of an editor:
double[] close_nasdaq = new double[Periods];
double[] close_dowjones = new double[Periods];
double[] downas = new double[Periods];
for (int i = 0; i < Periods; i++)
{
close_nasdaq[i] = (MarketData.GetSeries(MarketData.GetSymbol("US TECH 100"), TimeFrame.Daily).Close.Last(i));
Print("nasdaq close price: ", i, " ", close_nasdaq[i]);
close_dowjones[i] = (MarketData.GetSeries(MarketData.GetSymbol("US 30"), TimeFrame.Daily).Close.Last(i));
Print("dowjones close price: ", i, " ", close_dowjones[i]);
downas[i] = close_dowjones[i] - close_nasdaq[i];
@firemyst
firemyst
29 Dec 2021, 14:49
RE:
PanagiotisCharalampous said:
Hi mh17462,
This is not possible at the moment but a cross broker cTrader is in our future plans.
Best Regards,
Panagiotis
As another follow up @Panagiotis, is it possible to use the same broker's cTrader on one computer with two different accounts (users) at the same time?
Ex: I log into one running version of cTrader from IC Markets on a computer; can my friend, on the exact same computer, launch another instance of cTrader and log into _their_ IC Markets account as well? So we have two instances of cTrader from the same broker, running with two different user logins?
@firemyst
firemyst
28 Dec 2021, 15:20
RE:
PanagiotisCharalampous said:
Hi firemyst,
Happy holidays! From the next update, there won't be any dependencies to the cTrader platform, therefore you will be able to use any IDE for .Net projects you wish.
Best Regards,
Panagiotis
That's awesome and fantastic news.
Thanks for the update @Panagiotis and thanks to your team for going down that route :-)
@firemyst
firemyst
28 Dec 2021, 12:13
RE:
PanagiotisCharalampous said:
Hi Sirinath,
cTrader currently uses .Net Framework 4.0/C# 4.0. It will be upgraded to .Net 6.0/C# 10 in the next update.
Best Regards,
Panagiotis
Happy Holidays @Panagiotis!
As a follow up, in the next update what's the latest version of Visual Studio that will be supported?
@firemyst
firemyst
13 Feb 2022, 05:48
positionsCBS can be null, which is one reason you might be getting the null reference exception.
After all, when you start the bot, there might not be any positions open.
So you need to check if you have any positions:
And if you want to check if a position has a stoploss or not, you need to use p.GetValueOrDefault()
That will return zero if there's no stop loss associated with the position.
So don't do this:
Do this instead:
@firemyst