Calculating number of instances running at once

Created at 02 Oct 2018, 16:57
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!
WI

willd7781

Joined 18.09.2018

Calculating number of instances running at once
02 Oct 2018, 16:57


im currently coding a cBot that takes account infomation about the current ballance, equity, etc... The bot is designed to work out by its selft how much of the account it is alowed to risk at any one time. however one key component that i am yet to figure out is how to account for more than one instance of the robot running at once. For example if i say that the robots are allowed to risk 20% of the current ballance and there are 4 bots running i wish to have each bot only use 20/4 (5%). Any help on how to go about this would be much appriciated. 

 

Thank you

William Daley

 


@willd7781
Replies

PanagiotisCharalampous
03 Oct 2018, 09:42

Hi William,

A solution would be to store the number of running robots in a file. Then all instances can read and update this file knowing at any time how many instances are running.

Best Regards,

Panagiotis


@PanagiotisCharalampous