API Host for demo and live account

Created at 17 Mar 2021, 09:41
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!
BU

budda_dan2020

Joined 10.09.2020

API Host for demo and live account
17 Mar 2021, 09:41


Hi,

I want to use demo account AND live account in a c# trading program using Open API.

Should I create 2 ssl stream for demo and live accounts respectively because demo.ctraderapi.com for demo accounts and live.ctraderapi.com is for live accounts?

Can I use demo.ctraderapi.com for live account transactions?

It will make the programing a lot easier.

Thanks in advance.


@budda_dan2020
Replies

amusleh
17 Mar 2021, 10:14

RE:

budda_dan2020 said:

Hi,

I want to use demo account AND live account in a c# trading program using Open API.

Should I create 2 ssl stream for demo and live accounts respectively because demo.ctraderapi.com for demo accounts and live.ctraderapi.com is for live accounts?

Can I use demo.ctraderapi.com for live account transactions?

It will make the programing a lot easier.

Thanks in advance.

Hi,

Open API uses two different hosts for demo and live trading accounts, all API calls of those two different account types are separate and you must create two client connection for each.

You can't use demo connection for live account operations or vice versa.

I strongly recommend you to use our OpenAPI.NET library if you are using Open API on a .NET application.

Our library allows you to send and receive API requests/responses with just few lines of code, also take a look on library console demo app in its repo.


@amusleh