Topics
Replies
jobenb
12 Feb 2014, 15:06
( Updated at: 21 Dec 2023, 09:20 )
RE:
Spotware said:
We can not reproduce the described problem. Please send us the code code which can show the issue.
Sorry, but I can't share the whole robot for confidentiality purposes, however I can share the piece of code producing the incorrect values:
int i; double minimumQualifyingResearchPipValue = MinimumQualifyingResearchPips * Symbol.PipSize; cAlgo.API.Internals.MarketSeries barSeries = MarketData.GetSeries(TimeFrame.Minute15); i = barSeries.OpenTime.GetIndexByExactTime(DateTime.Parse("09-Jan-14 1:30PM")); double eventOpenPrice = MarketSeries.Open[i]; i = barSeries.OpenTime.GetIndexByTime(DateTime.Parse("09-Jan-14 1:45PM")); double eventClosePrice = MarketSeries.Close[i]; string WhyIsTheAboveNotWorking = "Please fix it!";
The code above is in a private method called from OnTick();
@jobenb
jobenb
26 Jan 2014, 05:32
Good work guys - good work!
I can't wait for fully integrated visual studio support. You guys rock! Thank you for becoming better and better and putting Traders first. The community is definitely noticing and you will win the hearts of more and more Algorithmic Traders around the world, so that we can kick slow evolving MetaTrader out of the game!
@jobenb
jobenb
15 Dec 2013, 04:07
Hi
I have noticed that when you trade very often in an Algo the Equity on the graph is not correct. It does not reflect / update according to the trades made. The trades will show negative equity in the Events during backtesting, however the graph will not reflect this. This is very misleading and can result in someone using an Algo that looks good on the graph but is in fact rubbish.
It is of utmost importance to be accurate when providing statistics and visual indications of how an Algo is performing. How can I now trust that what you tell me is correct?
You have a lot of work to do on your Backtester in terms of:
1. Performance
2. Accuracy
3. Optimization
4. Import of Historical Tick data support.
Please change the priority level of this from low to CRITICAL on your list of things to do. I really like your platform and see a lot of potential in it. I also appreciate the constant updates, however I am a System Trader and currently I cannot really use your product as I would like to and this is very frustrating.
I will also appreciate better integration with Visual Studio, so that I can at least debug my Algos easily. This is a major drawback. Why do you compile to ALGO files, when it is really just a zip wrapper of the actual DLL and why don't you just allow us to drop a DLL that inherit from your base class and you just pick it up via reflection? This will make it easy to attach to the cTrader process for debugging purposes.
Anybody can download Visual Studio Express which is a proper development environment for free and do their algo development in there. Why provide the capability in cAlgo when you don't even provide all the requirements a developer needs? This is VERY FRUSTRATING!
You guys should stop focusing on the mini IDE within cAlgo and rather focus on your Backtester and make that perfect and give us the Visual Studio POWER please!!!!
@jobenb
jobenb
13 Dec 2013, 11:33
Not acceptable
I cannot help but feel that cAlgo is the last priority on Spotware's list, but what they don't realise is that this can really set them apart from the other platforms. I love what they have done so far, but I do expect more from a fully code reviewed agile work environment as theirs. When will these issues be fixed to make cAlgo faster and more efficient?
Please do not leave this for later as I have seen so many projects struggle to fix these issues when left for too late when the memory leak cancer takes over. When something is open, please make sure you close it properly and load / process stuff in batches not all lump sum into memory as is currently the case with your backtester.
@jobenb
jobenb
12 Oct 2013, 05:13
RE: RE:
jobenb said:
Spotware said:
If you like send us the complete code to engage@spotware.com so that we can investigate this.
Hi
Here is the code. I find cAlgo to be a lot of buggy and with quite a few memory leaks. Please fix it.
// -------------------------------------------------------------------------------
//
// BrokenRobot version 1
//
// -------------------------------------------------------------------------------
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.API.Requests;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC)]
public class BrokenRobot : Robot
{
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter("SlippagePips", DefaultValue = 1, MinValue = 0)]
public int SlippagePips { get; set; }
[Parameter("Slow Moving Average Period", DefaultValue = 100, MinValue = 2)]
public int SlowMovingAveragePeriod { get; set; }
[Parameter("Fast Moving Average Period", DefaultValue = 20, MinValue = 1)]
public int FastMovingAveragePeriod { get; set; }
[Parameter("Slow Moving Average Type")]
public MovingAverageType SlowMovingAverageType { get; set; }
[Parameter("Fast Moving Average Type")]
public MovingAverageType FastMovingAverageType { get; set; }
private MovingAverage _slowMovingAverage;
private MovingAverage _fastMovingAverage;
private Position _position;
protected override void OnPositionOpened(Position openedPosition)
{
_position = openedPosition;
}
protected override void OnStart()
{
_slowMovingAverage = Indicators.MovingAverage(Source, SlowMovingAveragePeriod, SlowMovingAverageType);
_fastMovingAverage = Indicators.MovingAverage(Source, FastMovingAveragePeriod, FastMovingAverageType);
}
protected override void OnPositionClosed(Position position)
{
_position = null;
}
protected override void OnTick()
{
}
protected override void OnBar()
{
if (Trade.IsExecuting)
return;
// This does not work
int volume = GetVolume();
// This works
//int volume = 10000;
int lastSlowIndex = _slowMovingAverage.Result.Count - 2;
int prevSlowIndex = _slowMovingAverage.Result.Count - 3;
int lastFastIndex = _fastMovingAverage.Result.Count - 2;
int prevFastIndex = _fastMovingAverage.Result.Count - 3;
double currentSlowMa = _slowMovingAverage.Result[lastSlowIndex];
double currentFastMa = _fastMovingAverage.Result[lastFastIndex];
double previousSlowMa = _slowMovingAverage.Result[prevSlowIndex];
double previousFastMa = _fastMovingAverage.Result[prevFastIndex];
bool isLongPositionLastOpened = _position != null && _position.TradeType == TradeType.Buy;
bool isShortPositionLastOpened = _position != null && _position.TradeType == TradeType.Sell;
if (currentFastMa > currentSlowMa && previousFastMa <= previousSlowMa && !isLongPositionLastOpened)
{
Trade.Send(new MarketOrderRequest(TradeType.Buy, volume)
{
Label = "r1",
SlippagePips = SlippagePips
});
Trade.ModifyPosition(_position, Symbol.Bid - 20 * Symbol.PointSize, Symbol.Bid + 20 * Symbol.PointSize);
}
if (currentFastMa < currentSlowMa && previousFastMa >= previousSlowMa && !isShortPositionLastOpened)
{
Trade.Send(new MarketOrderRequest(TradeType.Sell, volume)
{
Label = "r1",
SlippagePips = SlippagePips
});
Trade.ModifyPosition(_position, Symbol.Bid + 20 * Symbol.PointSize, Symbol.Bid - 20 * Symbol.PointSize);
}
}
private int GetVolume()
{
return (int)((Account.Equity * 100) * 0.01);
}
}
}
Also using Account.Balance instead of Account.Equity produces a similar outcome. To me it seems as a thread locking issue.
@jobenb
jobenb
12 Oct 2013, 05:08
RE:
Spotware said:
If you like send us the complete code to engage@spotware.com so that we can investigate this.
Hi
Here is the code. I find cAlgo to be a lot of buggy and with quite a few memory leaks. Please fix it.
// -------------------------------------------------------------------------------
//
// BrokenRobot version 1
//
// -------------------------------------------------------------------------------
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.API.Requests;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC)]
public class BrokenRobot : Robot
{
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter("SlippagePips", DefaultValue = 1, MinValue = 0)]
public int SlippagePips { get; set; }
[Parameter("Slow Moving Average Period", DefaultValue = 100, MinValue = 2)]
public int SlowMovingAveragePeriod { get; set; }
[Parameter("Fast Moving Average Period", DefaultValue = 20, MinValue = 1)]
public int FastMovingAveragePeriod { get; set; }
[Parameter("Slow Moving Average Type")]
public MovingAverageType SlowMovingAverageType { get; set; }
[Parameter("Fast Moving Average Type")]
public MovingAverageType FastMovingAverageType { get; set; }
private MovingAverage _slowMovingAverage;
private MovingAverage _fastMovingAverage;
private Position _position;
protected override void OnPositionOpened(Position openedPosition)
{
_position = openedPosition;
}
protected override void OnStart()
{
_slowMovingAverage = Indicators.MovingAverage(Source, SlowMovingAveragePeriod, SlowMovingAverageType);
_fastMovingAverage = Indicators.MovingAverage(Source, FastMovingAveragePeriod, FastMovingAverageType);
}
protected override void OnPositionClosed(Position position)
{
_position = null;
}
protected override void OnTick()
{
}
protected override void OnBar()
{
if (Trade.IsExecuting)
return;
// This does not work
int volume = GetVolume();
// This works
//int volume = 10000;
int lastSlowIndex = _slowMovingAverage.Result.Count - 2;
int prevSlowIndex = _slowMovingAverage.Result.Count - 3;
int lastFastIndex = _fastMovingAverage.Result.Count - 2;
int prevFastIndex = _fastMovingAverage.Result.Count - 3;
double currentSlowMa = _slowMovingAverage.Result[lastSlowIndex];
double currentFastMa = _fastMovingAverage.Result[lastFastIndex];
double previousSlowMa = _slowMovingAverage.Result[prevSlowIndex];
double previousFastMa = _fastMovingAverage.Result[prevFastIndex];
bool isLongPositionLastOpened = _position != null && _position.TradeType == TradeType.Buy;
bool isShortPositionLastOpened = _position != null && _position.TradeType == TradeType.Sell;
if (currentFastMa > currentSlowMa && previousFastMa <= previousSlowMa && !isLongPositionLastOpened)
{
Trade.Send(new MarketOrderRequest(TradeType.Buy, volume)
{
Label = "r1",
SlippagePips = SlippagePips
});
Trade.ModifyPosition(_position, Symbol.Bid - 20 * Symbol.PointSize, Symbol.Bid + 20 * Symbol.PointSize);
}
if (currentFastMa < currentSlowMa && previousFastMa >= previousSlowMa && !isShortPositionLastOpened)
{
Trade.Send(new MarketOrderRequest(TradeType.Sell, volume)
{
Label = "r1",
SlippagePips = SlippagePips
});
Trade.ModifyPosition(_position, Symbol.Bid + 20 * Symbol.PointSize, Symbol.Bid - 20 * Symbol.PointSize);
}
}
private int GetVolume()
{
return (int)((Account.Equity * 100) * 0.01);
}
}
}
@jobenb
jobenb
09 Oct 2013, 12:29
RE:
jobenb said:
Hi
I have a method like so:
private int GetVolume()
{
return (int)((Account.Equity * 100) * 0.01);
}that is called in:
protected override void OnBar()
{
if (Trade.IsExecuting)
return;
int volume = GetVolume();
This result in the robot taking only one trade when backtesting, however if I change the OnBar() to the following it works:
protected override void OnBar()
{
if (Trade.IsExecuting)
return;
int volume = 10000;
Do you know why? I think it is a bug. I look forward to hear from you.
It works meaning that it takes more than just one trade. Seems that something gets locked by calling Account.Equity in OnBar()????
@jobenb
jobenb
08 Oct 2013, 13:27
RE:
geektrader said:
Not really strange as I have developed a system that works perfectly on 14 years (and even 42 years of data) and is making constant money live. And when switching from MT4 to cTrader I would of course like to keep those long backtests. Apart from this it´s also a common approach to optimize on 8 years of data and then test out of sample on the rest. I don´t see why cTrader would not be able to offer backtests for timeranges as long as we want with the option to import our own data. If MT4 can do it, cTrader should be able to do so too (and better hopefully).
I agree fully. It is just taking Spotware too long to implement this deal breaker as part of cAlgo!
In the mean time at least we have MT4 to do long backtests.
@jobenb
jobenb
08 Oct 2013, 13:17
RE: RE:
Spotware said:
Thank you for feedback!
1. There is no way of importing your own historical data set. Huh? Why not!? 2.5 years of data is nowhere near what would be considered enough to be statistically significant. I have my own data. I want to import it. Serious flaw and lack of possibility of cAlgo!
This is true. We are going to provide n ability to use data from external sources.
2. I cannot access Support and Resistance lines drawn on charts in my code! I cannot access chart objects that I place on the chart in my code!? Why not?
We'll have this in mind.
3. I cannot save my chart settings separately to a file that I can pickup in another cTrader. This is last on my list and a nice to have after you have implemented no 1 & 2. ;-)
You can use chart templates for this. Saved templates are stored in Documents\cTrader\Templates folder so you can copy it to any other pc and use the same settings.
Hi
Thank you for your reply. Well done on a great platform so far. Just a few things that need to be ironed out before it is a perfect alternative to MetaTrader 4. Do you know when this feature to import my own data / external data sources will become available?
Thank you!
Kind regards,
Joben
@jobenb
jobenb
07 Oct 2013, 15:25
RE:
cAlgo_Development said:
Thank you for your questions. I'll try to reply.
1. There is no way to download more history.
You can't do anything without data.
We understand it. Right now we released new version that have access to more data (actually 2+ years). Next step that we plan is to provide much more data or implement an ability to youse your own data in backtesting. This question is a high priority quuestion for us.
2. Algos only have access to data from chart they are on.
Why do these platform developers think that an algo is some sort of indicator that you attach to a chart? The fact that they've built a new platform with such limitations is worrying.
This is correct and I completely agree with this. We had historical reasons for this, and now we understand that we wust rework this. Next thing we do in cAlgo is implementing access to data of multiple timeframe and multiple symbols.
3. Algos have to be started manually each time you launch the platform.
Useless.
If we understood correctly, you'd like to be able to restart cAlgo and restart all robot instances that were active before restart automatically. This is a valid request that makes cAlgo more useful in automated environments (for example on VPS hosting). We've just started to work in this direction and suggested feature will be deffinetly implemented.
4. Algos don't have access to the trading history.
Some trading strategies need to know about previous closed positions, in case there were deposits/withdrawals.
This is a "must have" feature. We haven't implemented it by the following reason: We are now migrating to a new trading domain model that will make cTrader more transparent and flexible for traders. We will provide complete information on order execution process. When this new model is delivered we will give access to all this information tin cAlgo.
I agree fully with points raised above. Just we are in October already and no data!
@jobenb
jobenb
07 Oct 2013, 15:19
RE: RE:
jobenb said:
admin said:
Hello again,
I think there was a misunderstanding here or maybe I used the wrong words. What I meant was that this feature is in our list for future development and that it will be available but it will not be available in the next update. I hope this clarifies the above statement.
As far as the platform, we are working very hard to improve it and we are taking user feedback into serious consideration. There have been quite a few updates recently and a few exciting features are comming in the next update. We are constantly making it better and I'm sure that you will not have to wait long before this is your favourite platform. Stay tuned!
Hi Guys. We are in October now and still no way of importing my own data!
I am a Software Developer specialising in C# with more than 10 years of experience and will gladly write a data importation wizard for cAlgo! I really can't wait for that feature to be available.
@jobenb
jobenb
07 Oct 2013, 15:16
RE:
admin said:
Hello again,
I think there was a misunderstanding here or maybe I used the wrong words. What I meant was that this feature is in our list for future development and that it will be available but it will not be available in the next update. I hope this clarifies the above statement.
As far as the platform, we are working very hard to improve it and we are taking user feedback into serious consideration. There have been quite a few updates recently and a few exciting features are comming in the next update. We are constantly making it better and I'm sure that you will not have to wait long before this is your favourite platform. Stay tuned!
Hi Guys. We are in October now and still no way of importing my own data!
@jobenb
jobenb
12 Feb 2014, 15:16 ( Updated at: 21 Dec 2023, 09:20 )
Here is some more pictures...
@jobenb