
Info
Username: | ClickAlgo |
Name: | ClickAlgo |
Member since: | 05 Feb 2015 |
Country: | United Kingdom |
About
Signature
Last Algorithm Comments
@Harmonics: 27 Nov 2021, 08:11
Hi, good work. If you want to offer this indicator on our website as a vendor for free just get in touch, I will create a nice marketing page and video. sales@clickalgo.com Paul Clickalgo.com
@Bollinger Bands %B for cTrader: 25 Jan 2021, 08:50
I am really sorry, the link was incorrect, it has been fixed now.
@cTrader WeisWave Volume Indicator (Free): 23 Jan 2021, 18:38
Hi, people, you need to download it below. https://clickalgo.com/ctrader-weis-wave-indicator
@Information Pad: 19 Jan 2021, 20:41
Good work Winson.
@Chart Calendar: 23 Sep 2019, 18:43
Good job Ahmad.
@Harmonic Pattern Scanner - Beta Release: 08 Sep 2019, 20:11
If you have any indicators you wish to sell, why not let us do the marketing for you and do all the selling for you, join our vendor program today. https://clickalgo.com/join-our-vendor-program-trading-software
@Memory Manager Bot: 06 Aug 2019, 18:02
Hi, FireMyst, You are better off posting on the forum, posting on these threads do not alert anyone, I just found this by chance, the product below will free the memory used by the cTrader platform only, it was created to help users with a VPS and where they have backtested which allocates a large amount of memory. https://clickalgo.com/ctrader-cbot-vps-memory-manager
@Clock: 27 Jul 2019, 11:40
Nicely Done.
@GBPCHF Robot By Mountain Solutions: 01 Jul 2018, 07:55
Hi Ceakuk, These robots are supplied by one of our vendors and they did not supply trial versions, but what we have added to protect the customer is a money-back guarentee if the backtest results are not close to what is advertised. Send me an email and i will send you a free copy, so you can see for yourself the backtest results.
@cTrader Automated Collection of cBots: 27 Jun 2018, 07:50
You probably need this. https://clickalgo.com/ctrader-profit-loss-targets
Last Forum Posts
@CT 4.2 - Reverse Order Bug: 17 May 2022, 11:22
Hi,
There seems to be an issue with reversing a trade direction using cTrader beta 4.2, I ran this basic test.
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None)]
public class ReverseTest : Robot
{
[Parameter(DefaultValue = "Hello world!")]
public string Message { get; set; }
protected override void OnStart()
{
ExecuteMarketOrderAsync(TradeType.Buy, SymbolName, 50);
}
protected override void OnBar()
{
foreach (var position in Positions.Where(x => (x.SymbolName == Symbol.Name)).Where(x => x.TradeType == TradeType.Buy))
{
position.Reverse();
}
}
}
}
What happens is that the order opens for BTCUSD with 50 lots, but when the candle closes (1-min TF) and the position is reversed, a notification states that the order was abnormal and attempted to reverse with double the original trade size.
I also tried ReversePosition(position), and had the same issue.
This works ok with 1 lot
@Illegal call out of MainThread is detected. Use `BeginInvokeOnMainThread`: 16 May 2022, 16:36
Ahmad, is correct, we should be implementing the calls with more grace, the following call fixes the warning messages and works fine with CT 4.2
private void btnReverseSellers_Click(object sender, EventArgs e)
{
_robot.BeginInvokeOnMainThread(() =>
{
try
{
foreach (var position in _robot.Positions.Where(x => (x.SymbolName == _robot.Symbol.Name)).Where(x => x.TradeType == TradeType.Sell))
{
position.Reverse();
}
}
catch (Exception ex)
{
AlertPopUp msg = new Orders.AlertPopUp(ex.Message);
msg.Show();
}
});
}
@Illegal call out of MainThread is detected. Use `BeginInvokeOnMainThread`: 16 May 2022, 12:34
I have found the offending code that is causing this error, this will happen to a few of our products.
Leverage = robot.Account.PreciseLeverage
The robot object is passed into the assembly class that displays the UI, all the other events work fine, but when a call is made to retrieve account information, it throws the error below.
Illegal call out of MainThread is detected. Use `BeginInvokeOnMainThread`
@Illegal call out of MainThread is detected. Use `BeginInvokeOnMainThread`: 16 May 2022, 11:37
ok, thank you for your time.
@Illegal call out of MainThread is detected. Use `BeginInvokeOnMainThread`: 13 May 2022, 14:21
All of our products at ClickAlgo use a standard threading model to open a UI form as shown below, this has been working fine for many years.
cTrader Desktop 4.2 Beta
try
{
thread = new Thread(() =>
{
try
{
bootStrap = new Bootstrap(this);
System.Windows.Forms.Application.Run(bootStrap.mainPanel);
}
catch
{
}
});
thread.SetApartmentState(ApartmentState.MTA);
thread.IsBackground = true;
thread.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Stop();
}
The only difference was that we were using an STA thread.
Now with cTrader Desktop 4.2, a warning is thrown stating that it is an illegal call out from the main thread and that we need to now use BeginInvokeOnMainThread
Is this now the only option we have for spawning a user interface?
A test using the new method is shown below which works fine, but there is an issue with events from the robot object passed across.
BeginInvokeOnMainThread(() =>
{
try
{
bootStrap = new Bootstrap(this);
System.Windows.Forms.Application.Run(bootStrap.mainPanel);
}
catch
{
}
});
I understand the warning, but does this mean we need to update all of our products to suppress this warning?
UPDATE
If the BeginInvokeOnMainThread method is used and a Robot object is passed in, many events are not working or work sometimes like closing positions Async.
@Debug using Visual Studio 2022: 08 Apr 2022, 10:51
This step-by-step guide should help.
https://ctrader.info/d/442-how-to-debug-a-cbot-using-visual-studio-2022
@Debug using Visual Studio 2022: 07 Apr 2022, 14:12
This may also help, please correct if incorrect amusleh.
@cTrader Beta 4.2 Threading Issue: 03 Apr 2022, 17:24
Hi Team,
After testing a few of our products that use a custom UI with Windows Forms and Syncfusion it looks like v4.2 of cTrader now uses multithreading or a different threading model than the one before, many of our products call the UI's using a single apartment thread, this no longer works in 4.2 and an error message states we should use BeginInvokeOnMainThread
Our current method of calling an STA application is:
.
.
This has worked very well for all applications over the past 5-years or more with no memory leaks or performance issues on the platform.
.
PROBLEM
The problem is that the platform throws the BeginInvokeOnMainThread error and no data is being returned from the passed in Robot object, so no data gets updated, in the example above if the STA model is used the OnPositionsOpened method never gets used.
.
POSSIBLE SOLUTION
We have found a possible workaround to call the UI components using the following block of code.
.
.
This works fine apart from any ActiveX or STA controls on the form.
.
AREAS OF CONCERN
I am sure many vendors have also used the STA model to call applications to run on the cTrader platform, we could go through all our products and get them working for v4.2 with the BeginInvokeOnMainThread call and we would have to test each product on both 4.1 and 4.2 so the next update is seamless to the customer.
My question is is it possible to offer backward compatibility for the previous single threading apartment calls or do all vendors need to update their code for the new multi-threading model?
If you could treat this with urgency as it would be good to have a solution before v4.2 starts to be rolled out to brokers.
@PRICE ALERT MODIFICATIONS: 02 Apr 2022, 11:10
This will send Telegram alerts to your mobile phone if you install the Telegram app.
@non-standard timeframes and stop loss calculation: 28 Mar 2022, 09:30
Hi, we have a few tools for setting your risk.