Skip to content

trouble logging into oanda demo server #3

@mwql23

Description

@mwql23

Hello,

My data entries are incorrect for the configuration class. For privacy, I have replaced the characters with 'x'. I can't run the samples as the executions end at the account-related codes. Please help me. Thank you 👍

public class Config {
    private Config() {}
    public static final String URL = "api-fxpractice.oanda.com";
    public static final String TOKEN = "xxx-xxx";
    public static final AccountID ACCOUNTID = new AccountID("xxx-xxx-xxxxxxx-xxx");
    public static final InstrumentName INSTRUMENT  = new InstrumentName("EUR_USD");
}

For AccountUpdateLoop, the program ends here:

public class AccountUpdateLoop {

    public static void main(String[] args) {
        Context ctx = new Context(Config.URL, Config.TOKEN);
        AccountID accountId = Config.ACCOUNTID;

        // Get initial account state
        try {
            AccountGetResponse accountStateResponse = ctx.account.get(accountId);

For TestTradesAndOrders, the program ends here:

    private void runTest() throws ExecuteException, RequestException
    {
        System.out.println("TEST - GET /accounts");
        System.out.println("CHECK 200 - The list of authorized AccoungetInstrumentsts has been provided, expecting "+accountId+" in list.");

        List<AccountProperties> accountProperties = ctx.account.list().getAccounts();

For StepByStepOrder, the program ends here:

public abstract class StepByStepOrder {

    public static void main(String[] args) {
        Context ctx = new Context(Config.URL, Config.TOKEN);
        AccountID accountId = Config.ACCOUNTID;
        InstrumentName tradeableInstrument = Config.INSTRUMENT;

        // EXAMPLE: No parameters
        System.out.println("Make sure we have a valid account");
        try {
            // Execute the request and obtain a response object
            AccountListResponse response = ctx.account.list();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions