Volume based on balance

Created at 29 Jun 2020, 12:28
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!
EX

executiveunleashed

Joined 26.06.2020

Volume based on balance
29 Jun 2020, 12:28


Morning, 

I am new to cAlgo and writing my own bots (it's great fun, has to be said). But, because of my lack of experience here and (limited) information online I would love some clarity on an area. I will do my best to explain what I mean, apologies if it isn't 100% clear. 

Is it possible to have a bot open positions with a varied volume based on current balance? 

So... using some easy numbers...

Let's say your starting balance is 10,000. Your bot then knows to open positions at 0.1 lots. 

After a few days your balance is then 11,000. Automatically your bot opens positions at 0.11 lots. 

On the flip side... you lose some and end up at 9,000. Your bot then runs at 0.09 lots. 

Is this sort of thing possible in cAlgo? 

I appreciate your time! 

S


@executiveunleashed
Replies

PanagiotisCharalampous
29 Jun 2020, 12:43

Hi executiveunleashed, 

A cBot will execute an order at the volume you request it to do so. The calculation of the volume is up to you. The API provides you the information about the account's balance through Account.Balance.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

executiveunleashed
29 Jun 2020, 12:46

RE:

PanagiotisCharalampous said:

Hi executiveunleashed, 

A cBot will execute an order at the volume you request it to do so. The calculation of the volume is up to you. The API provides you the information about the account's balance through Account.Balance.

Best Regards,

Panagiotis 

Join us on Telegram

 

I appreciate the quick reply -- thank you! 


@executiveunleashed