Calculating Trade Size For Given Risk

Created at 27 Mar 2017, 22:20
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!
PA

paulgmurfin

Joined 27.03.2017

Calculating Trade Size For Given Risk
27 Mar 2017, 22:20


Hi 

I am looking to moe over from metatrader and need to convert a bunch of functions I have written. The main one for now calculates ther trade size based on the amount of risk want to take (e.g. 1%) and the stop distance.

My metatrader call looks like 

double setLots(string SYMBOL,double RISK, double STOPDISTANCE) 

 

 In order to do this how would I

1. gert the current account balance

2. get a rate for a pair that is not the current pair (e.g. GBPJPY if the chart pair is GBPUSD). would this work ok in back testing ?

 

Thanks

 

Paul

p.s. great looking product !!!! 

 

 

 


@paulgmurfin
Replies

kricka
06 May 2017, 21:20

Calculating the risk

To calculate the trade size according to the risk, is not that hard at all in cAlgo. It takes maybe a few extra lines of coding compared to MT4 to get the same result, but it gives a greater flexibility and some advantages as well and more freedom to get the exact result you want out of the code. The API documentation is an excellent source of information to learn from and also all the posts on the forums by some very good programmers, makes it easier to achieve the desired code. Trial and error is the way to go..test and retest until everything falls into place.

RMMRobot.com has cBots that are free to use and download and are coded for the purpose of giving the trader an edge when it comes to the aspect of risk & money managenment of one or several positions, as well as the whole trading account itself. 


@kricka