Topics
Replies
lisabeaney
07 Feb 2024, 08:36
RE: Differences in net profit on screen and in code
PanagiotisCharalampous said:
Hi lisabeaney,
Can you please provide clear steps to reproduce this behavior? We would need cBot code, broker, account type, backtesting parameters and exact moment we should break the execution.
Best regards,
Panagiotis
Hi,
I've emailed over the code and precise steps to reproduce this problem. I just wanted to check that you had received the email and to ask if there was any update.
Many thanks,
Lisa
@lisabeaney
lisabeaney
17 Nov 2023, 17:02
RE: Problem with Historical Data for accurate currency conversion on backtest.
PanagiotisCharalampous said:
Hi Lisa,
Please share with us the cBot code that would allow us to reproduce this problem, as well as the cBot parameters and broker.
Best regards,
Panagiotis
Hi,
If you can let me have your email address I'll send it all through.
Many thanks,
Lisa
@lisabeaney
lisabeaney
14 Aug 2023, 20:17
I've just changed the code to give AccessRights = AccessRights.FullAccess and it now runs the backtest without a problem…
@lisabeaney
lisabeaney
12 Sep 2022, 13:06
RE:
Hi Panagiotis,
I've noticed this on v4.3.12 - I have to set all BOT's and Indicators to FullAccess before they will run.... is this a new requirement or a bug that will be fixed ?
Many thanks,
Lisa
PanagiotisCharalampous said:
Hi Filip,
Can you please send us some troubleshooting information. Please provide a link to this discussion as well.
Best Regards,
Panagiotis
@lisabeaney
lisabeaney
07 Aug 2022, 15:31
RE: Solution is simple
Can you still access your live broker accounts with the version from Spotware ? When I have done this in the past I’ve been limited to a demo account
apataymurat said:
İndicators were not working after last update on my pc.
i simply uninstalled ctrader on my pc
Downloaded version 4.3 direct from spotware website.
Logged into the ctrader with my credentials
Charts and everything came back 100% working.
Everything works fine for now.
Hope that helps.
Murat
@lisabeaney
lisabeaney
04 Aug 2022, 12:15
( Updated at: 21 Dec 2023, 09:22 )
This shows the indicators that should be on screen... including the MACD Crossover that is blank. It was working without a problem until teh most recent update.
@lisabeaney
lisabeaney
04 Aug 2022, 10:26
I have the same problem in the backtesting section of Automate on version 4.2.17. The indicators show up on the Trade section and on the main chart in Automate but they are no longer displayed on the Backtesting tab. I have re-run the back test and they still don't display even though they are listed in the object manager.
@lisabeaney
lisabeaney
16 May 2022, 14:03
RE:
I'm having the same problem so will follow this thread with interest !
ClickAlgo said:
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`
@lisabeaney
lisabeaney
18 Aug 2021, 14:19
RE:
Thank you ! That makes sense knowing how the take profit point is calculated :)
PanagiotisCharalampous said:
Hi Lisa,
This probably happens because of currency conversions. The position's P&L is converted to your account's currency based on the conversion rate of the backtesting's last date. Hence moving the end date back and forth can cause positions having slightly different P&L, resulting to a different overall performance for your execution.
Best Regards,
Panagiotis
@lisabeaney
lisabeaney
08 Jun 2021, 11:31
RE:
PanagiotisCharalampous said:
Hi Lisa,
At the moment, they are not taken into consideration but the feature is in our backlog.
Best Regards,
Panagiotis
Thank you
@lisabeaney
lisabeaney
17 Mar 2021, 16:18
( Updated at: 21 Dec 2023, 09:22 )
RE:
PanagiotisCharalampous said:
Hi Lisa,
I could not reproduce this behavior and we did not make any change to this. Are you sure this is not related to your cBot?
Best Regards,
Panagiotis
It is happening with all our BOTs - this is on IC Markets..
Previously this BOT would have had the full name shown in the Finder Window. It now only shows the short name as shown in the dialog box.
@lisabeaney
lisabeaney
25 Feb 2021, 19:29
( Updated at: 21 Dec 2023, 09:22 )
RE:
PanagiotisCharalampous said:
Hi Lisa,
It seems to be there for me.
Can you send us the relevant screenshot?
Best Regards,
Panagiotis
Mine has definitely gone !
@lisabeaney
lisabeaney
14 Dec 2020, 19:57
RE: RE: RE:
fxctrader said:
lisabeaney said:
paralaxion said:
Hello All,
Is there a simple way to licence a cBot, so i.e. the bot would run only on buyers account or buyers machine?
Thank you
Patrick
Yes, you can read the processor ID and then create a hash code from it. Write it to a text file and then check the contents of that file when your BOT runs...
The problem I've run in to licensing a single account is that people quite often have 2 or 3 demo accounts that they use for testing and then a different account for live trading... it can end up a bit messy !
I've ended up writing a licensing BOT that sends the request through to me and then I email the license code to the user, they copy & paste the code in to the License BOT and re-run it to generate the text file that contains the code. Any other BOTS you write can then check the contents of this file.
Hi Lisa, do you mind to share the source code for your licensing bot? Just need some reference. Many thanks.
Hi,
This is the code I was working with :
// Description : This BOT is used to generate and request License Codes
//
// Author : Lisa Beaney
// Date : 7th January 2020
// 9th February 2020 - Changed to fix Telegram Security
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using Telegram.Bot.Args;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Net;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.GMTStandardTime, AccessRights = AccessRights.FullAccess)]
public class LondonBreakout : Robot
{
[Parameter("BOT Name")]
public string BOTName { get; set; }
[Parameter("Email Address")]
public string EmailAddr { get; set; }
[Parameter("License Key")]
public string LicenseKey { get; set; }
private string SendToHash;
private string HashCode;
//private readonly string BOTName = "CryptoBOT";
private string RequestLicense;
private const string GroupID = "Put your telegram Group ID here";
protected override void OnStart()
{
// License key checks
CheckLicenseKey();
}
private void CheckLicenseKey()
{
bool LicenseMatch;
LicenseMatch = false;
SendToHash = Account.Number + BOTName;
// Generate the hash for the license code
HashCode = MD5_hash(SendToHash);
// Generate the text string to request the license code
RequestLicense = "Email : " + EmailAddr + "\n Acct :" + Account.Number + "\n BOT : " + BOTName + " \n License Code : " + HashCode;
// See if license key file exists
// Read key
String line;
try
{
//Pass the file path and file name to the StreamReader constructor
StreamReader sr = new StreamReader(Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%"), "Documents\\") + BOTName + "-BOT-license.txt");
//Read the first line of text - this should be the license key
line = sr.ReadLine();
//Continue to read until you reach end of file
while (line != null)
{
// Check if this is the liceense code
if (line == HashCode)
{
LicenseMatch = true;
// If the license key is valid we don't need to go any further.
sr.Close();
Print("Valid license found");
Stop();
}
//Read the next line
line = sr.ReadLine();
}
//close the file
sr.Close();
} catch (Exception e)
{
Print("v2 Exception: " + e.Message);
}
// Check if the license key has matched. If it hasn't then send telegram.
if (LicenseMatch == false)
{
Print("v2 License Key invalid - Requesting new license key");
SendTelegramGroup(RequestLicense);
}
else
{
Print("v2 License valid - stopping");
// If the license key matches then we don't need to do anything else
Stop();
}
// Write license Key file
// We will only want to do this if a license key has been entered.
try
{
if (LicenseKey.Length > 0 && LicenseMatch == false)
{
//Pass the filepath and filename to the StreamWriter Constructor
StreamWriter sw = new StreamWriter(Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%"), "Documents\\") + BOTName + "-BOT-license.txt");
//Write the license key
sw.WriteLine(LicenseKey);
//Close the file
sw.Close();
Print("v2 License file created");
}
} catch (Exception e)
{
Print("v2 Exception: " + e.Message);
}
Stop();
}
private void SendTelegramGroup(String TelegramText)
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Print("Send Telegram called");
var bot = new Telegram.Bot.TelegramBotClient("1022852061:AAEV0hzT-i8q_hTi1ZVNFUkc3psJk9WkwKQ");
try
{
//Print("About to send");
bot.SendTextMessageAsync(GroupID, TelegramText);
} catch
{
//Print("Message Failed");
}
}
public static String MD5_hash(string value)
{
StringBuilder Sb = new StringBuilder();
using (var hash = MD5.Create())
{
Encoding enc = Encoding.UTF8;
Byte[] result = hash.ComputeHash(enc.GetBytes(value));
foreach (Byte b in result)
Sb.Append(b.ToString("x2"));
}
return Sb.ToString();
}
}
}
@lisabeaney
lisabeaney
08 Dec 2020, 12:39
RE:
It's not a problem when you start the BOT.... but when you close cTrader without stopping the BOTs first you end up with a disorderly shutdown. The protected override void OnStop() Is not triggered. It would be good to have a warning that you still have BOTs running ( II thought this was something it used to do ??) especially because cTrader won't let you switch accounts with BOTs running you do expect it to warn you when you close the program.
@lisabeaney
lisabeaney
11 Nov 2020, 14:44
RE:
PanagiotisCharalampous said:
Hi Lisa,
In order to help you further, you need to provide me with the complete cBot code.
Best Regards,
Panagiotis
No problem, I'll email it through to you :)
@lisabeaney
lisabeaney
11 Nov 2020, 14:26
RE:
PanagiotisCharalampous said:
Hi Lisa,
The parameter values displayed in the cBot parameters panel are not updated if they are changed from within the code.
Best Regards,
Panagiotis
Hi Panagiotis,
What I'm trying to do is set a variable based initially on the BOT parameter but then updated from the field in the Panel....
ie. take this parameter
[Parameter("Max Buy Positions", Group = "Open Positions", DefaultValue = 8, MinValue = 0)]
public double MaxOpenBuy { get; set; }
public double iMaxBuy, iMaxSell;
Then, when the BOT starts :
protected override void OnStart()
{
iMaxBuy = MaxOpenBuy
}
and then have the iMaxBuy variable updated by the MaxBuy when the user clicks on the "Apply Changes" button.
I know its most probably a really simple thing I'm getting wrong or I've missed but I can't seem to get the iMaxBuy to update !
Many thanks,
Lisa
@lisabeaney
lisabeaney
24 Feb 2020, 11:42
RE:
PanagiotisCharalampous said:
Hi Lisa,
As far as I can see you are using the Genetic Algorithm as an optimization method. GA introduce randomness between executions therefore execution times are not comparable. Can you reproduce the same behavior using Grid search?
Best Regards,
Panagiotis
Hi Panagiotis,
I understand that the times can vary but in all the optimisations that we ran using the GA on v3.6 we never saw the times vary between 4.5 hrs and 18 hrs using the same bot on the same currency pair using the same test parameters.
Just to make it clear we have seen a 400% increase in optimisation times. We are used to seeing variances with the GA but we have never seen variances of this size before.
Unfortunately we can't try running this on the grid method because we don't have access to v3.6 anymore.
Kind regards,
Lisa
@lisabeaney
lisabeaney
24 Feb 2020, 11:16
( Updated at: 21 Dec 2023, 09:21 )
RE:
PanagiotisCharalampous said:
Hi Lisa,
We do not have any other work in progress for this issue. Can you share a cBot that demonstrates this behavior?
Best Regards,
Panagiotis
I'm assuming you would like the BOT with the code included.... what is the best email address to send this through to ?
We have run the optimisation on the same machine on version 3.6 and 3.7 using the same parameters. The times have gone from 4hr 36min to over 18 hours..
@lisabeaney
lisabeaney
24 Jan 2020, 13:24
RE:
paralaxion said:
Hello All,
Is there a simple way to licence a cBot, so i.e. the bot would run only on buyers account or buyers machine?
Thank you
Patrick
Yes, you can read the processor ID and then create a hash code from it. Write it to a text file and then check the contents of that file when your BOT runs...
The problem I've run in to licensing a single account is that people quite often have 2 or 3 demo accounts that they use for testing and then a different account for live trading... it can end up a bit messy !
I've ended up writing a licensing BOT that sends the request through to me and then I email the license code to the user, they copy & paste the code in to the License BOT and re-run it to generate the text file that contains the code. Any other BOTS you write can then check the contents of this file.
@lisabeaney
lisabeaney
07 Feb 2024, 08:36
RE: Differences in net profit on screen and in code
PanagiotisCharalampous said:
Hi,
I've emailed over the code and precise steps to reproduce this problem. I just wanted to check that you had received the email and to ask if there was any update.
Many thanks,
Lisa
@lisabeaney