Topics
Replies
firemyst
12 Jan 2023, 02:50
RE:
Xammo said:
Hi Firemyst
There is another thread about this that I first reported back in September (it started long before that though) and isn't related to renko charts (I don't/have never used them)
Fair enough you didn't see it as when you search the forums here for 'Losing Automate Display' you get nothing but if you put the same search term including cTrader into google it's the first hit and is the only way I can keep finding it again! So basically the search function within these forums does not work properly!
Anyway at least you have been getting replies from Spotware they seem to be totally ignoring the other thread and were saying they couldn't replicate the issue but there are more and more clients having the issue - it is VERY frustrating and disconcerting to trade on a platform that blacks out!
HI @Xammo:
This time around I sent @Spotware the tech info from within cTrader itself, clicking on the "?" icon on the bottom left for "help center", and selecting "report technical issue".
Guess time will tell if they actually manage to find/replicate the issue. At times I feel like the employees at Spotware don't use their own products as to me, setting up cTrader on a VPS and letting it run bots on its own overnight is basic functionality that could be tested and would catch this issue.
@firemyst
firemyst
09 Jan 2023, 03:50
( Updated at: 21 Dec 2023, 09:23 )
RE:
opusensemble said:
How can convert my script that writes in the filesystem, to support NET 6.0 framework?
Since the change to .NET 6.0 I'm getting the following error:
Error CS0619: 'AccessRights.FileSystem' is obsolete: 'The access right is not supported in .NET 6.0 and higher'
Thank you.
By giving the bot "AccessRights.FullAccess" ? Start with the most permissions and work your way backwards :-)
@firemyst
firemyst
09 Jan 2023, 03:47
RE:
ashish.sah.np said:
I'm trying to multiply the Volume for next trade by dividing the factor obtained by ratio of last net loss and a user defined value. But it doesn't seem to increase the volume it just uses the _mult value as 1 always. Can someone provide me the alternative code or any solution.
[Parameter("Average Trade Price (amt)", Group = "Volume", DefaultValue = 2, MinValue = 0.01, Step = 0.01)] public double Invest {get;set;} [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01)] public double Quantity {get;set;} private double _mult=1; protected override void OnStart() { Positions.Closed += OnPositionsClosed; } private void OnPositionsClosed(PositionClosedEventArgs args) { var position = args.Position; if (position.NetProfit < 0) { _mult = Math.Abs((position.NetProfit)/Invest); } else { _mult = 1; } } protected override void OnTick() { var volumeInUnits = (Symbol.QuantityToVolumeInUnits(Math.Round((Quantity*_mult), 2, MidpointRounding.AwayFromZero))); ExecuteMarketOrder(TradeType.Buy, SymbolName, volumeInUnits, "Long",SL,TP); }
First question: is
if (position.NetProfit < 0)
ever true?
Eg, have any of the positions ever had a NetProfit in the code? If so, how do you know? I don't see any logging, and don't know if you've run it with VS to have a breakpoint there to see.
@firemyst
firemyst
09 Jan 2023, 03:44
RE:
j.crowe said:
Hi,
I have looked all over the documentation, so I am not sure this is possible, but is there a way to get news events into a bot? Basically if there is a high impacting news release due I want to shut my trades down and not trade until it is over to protect my account. There is a plugin I can buy from ClickAlgo but I dont want to have to keep loading the data in every 3 months. I just want the bot to run and be able to get the news events coming up with the impact they will have on the price.
Cheers,
Jay
SInce they are now integrated with FXStreet, I would see if FXStreet has any API's you can access:
@firemyst
firemyst
09 Jan 2023, 03:35
RE:
opusensemble said:
I've noticed that the cBots I had for .NET 4.x, no longer build on NET 6.0.
Is there any estimate of how long will the 4.x framework be supported?
If it's going to be discontinued, can Spotware provide a date, similar to what Microsoft does for Windows OS?
Thank you.
Since Microsoft typically supports any .Net version that's included with Windows OS, and right now .Net 4.8 is provided with Windows 11, so it in itself will be support through WIndows 11 life time.
Given that MS will be supporting it, hopefully Spotware will as well.
@firemyst
firemyst
28 Dec 2022, 10:59
( Updated at: 21 Dec 2023, 09:23 )
RE:
Spotware said:
Dear firemyst,
The issue you reported does not seem to be related with the problem reported in the initial post. Let us know if you still get the exception in 4.5.3.
Best regards,
cTrader Team
@SPOTWARE!
It's still happening version 4.5.3.11223, and this time while only running a single cBot instance:
Left a bot alone for 5 hours running on Renko charts and bam! I logged back in to my VPS and the error occurs again.
@firemyst
firemyst
27 Dec 2022, 12:02
( Updated at: 27 Dec 2022, 12:35 )
RE:
Spotware said:
Dear firemyst,
You should use v4.5.3. Let us know if you still have issues with the latest version.
Best regards,
cTrader Team
Thank you for the suggestion.
I'll let you know if I have the same issues afterwards.
@firemyst
firemyst
27 Dec 2022, 11:31
( Updated at: 21 Dec 2023, 09:23 )
RE:
Spotware said:
Dear firemyst,
We are aware of the issue and our team is investigating this.
Best regards,
cTrader Team
Any updates on this @Spotware?
Dec 27, using cTrader version 4.4.23 and it's still happening. It's also affecting cBots! When the chart disappears, the cBots don't seem to execute their code. Of course, I can't check why because the "Log" tab won't show.
@firemyst
firemyst
23 Dec 2022, 09:59
RE:
Spotware said:
Dear firemyst,
The issue you reported does not seem to be related with the problem reported in the initial post. Let us know if you still get the exception in 4.5.3.
Best regards,
cTrader Team
Hello @Spotware:
The problem reported in the initial post is:
"I've noticed multiple times that, after some hours running cBots, cTrader crashes unexpectedly."
And that's exactly what I've reported in the 9th post in this thread, -- that cTrader is crashing after some hours of running cBots. I even posted a screen capture of it.
So how is it not related? The only difference is I'm running cBots on a VPS with Renko charts versus the OP's running on a personal computer with Windows 11.
@firemyst
firemyst
23 Dec 2022, 01:56
( Updated at: 21 Dec 2023, 09:23 )
RE:
Spotware said:
Dear trader,
Unfortunately the log and the exception are not enough to determine the root cause of the issue.
Best regards,
cTrader Team
Team @Spotware, this is happening quite a bit! I can't even leave cTrader running cBots overnight with confidence anymore with it crashing after extended periods.
See below. I'm running 2 bot instances on Renko charts:
:
This is probably related to the issue that I reported here:
At least when that was happening, the bots were still able to run! Now everything just crashes.
We can't send any debug information because when cTrader crashes and I click on the "OK" button above, everything disappears. No chance to send any information.
So, if as you say, "Unfortunately the log and the exception are not enough to determine the root cause of the issue." aren't enough info, then @Spotware also needs to update cTrader to capture such information.
This current issue with cTrader crashing on people while running bots seriously needs to be looked into and fixed.
For me to reproduce, I just start a bot on a VPS (2 core, 4GB memory) running at least 2 instances of the same bot. Then I disconnect from the VPS for at least 8 hours and come back to find the error messages.
@firemyst
firemyst
22 Dec 2022, 14:06
> Does this mean that the data will be sent to the developer of the cBot?
Not necessarily. It depends on what the programmer of the bot programmed. If the programmer wrote code to do so, then yes; if the programmer didn't, then no.
> Are there any data going to the third parties or the maker of the cBot?
Again, there could be. It all depends on what the programmer did.
@firemyst
firemyst
09 Dec 2022, 04:04
I found the best way to play sounds is to use the built in system sounds, and then assign your wave file to the system sound through the Control Panel.
Sample code:
if (AlertSoundToPlay == AlertSoundsOptions.Exclamation)
System.Media.SystemSounds.Exclamation.Play();
else if (AlertSoundToPlay == AlertSoundsOptions.Asterisk)
System.Media.SystemSounds.Asterisk.Play();
else if (AlertSoundToPlay == AlertSoundsOptions.Beep)
System.Media.SystemSounds.Beep.Play();
else if (AlertSoundToPlay == AlertSoundsOptions.Hand)
System.Media.SystemSounds.Hand.Play();
else if (AlertSoundToPlay == AlertSoundsOptions.Question)
System.Media.SystemSounds.Question.Play();
else
System.Media.SystemSounds.Exclamation.Play();
@firemyst
firemyst
24 Nov 2022, 06:07
RE:
alexnikon said:
Dear cTrader, how can I switch to use the Visual Studio 2022?
Have you installed VS 2022? If so, you might need to change your Windows settings for default programs. Eg, right click on your Visual Studio Project or solution file and set VS 2022 as the default application instead of VS 2019, 2017, or whatever you have
@firemyst
firemyst
24 Nov 2022, 06:03
RE:
rgasch said:
Hi,
could someone who knows please clarify what the Supertrend UpTrend() and DownTrend() methods actually return and why the sample code compares them to Bars.LowPrices/HighPrices?
Thank you
This is the sample code I'm referencing:
namespace cAlgo.Robots
{
// This sample cBot shows how to use the Supertrend indicator
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class SupertrendSample : Robot
{
private double _volumeInUnits;private Supertrend _supertrend;
[Parameter("Volume (Lots)", DefaultValue = 0.01)]
public double VolumeInLots { get; set; }[Parameter("Stop Loss (Pips)", DefaultValue = 10)]
public double StopLossInPips { get; set; }[Parameter("Take Profit (Pips)", DefaultValue = 10)]
public double TakeProfitInPips { get; set; }[Parameter("Label", DefaultValue = "Sample")]
public string Label { get; set; }public Position[] BotPositions
{
get
{
return Positions.FindAll(Label);
}
}protected override void OnStart()
{
_volumeInUnits = Symbol.QuantityToVolumeInUnits(VolumeInLots);_supertrend = Indicators.Supertrend(10, 3);
}protected override void OnBar()
{
if (_supertrend.UpTrend.Last(1) < Bars.LowPrices.Last(1) && _supertrend.DownTrend.Last(2) > Bars.HighPrices.Last(2))
{
ClosePositions(TradeType.Sell);ExecuteMarketOrder(TradeType.Buy, SymbolName, _volumeInUnits, Label, StopLossInPips, TakeProfitInPips);
}
else if (_supertrend.DownTrend.Last(1) > Bars.HighPrices.Last(1) && _supertrend.UpTrend.Last(2) < Bars.LowPrices.Last(2))
{
ClosePositions(TradeType.Buy);ExecuteMarketOrder(TradeType.Sell, SymbolName, _volumeInUnits, Label, StopLossInPips, TakeProfitInPips);
}
}private void ClosePositions(TradeType tradeType)
{
foreach (var position in BotPositions)
{
if (position.TradeType != tradeType) continue;ClosePosition(position);
}
}
}
}
The UpTrend() and DownTrend() methods return the values when the Supertrend is in an uptrend or downtrend.
There will be a value for one or the other, but not both, because the SuperTrend can't be in both an uptrend and downtrend at the same time.
@firemyst
firemyst
24 Nov 2022, 05:59
RE:
vvictord said:
Still looking for someone with these skills hehe
All you have to do is similar to the following:
//Create your parameter
[Parameter("Max Num of Open Positions", DefaultValue = 3)]
public int MaxNumberOfAllowedOpenTrades { get; set; }
//And in your code, do the check:
if (Positions.Count <= MaxNumberOfAllowedOpenTrades)
{
//do your stuff
}
else
{
Print ("Too many positions already opened.");
}
@firemyst
firemyst
16 Jan 2023, 08:23
Since you haven't posted all your code, will the while loop ever end? That is, what is "firstDt" set to and will that ever evaluate to true? Or is it just going to continuously load tick data back from the beginning of time because it'll never evaluate to true?
That would explain why it never stops loading and your CPU is at full capacity.
@firemyst