allow a coded demo/live switch for forward testing/live trading

Created at 13 Mar 2014, 23:11
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
BA

Balena

Joined 17.12.2012

allow a coded demo/live switch for forward testing/live trading
13 Mar 2014, 23:11


i currently run a bot in "demo" and then manually switch to "live" when I deem the conditions ideal for the bot

is there a way, or could it be in the future to either make a way to use code to switch from "demo" to "live" 

or maybe one day be able to add a tag to orders to send them to the "demo" server vs the "live" server and vice versa

is there a way to do this now?

if not would you consider it?

if not do you have an idea for a work around?

I tried to code the bot to run everything in a "sim" mode (calculating & tracking everything as if executed and only executing on the days I deem ideal), but I don't get the same results as if I run it executing every day and filter out the days I don't want


@Balena
Replies

Spotware
14 Mar 2014, 09:02

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.


@Spotware

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

Cerunnos
14 Mar 2014, 22:59

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.


@Cerunnos

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
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, 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

Cerunnos
15 Mar 2014, 09:10

RE: RE:

You only need two different cAlgo instances on an operating system because the API does not allow for switching between accounts. That with the CPU should not matter, but you better inform at Scyware (support@scyware.com )...

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.

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!

 

 

 


@Cerunnos

Balena
19 Mar 2014, 07:16

RE: RE: RE:

One quick question... I have both a demo instance and a Live instance up on same cpu 

when I make changes to one (add a robot, delete a robot, add code, rename, etc) the changes are seen in both instances

so how can I have different robots for each instance?

could you give more details on how you run a parallel system, no logic of course, just can't figure out how to have different robots for each instance

thanks

 

Cerunnos said:

You only need two different cAlgo instances on an operating system because the API does not allow for switching between accounts. That with the CPU should not matter, but you better inform at Scyware (support@scyware.com )...

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.

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

Cerunnos
19 Mar 2014, 08:39

Hi, you need two different robots (for example myRobot_Demo & myRobot_Live) that run on different cAlgo instances. The code is basically the same, but with myRobot_Demo you set a flag (eg condition_ok) to true if the demo Robot makes profit. Now, if condition_ok == true, myRobot_Live is enabled and begins to trade. Hope that helps. You can also contact me in this matter via email: cerunnos32 @ gmx.at ...


@Cerunnos