Topics
Replies
firemyst
14 Nov 2024, 00:08
Seems like you're trying to update the code to the bot while the bot is running as per the error message.
Have you actually:
- stopped the running bot
- synced/updated the code
- then restarted the bot?
you don't say you have in your post, and the error message is clearly stating that you need to.
@firemyst
firemyst
12 Nov 2024, 07:51
( Updated at: 12 Nov 2024, 08:08 )
Google it, and you come up with this thread. Read until the end:
https://ctrader.com/forum/cbot-support/2177/
@firemyst
firemyst
12 Nov 2024, 02:10
RE: ChartTrendLines don't get removed from OnDestroy() method when indicator removed from chart
PanagiotisCharalampous said:
Hi firemyst,
Thank you for reporting this. We are investigating.
Best regards,
Panagiotis
Any updates on this? Were they able to reproduce the issue?
@firemyst
firemyst
11 Nov 2024, 08:30
RE: RE: Bid and Ask Candles
Systex said:
firemyst said:
Yes, you are.
First of all, you can choose what lines you want displayed on the chart:
Second, if you write your own code, just get the symbol's “ASK” price or “BID” price depending on what you want to display.
eg: Symbol.Ask
As the topic says I need Bid and Ask Candles
Then as I said, you'll have to write your own code. There is no option to display both bid and ask candles next to each other, or anywhere together, on a chart.
@firemyst
firemyst
09 Nov 2024, 13:50
If you're programming a bot, use the OnBar() method.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class ThirdBarMarketOrderBot : Robot
{
private int barCount;
protected override void OnStart()
{
barCount = 0;
}
protected override void OnBar()
{
barCount++;
Print ("Bar count {0}", barCount);
}
}
}
You can find more about it by googling “calgo onbar”
@firemyst
firemyst
09 Nov 2024, 05:56
( Updated at: 09 Nov 2024, 12:13 )
RE: RE: Two years testing cTrader, and now the troubles of 5.0.40
PanagiotisCharalampous said:
Hi all,
This problem should have been resolved by now. Please restart your cTrader and in case you still experience problems, please send us some troubleshooting information quoting this thread.
Best regards,
Panagiotis
I know you've probably not had the best of weeks but I think Patty's eloquent, insightful and detailed feedback possibly deserved a bit more than your identikit "problem solved" response. Probably unfair of me considering, but at the very least I hope Spotware takes points on board points 1,2,4 and 5 relating more to development process than any particular bug.
In at least the last 7 years I've been on these forums and have seen Panagiotis' responses, I can't recall a time where I've ever seen him do a generic copy/paste of responses like this. Even though it says it's his account, I'm not convinced it's him who actually wrote it. If it is, it's definitely “desperate times, desperate measures” and I'd be a bit disappointed like everyone else.
That aside, you can tell Spotware must be receiving A LOT of bugs and issue complaints with their release that all they can do to keep up is respond with the generic cookie-cutter response as you indicated.
Surely they must realize by now they are screwing up big time and need to get their act sorted?
@firemyst
firemyst
07 Nov 2024, 10:52
Well said overall.
It's quite evident from the string of releases that they have no automated testing procedures in place, nor any dedicated team of testers to review/test releases.
Way too many of these bugs that have been found and affect the application would have been caught doing basic testing if users are experiencing issues within a day of using the software.
Just look at the recent bug I've reported back in May/June with cBots and it's still not resolved. How can anyone trust cTrader to run any bots when there's a huge known bug that's gone unfixed since at least June?!
If there's any leadership at Spotware, they need to dump their people who are responsible for quality control, and some of their developers who should be doing basic unit tests (and catching these issues) to get some people in there who believe they should actually test their software before releasing to the public.
@firemyst
firemyst
05 Nov 2024, 06:09
( Updated at: 05 Nov 2024, 08:02 )
Judging from your charts, are you located in the UK?
That “gap” appears to have happened when the markets start their “reset” window, which causes huge spreads.
Because of that, what you obviously need to do is check the spread on the symbol before doing anything.
//Check the spread
if (Symbol.Spread >= SomePredeterminedAmount)
Print ("Not doing anything! Spread greater than allowed!");
else
{
//Do what you normally would
}
The fact it's the spread can also be confirmed by looking at the “tick” chart for the same time - look how the spread suddenly at least quadrupples:
@firemyst
firemyst
05 Nov 2024, 05:46
( Updated at: 05 Nov 2024, 08:03 )
For Commissions, you can look at these previous threads for guidance:
https://ctrader.com/forum/ctrader-algo/9495/
https://ctrader.com/forum/cbot-support/2395/
https://ctrader.com/forum/connect-api-support/37922/
@firemyst
firemyst
04 Nov 2024, 23:23
RE: ChartTrendLines don't get removed from OnDestroy() method when indicator removed from chart
AlgoCreators said:
I think the OnDestroy function is never executed. There is no such feature in the indicators
I'm not sure where you've been, but OnDestroy() has been there since version 4.2:
@firemyst
firemyst
02 Nov 2024, 11:40
( Updated at: 04 Nov 2024, 06:49 )
RE: RE: RE: RE: RE: Non -executing the OnDestroy() function
PanagiotisCharalampous said:
AlgoCreators said:
Spotware said:
AlgoCreators said:
PanagiotisCharalampous said:
Hi there,
I don't think this was ever working. When the indicator is unloaded and destroyed, all references created by the indicator will do as well, same for the indicator's log. If you want to check this, write in an external file.
Best regards,
Panagiotis
Ok, now there is no way for the indicator to clear the interactive objects it created when it is deleted.
I am not sure what you mean, can you elaborate?
When my indicator is on the chart. Adds objects to the chart, such as rectangles and trend lines
These objects are interactive.
"IsInteractive = true;"
When I remove the indicator from the chart, those objects remain in the chart! If their interactive feature is false, they will be deleted automatically, but as I said, I will turn on their interactive feature.
I want to delete all the objects added to the chart when the indicator is deletedHi there,
Can you share the code you are using to delete the objects so that we can check?
Best regards,
Panagiotis
I posted example code here:
https://ctrader.com/forum/ctrader-algo/45312/
In the OnDestroy method, I set all the objects “IsInteractive” properties back to “false”, and the objects aren't removed from the chart.
@firemyst
firemyst
31 Oct 2024, 00:00
As an added step, you should also obfuscate your code before compiling it. THis way, if someone does manage to decrypt your code, it'll still be hard to figure out.
Visual Studio comes with a free tool as it includes a copy of PreEmptive Protection - Dotfuscator Community, free for personal use. (This free version was previously known as Dotfuscator Community Edition or Dotfuscator CE.)
To begin using Dotfuscator Community from Visual Studio, type dotfuscator
into the Search Box (Ctrl+Q).
@firemyst
firemyst
30 Oct 2024, 23:36
RE: RE: Setting TP and SL in pips not working as expected
mmackay911 said:
firemyst said:
The “takeprofit” parameter in the execute market order is in Pips; you're supplying an actual price.
Replace “takeProfit” in the ExecuteMarketOrder with your parameter “TakeProfitPips”.
OR what you need to do is convert “takeProfit” back to pips as a distance from the current candle close, which seems pointless in this scenario as you have it since TP is measured from the current “close” price when the order is placed.
Thanks @firemyst, changing to TakeProfitPips worked a treat. Your explanation makes perfect sense. Much appreciated.
I wonder if the ExecuteMarketOrder used to be coded to expect the price, rather than pips, since ChatGPT seems to think that's how it works.
Set the pips, and then immediately call:
ModifyTakeProfitPrice()
to set the price if you want to set it by exact price instead of pips.
@firemyst
firemyst
30 Oct 2024, 06:44
( Updated at: 30 Oct 2024, 09:56 )
RE: RE: Managing algo's from a mobile device
withnail3 said:
firemyst said:
Did you try googling for your answer?
This is the first result I got:
https://ctrader.com/forum/ctrader-mobile/43814/
Thanks, I think I tried googling a while back and didn't find much, but your link is the info I was looking for.
It's clear now, I'm using the ctrader app version from a prop firm, it doesn't show the algo option like in the example above.
I think it might only be available in the “Spotware” version of the app.
@firemyst
firemyst
29 Oct 2024, 06:55
Keep in mind that regardless of how Spotware/cTrader calculate the angle, the angle will vary depending on the chart's zoom level horizontally / vertically.
It will also change as more bars appear to the right or if you scroll the chart back to the left as cTrader automatically scales the chart.
@firemyst
firemyst
15 Nov 2024, 03:03
This has already been answered if you Google it:
@firemyst