# How to use Mida with cTrader
A live or demo trading account can be created at of one the many brokers supporting cTrader, for example Pepperstone (opens new window), FxPro (opens new window), Axiory (opens new window), ICMarkets (opens new window) or RoboForex (opens new window).
# Login
How to login into a cTrader account.
import { login, } from "@reiryoku/mida";
const myAccount = await login("cTrader", {
clientId: "...",
clientSecret: "...",
accessToken: "...",
accountId: "...",
});
For more examples, read the documentation.
# Login credentials
A broker account is the first requirement to get started with Mida and cTrader, the second and last requirement is providing a clientId
,
clientSecret
, accessToken
and cTraderBrokerAccountId
.
- Create a cTrader trading account from the broker website
- Visit cTrader Open API (opens new window) and login
- Go to the "Applications" page
- Create a new application
- After the creation, wait for the application to be approved, this may take up to 48 hours
- Pressing "View" under credentials will reveal the
clientId
andclientSecret
of the application - Once the application is activated, go to the "Playground" page
- Make sure to select the "Trading" scope, then press "Get Token" and select your trading account
- After the confirmation, the
accessToken
will be revealed - To retrieve the
cTraderBrokerAccountId
press on "Trading Accounts", thecTraderBrokerAccountId
is the "accountId" revealed in the JSON message
At this point it's possible to use Mida with the authorized broker account.
# Node.js cTrader API
The cTrader API is fully supported by Mida and can be used with all broker accounts through Node.js/JavaScript or other programming languages, read the documentation for more examples.
# Something is not working?
If something is not working as expected, create an issue (opens new window) on GitHub.