Topics
Replies
ClickAlgo
26 Aug 2015, 23:04
Hi Guys,
I may be missing something, but why can you not run each GetSeries asynchronous using the Task Parallel Library (TPL)? the entire operation should take no longer than the longest call to get the data series.
But I am sure it is not that simple.
Paul.
@ClickAlgo
ClickAlgo
21 Aug 2015, 13:46
RE:
Paul_Hayes said:
try this
var outStream = new FileStream(logfileName, FileMode.Open, FileAccess.Write, FileShare.ReadWrite)
@ClickAlgo
ClickAlgo
21 Aug 2015, 13:40
look at managing opening text file, load the resuts into an object in memory and then closing the connection to text file and releasing the handle on it, this should free up the text file to be used by other programs.
if you keep the handle open, it will be locked.
@ClickAlgo
ClickAlgo
20 Aug 2015, 13:30
RE: RE:
hiba7rain said:
again i will say a big thanks to you and your interaction with me and other users i will reference your indicator to my cbot i just need more elaboration about IsBullish (IsRising) and IsBearish (IsFalling) :)
Paul_Hayes said:
hello again, I am sure you will work it out, you gave me an idea about the HULL average so i extended the original one to include signals:-
/algos/indicators/show/930
Download the latest indicator HMA Signals and the instructions on use with a cBot, read up on the HULL indicator as I mentioned before it will tell you how it is useful with trend.
@ClickAlgo
ClickAlgo
20 Aug 2015, 12:25
I am fixing it now to work with a cBot, will update indicator when its done
@ClickAlgo
ClickAlgo
20 Aug 2015, 11:22
RE: RE:
Paul_Hayes said:
MarsBarsLars said:
Hi,
I'm running a Windows 2012 Server VM with 4GB of ram and 2 processors.
If I run 3 instances of cAlgo at the same time, they eventually consume all the RAM and the hard faults increase until each instance of cAlgo stops responding.
Are there any tips for managing memory?
Lars
Hi Lars,
4 GB is very low for a Windows Server, I use 12 GB alone on my PC as I have charts open, but only 2 GB on my VM as I have 1 instance of cAlgo open with 4 robots running 5 instances each, so 20 instances running automated and I use just over 1 GB RAM.
Try not having the charts open in cAlgo, if you leave the screens maximized, the processor will be working drawing the screen and consuming RAM, so when you have finished fiddling with your settings, minimize all screens and see how much RAM is used with Task Manager.
Do you have 3 instances of cAlgo open as you have 3 accounts running?
Also I almost forgot, it helps to close cAlgo down and restart to reclaim memory, when you restart do not backtest or optimise, do all this on your local pc, just open cAlgo and start robots without charts, this will use the least memory.
@ClickAlgo
ClickAlgo
20 Aug 2015, 10:44
hello again, I am sure you will work it out, you gave me an idea about the HULL average so i extended the original one to include signals:-
/algos/indicators/show/930
@ClickAlgo
ClickAlgo
20 Aug 2015, 09:26
Create a boolean flag which gets set true when the CCI reaches 200 and false when its below 150 then incorporate it into the logic below
cci.Result.IsFalling() && cci.Result.LastValue < 150 // open sell order
you should be able to work the rest out.
@ClickAlgo
ClickAlgo
20 Aug 2015, 09:08
You probably already know this but, look at this extract about the Hull Average which is a trend indicator:-
A shorter period HMA may be used for entry signals in the direction of the prevailing trend. A long entry signal, when the prevailing trend is rising, occurs when the HMA turns up and a short entry signal, when the prevailing trend is falling, occurs when the HMA turns down.
So its common to use the property hull.hma.IsFalling() or hull.hma.IsRising(), I see you strategy compares 2 hull periods and closes positions depending on the period of the first indicator being higher or lower than the last indicator.
Your code snippet just closes any positions it finds, you are not opening any new positions, i recommend that you either:-
- Write the design of your strategy down in a document so that you have for example; a flow chart showing how it will work and then develop your code to match this.
- Post on the job board for someone to write this for you.
Cheers,
Paul.
@ClickAlgo
ClickAlgo
19 Aug 2015, 22:12
hi,
without seeing the code its very hard to see where the problem may be
@ClickAlgo
ClickAlgo
19 Aug 2015, 18:58
take a close look at your user defined parameters, can you see the problem?
@ClickAlgo
ClickAlgo
19 Aug 2015, 12:59
RE:
MarsBarsLars said:
Hi,
I'm running a Windows 2012 Server VM with 4GB of ram and 2 processors.
If I run 3 instances of cAlgo at the same time, they eventually consume all the RAM and the hard faults increase until each instance of cAlgo stops responding.
Are there any tips for managing memory?
Lars
Hi Lars,
4 GB is very low for a Windows Server, I use 12 GB alone on my PC as I have charts open, but only 2 GB on my VM as I have 1 instance of cAlgo open with 4 robots running 5 instances each, so 20 instances running automated and I use just over 1 GB RAM.
Try not having the charts open in cAlgo, if you leave the screens maximized, the processor will be working drawing the screen and consuming RAM, so when you have finished fiddling with your settings, minimize all screens and see how much RAM is used with Task Manager.
Do you have 3 instances of cAlgo open as you have 3 accounts running?
@ClickAlgo
ClickAlgo
19 Aug 2015, 11:39
I think cTrader and cAlgo are young products that need to mature, there will be bugs and issues until it becomes an adult, they first launched in 2011, compared to Meta-trader which launched as early as 2002, Meta-trader has a 9 year head start, there is a lot of promise in cTrader for the future if they listen to the customers and have a better support department.
@ClickAlgo
ClickAlgo
18 Aug 2015, 12:57
They do not support this :-(
I totally agree with you we should have this feature, it would make my life much easier, but I am afraid we must do hack jobs for the time being.
Unless someone else has come up with a better solution, I would be happy to hear it, but cAlgo will not allow complex datatypes, just primitive datatypes like int, float, string etc. and their own object model.
I am off to beach now, bye.
@ClickAlgo
ClickAlgo
18 Aug 2015, 11:46
When you create an instance it is the instance of the symbol, you cannot as far as I know dynamically change this, what what you can do as a workaround is this.
[Parameter("Custom Symbol Name", DefaultValue = "EURUSD")] public string CustomSymbolName{ get; set; }
Symbol symbol = MarketData.GetSymbol(CustomSymbolName);
@ClickAlgo
ClickAlgo
18 Aug 2015, 11:09
[Parameter("Custom Timeframe")] public TimeFrame MyCustomTimeFrame { get; set; }
@ClickAlgo
ClickAlgo
17 Aug 2015, 17:50
Hi,
I am in the process of creating a service to traders using cTrader only and will offer 1-2-1 coaching on writing your own robots in C#, but not just coding I will offer correct design practices so that you can alter and enhance your strategy over time without it turning into a blob of spaghetti, problem is I will charge a very low hourly fee which will buy me a beer.
My profile can be seen here:- https://uk.linkedin.com/pub/paul-hayes/22/b91/644
Paul.
@ClickAlgo
ClickAlgo
26 Aug 2015, 23:26
ok, thanks, but could Spotware confirm that custom threading is not safe with indicators or cBots, i will need to know this for future reference as well as calling GetSeries asynchronously.
Many Thanks,
Paul.
@ClickAlgo