Setting Stake When Placing a Trade

Created at 17 May 2024, 10:52
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!
CL

Clark22

Joined 17.05.2024

Setting Stake When Placing a Trade
17 May 2024, 10:52


Hi All,

 

I'm new to this and looking at the API I can see methods for executing orders that accept volume, 

but none that accept stake, and I would like to run cBots against spreadbetting accounts.

Say I want to open order with a stake of $1 per pip. Is spreadbetting supported via automate? How would I do that?

 

Thanks in advance.


@Clark22
Replies

Clark22
18 May 2024, 20:48 ( Updated at: 19 May 2024, 05:16 )

It's okay. I came to realise (with the help of CoPilot) that Symbol.PipValue is already calculated in the actual Account Currency.

So I can just do:

double stakeAsVolume = CashAmount / Symbol.PipValue;

 

Thanks.


@Clark22