Topics
14 Aug 2016, 01:27
 2522
 9
27 Jul 2015, 05:15
 4211
 20
27 Jun 2015, 16:57
 2380
 2
21 May 2015, 02:50
 3119
 2
30 Nov 2014, 01:01
 2737
 5
13 Sep 2014, 18:30
 2938
 3
28 Aug 2014, 01:16
 2736
 1
10 Jul 2014, 05:17
 2688
 2
25 Mar 2014, 18:16
 3350
 4
12 Feb 2014, 20:15
 5185
 5
09 Jan 2014, 05:03
 3207
 5
18 Dec 2013, 02:27
 3437
 6
03 Dec 2013, 07:22
 3609
 10
30 Oct 2013, 16:55
 0
 3087
 3
Replies

Balena
15 Mar 2014, 06:18

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.

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

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
13 Feb 2014, 22:19

1.

can you give a "named pipe" example of how I would let bot 1 tell bot 2 that X = 2

2.

can i do this in a backtest with bot 1 and bot 2?

thanks


@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
18 Dec 2013, 03:10

admin... you need to address this issue

please respond!


@Balena

Balena
17 Dec 2013, 22:47

hello?


@Balena

Balena
17 Dec 2013, 17:59

very cool... thanks!


@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
17 Dec 2013, 06:56

look at 12/16/13

compare demo account backtesting to live account backtesting... the opening price action is different

-Balena


@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
06 Dec 2013, 23:45

I think there is a bug introduced with the api change... either that or a design change that has change how Symbol.Bid & Symbol.Ask is called, returned, or calculated... something is different


@Balena

Balena
06 Dec 2013, 22:33

hi... i just logged out and back in and I still can't sort the Log tab by either Time or Events...

Is it released yet?

 


@Balena

Balena
06 Dec 2013, 22:30

awesome!


@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
03 Dec 2013, 15:39

You should be able to see the difference from 11/28 vs today very easily with my algo... 

What email should I send my code to?


@Balena

Balena
03 Dec 2013, 14:35

I tested on data from November 2013...

so I'm not sure that is the only issue...

have you changed how the ticks are processed at the open?


@Balena