Topics
Replies
firemyst
12 Aug 2022, 02:43
RE: RE:
Liquidity said:
Thanks! There seems to be a difference in the backtesting results after adding the above code into protected override void OnTick()
Of course there is.
That's because in OnTick, the code is checked with every "tick" that comes in; in "OnBar", the code is only run once when a new bar is started.
@firemyst
firemyst
09 Aug 2022, 03:21
( Updated at: 09 Aug 2022, 03:22 )
RE: RE:
siglotcapital said:
PanagiotisCharalampous said:
Hi siglotcapital,
There is nothing uncrackable but it is not easy to crack a .algo file.
Best Regards,
Panagiotis
Ok if that's the case, you're saying its more difficult to crack .algo file compared to .MQL file right?
Secondly what's now the best method to protect ones file if you don't want it stolen or cracked. I am sure their people who sells their protected Algo files out there and there must be a way they're are protecting it to avoid theft or piracy.
Please kindly enlighten me on the best method to go about this.
You can also run your code through an obfuscator and then compile it into cTrader. This way, if they do manage to crack a .algo file, at least the code would be obfuscated to make it more annoying for them to figur eout.
Also, since Spotware has the necessary keys to decrypt any .algo code files, it'll also make it more difficult for them to "peak" at and understand your source code as well (if you're worried about that)
@firemyst
firemyst
09 Aug 2022, 03:18
RE:
nujazzman said:
Before a new update available in 5/08/2022 no moving average appeared anymore even being enable. How can I fix that? Anybody else with this problem?
If you read the rest of the forums, you would see that a lot of other users are experiencing the same issue.
@PanagiotisCharalampous and his team are looking into it.
@firemyst
firemyst
09 Aug 2022, 03:16
RE: RE:
firemyst said:
amusleh said:
Hi,
Most probably we will support officially Visual Studio 2022 after cTrader 4.2 release.
Is there an official announcement on what versions of Visual Studio are still officially supported? Because there's nothing in this thread:
cTrader Desktop 4.2 Has Been Released!
Bump. @Spotware?
@firemyst
firemyst
07 Aug 2022, 08:38
RE:
PureForm said:
Ok, so I stripped down a working indicator line by line to see what makes it update and found the following workaround.
for (int i=1; i<=500; i++) { double j = Bars.MedianPrices.LastValue - Bars.MedianPrices.Last(i); }
Add this code to the Calculate() function. It seems to wake up the indicator or feeds it bar data.
As you can see this is unnecessary taxing. I haven't found a solution that works with the Initialize() function.
This bug should be fixed ASAP.
You will want to change your code to be more like the following so it's not running through that loop when the markets are open:
if (!Symbol.MarketHours.IsOpened())
{
for (int i=1; i<=500; i++)
{
double j = Bars.MedianPrices.LastValue - Bars.MedianPrices.Last(i);
}
}
And it's completely ridiculous that a version of cTrader would even get released with a bug like this... Spotware definitely needs to fix it asap!
@firemyst
firemyst
06 Aug 2022, 18:29
Same here. Most indicators aren't showing on the charts.
I've submitted a technical report through cTrader and have emailed PanagiotisCharalampous a video capture showing how we try to add indicators and nothing shows on the charts over the weekend when markets are closed.
@firemyst
firemyst
06 Aug 2022, 11:34
RE: RE:
Alfie said:
firemyst said:
Yes.
Good ,
Do you have the code? or logic?
Set a global bot variable called "CountOfTradesToday" = 0;
Set two date/time variables of the "Start time" and "end time" for your day.
Inside your bot's logic:
* check if CountOfTradesToday == 0
* if so, place your trade and increment CountOfTradesToday += 1
* if not, just skip
At end of your defined day, set CountOfTradesToday == 0 again to reset
@firemyst
firemyst
05 Aug 2022, 10:53
You need to submit your suggestions here:
https://ctrader.com/forum/suggestions
This is the forum where Spotware takes suggestions for improving their products.
@firemyst
firemyst
04 Aug 2022, 04:30
( Updated at: 21 Dec 2023, 09:22 )
RE: RE:
kurtisnauss said:
firemyst said:
Bars.ClosePrices[index] > slowMa.Result[index]
This is going to happen on every bar where the close price is greater than the MA. If you have a long uptrend, and are on a small/fast time frame over a long period of back testing, this could happen thousands of times.
For example:
The condition will evaluate to true for every single one of those bars shown above if your slow MA is the yellow line, because the close price is above the MA.
But that's only in theory since we don't have the whole of your code and don't know what else is happening in your bot.
Yes, that makes sense that would be reading and storing data for every bar that is printed.
Therefore, when writing it as in example #1, does that tell it to only read it one time on the initial cross and then waits until the next time we see it crossover?
Yes.
In my above example, it wouldn't happen at all within the screen capture provided.
However, depending on the setting of your MA again, it could still happen quite a few times as shown here from the same chart (just a different MA period):
where you have a (any color) bar that closes below the line followed by a green bar that closes above the line. Those meet the conditions for Example #1.
In this screen capture, I see at least 11 times where that occurs.
@firemyst
firemyst
04 Aug 2022, 04:07
Try this as I believe you need to include/set the headers:
var content = new StringContent(jsonObject.ToString(), Encoding.UTF8, "application/json");
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var result = client.PostAsync(endpoint, content).Result;
@firemyst
firemyst
04 Aug 2022, 03:56
Bars.ClosePrices[index] > slowMa.Result[index]
This is going to happen on every bar where the close price is greater than the MA. If you have a long uptrend, and are on a small/fast time frame over a long period of back testing, this could happen thousands of times.
For example:
The condition will evaluate to true for every single one of those bars shown above if your slow MA is the yellow line, because the close price is above the MA.
But that's only in theory since we don't have the whole of your code and don't know what else is happening in your bot.
@firemyst
firemyst
03 Aug 2022, 11:06
( Updated at: 21 Dec 2023, 09:22 )
RE: RE: Thank alot :)
kuwait007 said:
PanagiotisCharalampous said:
Hi kuwait007,
If your broker does not want to configure this for cTrader, you can try another broker. Here is an example from a broker that offers fractional contracts of 0.01 lots.
Best Regards,
Panagiotis
Many Thanks my friend :)
Pepperstone supports trading 0.1 lots on indices and 0.01 lots for forex.
@firemyst
firemyst
03 Aug 2022, 10:53
( Updated at: 21 Dec 2023, 09:22 )
RE: RE:
albert.isac94 said:
pantheljakob said:
I always have to keep my tablet on to take advanced profits which is really annoying!
I'd love to have the option to preset my trade with advanced take profits and breakeven distance
This functionality is already in cTrader, albeit after you place your order:
@firemyst
firemyst
03 Aug 2022, 06:53
RE:
amusleh said:
Hi,
Most probably we will support officially Visual Studio 2022 after cTrader 4.2 release.
Is there an official announcement on what versions of Visual Studio are still officially supported? Because there's nothing in this thread:
cTrader Desktop 4.2 Has Been Released!
@firemyst
firemyst
02 Aug 2022, 16:08
RE:
Anka Software said:
Hi,
Any way to get symbol type ie forex/index/cash etc?
Regards
Vivek
Maybe create C# HashSet objects calle "forex", "index", "cash" etc. IN each Has object, add the symbols you'll be trading that you would classify as forex, index, cash, etc, respectively.
@firemyst
firemyst
02 Aug 2022, 16:01
RE:
ctid4771555 said:
Hi
Is there any project template for Visual Studio already available to use, or it could be built in the future ?
Thanks
Not sure what you're asking for since if you're using Visual Studio you can easily create your own.
Just go into cTrader, under Automate, create a new indicator/bot, and then click to "edit in Visual Studio".
Why not save that as your template?
@firemyst
firemyst
14 Aug 2022, 19:17
the indicator has 3 parameters, so you need to provide the 3 values in their expected order:
var tsv = Indicators.GetIndicator<TSV>(Length, MaType, MaPeriod);
@firemyst