Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble logging into oanda demo server #3

Open
mwql23 opened this issue Aug 25, 2017 · 0 comments
Open

trouble logging into oanda demo server #3

mwql23 opened this issue Aug 25, 2017 · 0 comments

Comments

@mwql23
Copy link

mwql23 commented Aug 25, 2017

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant