Calculate Volume size based on Account Balance Risk %, SL Pip Value and Symbol Pip Value

Created at 17 Apr 2023, 14: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!
CT

ctid5696420

Joined 17.02.2023

Calculate Volume size based on Account Balance Risk %, SL Pip Value and Symbol Pip Value
17 Apr 2023, 14:20


Hi,
I want to calculate Volume using the below formula ,but I am facing ths Error "errorCode": "TRADING_BAD_VOLUME", "ctidTraderAccountId": "12345", "description": "Order volume 80.00 is smaller than group minVolume=1000.00"
 

TradeVolume=AccountBalance * RiskPercentageForTrade
var TradeVolume =TradeAmount / (StopLossDistance in pips * Symbol.PipValue)

 

I need to Convert this TradeVolume With Respect to lots size of Symbol , is there any way how to do this ?

Thanks

 


@ctid5696420
Replies

PanagiotisChar
18 Apr 2023, 09:39

Hi there,

Try wrapping the volume with the Symbol.NormalizeVolumeInUnits() method.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar

ctid5696420
18 Apr 2023, 09:49

RE:

PanagiotisChar said:

Hi there,

Try wrapping the volume with the Symbol.NormalizeVolumeInUnits() method.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

I am Using Open API and C#, will this Symbol.NormalizeVolumeInUnits() method  works the same ?

Thanks


@ctid5696420