Topics
Replies
Balena
15 Mar 2014, 05:59
RE: RE:
Balena said:
Cerunnos said:
Hi. I'm using a parallel system consisting of a demo and live account. If the demo robot (seperate cAlgo instance) is successfull, a boolean variable will be set to true and the live robot will be unlocked. The communication between the robots is done over robolink (very simple - just a few lines of code are necessary), but you can also write a value into text file with StreamWriter and read it from the other robot with StreamReader. Hope that helps.
thank you for the feedback... can you give me a link to where I can find "robolink"?
thanks again!
I found it... awesome stuff... exactly what I need. Cheers!
@Balena
Balena
15 Mar 2014, 05:49
RE:
Cerunnos said:
Hi. I'm using a parallel system consisting of a demo and live account. If the demo robot (seperate cAlgo instance) is successfull, a boolean variable will be set to true and the live robot will be unlocked. The communication between the robots is done over robolink (very simple - just a few lines of code are necessary), but you can also write a value into text file with StreamWriter and read it from the other robot with StreamReader. Hope that helps.
thank you for the feedback... can you give me a link to where I can find "robolink"?
thanks again!
@Balena
Balena
14 Mar 2014, 21:34
RE:
What would be the simplest way to do it?
Could you please provide an example?
I'm getting good at building bots in calgo, but I'm still pretty new to programming...
So any examples would be greatly appreciated ;-)
Spotware said:
We don't have such functionality and we do not plan to add it in the future.
As a workaround you can run one terminal with live account and another terminal with demo account. Your cbots can communicate with each other using files, interprocess communication, etc.
@Balena
Balena
20 Jan 2014, 09:10
RE:
It seems Account.Equity in Backtesting doesn't include commissions but it does in Live trading... can you clarify?
I use the following logic and I'm getting different results
startingEquity = Account.Equity;
profitTarget = startingEquity + 1000;
fees = ((positionC * 10000) / 1000000) * 85;
IF(Account.Equity - fees > profitTarget)
{
close
}
it seems my if/then above already had commissions (both sides) subtracted from Account.Equity when trading live... but it is not in Backtesting so my profitTarget is triggered differently
can you investigate please?
Spotware said:
Until now the NetProfit property of a Position type variable included commissions one way, that is only the commissions charged upon creating an order. Now, they will include the commissions that will be charged when the position is closed as well.
So, if you had any cBots calculating net profit and subtracted the closing commissions you will need to modify the code otherwise commissions will be subtracted twice.So for instance, if your code calculated the net profit like this:
netProfit = position.NetProfit + position.Commissions;
It will need to be updated to:
netProfit = position.NetProfit;
@Balena
Balena
18 Dec 2013, 04:16
memory problem
it seems there is a major problem with the latest update... everytime I run a robot it sucks up memory and crashes cAlgo.
nothing has changed on my robot, the only change is that I logged out and back into calgo with the latest update
I use this in production... but now I can't trade at all... please respond asap!
@Balena
Balena
17 Dec 2013, 16:59
RE:
Thank you... any help would be much appreciated!
How can I reverse this (from admin below) and read from a text file to bring values back into cAlgo?...
ie...
1. I use the below to pull price data into "txt file A"
2. I pull data from "txt file A" to use in another 3 party application
3. I create "txt file B" from the 3rd party application
4. I pull variables from "txt file B" back into cAlgo to use as logic
I have step #1 below...
I need help with step #4
thanks!
admin said:
You can use the following example if you want to output data to a text file:
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using System.IO;
namespace cAlgo.Robots
{
[Robot]
public class WriteToFileExample : Robot
{
StreamWriter _fileWriter;
double avspread = 0;
double spreadnow = 0;
double sum = 0;
int ticker = 0;
int once = 0;
int counter =0;
protected override void OnStart()
{
var desktopFolder = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);//getting location of user's Desktop folder
var filePath = Path.Combine(desktopFolder, "ServerTimeExample.txt");
_fileWriter = File.AppendText(filePath);//creating file
_fileWriter.AutoFlush = true;//file will be saved on each change
}
protected override void OnTick()
{
_fileWriter.WriteLine("Server Time: " + Server.Time);
}
protected override void OnStop()
{
_fileWriter.Close();
}
}
}
adaled said:
You can read and write to/from files using c#. Do you need help with reading and writing to files?
@Balena
Balena
16 Dec 2013, 23:08
RE: Hi
How can I reverse this and read from a text file in cAlgo...
ie...
1. I use the below to pull price data into "txt file A"
2. I pull data from "txt file A" to use in another 3 party application
3. I create "txt file B" from the 3rd party application
4. I pull variables from "txt file B" back into cAlgo to use as logic
I have step #1 below...
I need help with step #4
thanks!
admin said:
You can use the following example if you want to output data to a text file:
using System; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.Indicators; using System.IO; namespace cAlgo.Robots { [Robot] public class WriteToFileExample : Robot { StreamWriter _fileWriter; double avspread = 0; double spreadnow = 0; double sum = 0; int ticker = 0; int once = 0; int counter =0; protected override void OnStart() { var desktopFolder = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);//getting location of user's Desktop folder var filePath = Path.Combine(desktopFolder, "ServerTimeExample.txt"); _fileWriter = File.AppendText(filePath);//creating file _fileWriter.AutoFlush = true;//file will be saved on each change } protected override void OnTick() { _fileWriter.WriteLine("Server Time: " + Server.Time); } protected override void OnStop() { _fileWriter.Close(); } } }
@Balena
Balena
12 Dec 2013, 21:22
RE:
Hi Lawerance
Did you ever develop a Market Profile indicator?
Lawerance said:
Great platform. Very limited on indicators, but a great platform. I am interested in having a Market Profile indicator (Some have called it a Price Histogram) for the cTrader platform.
I would also like the ability to add on to any open position instead of just opening another order of the same type. ie.. you have an open sell on the EURUSD and you want to add more to your position instead of opening another sell on the EURUSD. That would be great.
Thank you for your time
@Balena
Balena
04 Dec 2013, 06:09
RE: Thanks and ready it is
jeex said:
Spotware said:
The candle is made of the Bid price.
Thanks for the quick response. In that case my indicator is ready. Don't know what it's good for, but it does show information that used to be hidden in the candle. I'll upload it somewhere.
would be better to see where the most volume was executed within the candle vs the price change... and if it was executed at the bid or ask... price changes can be spoofed by HFT strategies and conclusions without careful considerations could be the direct opposite of common logic
@Balena
Balena
15 Mar 2014, 06:18
RE:
Cerunnos said:
I currently tab between demo and live on the same cpu...
So if you don't mind sharing...
1. if I use the RobotLink will it work if I currently tab between demo and live on the same cpu; ie "cpu 1"?
2. do I have to run demo on "cpu 1", and live on "cpu 2"?
Thanks Again!
@Balena