Giter Site home page Giter Site logo

java-forex-quotes's Introduction

Maven Central

java-forex-quotes

java-forex-quotes is a Java library for fetching realtime forex quotes. Any contributions or issues opened are greatly appreciated. Please see the example here.

Table of Contents

Requirements

Known Issues

Please see the list of known issues here: Issues

Installation

The .jar can be found here

Usage

Initialize the client

import com._1forge.java;

//Initialize the client
ForexDataClient client = new ForexDataClient("YOUR_API_KEY");

Get the list of available symbols:

try
{
    Symbol[] symbols = client.getSymbols();

    for (Symbol s : symbols)
    {
        System.out.println(s);
    }
}
catch(Exception e)
{
    System.out.println(e.toString());
}

Get quotes for specified symbols:

try
{
    String[] tickers = {"EUR/USD", "GBP/JPY", "BTC/USD"};
    Symbol[] symbols = Symbol.fromStringArray(tickers);
    Quote[] quotes = client.getQuotes(symbols);

    for (Quote q : quotes)
    {
        System.out.println(q);
    }
}
catch(Exception e)
{
    System.out.println(e.toString());
}

Convert from one currency to another:

try
{
    ConversionResult conversion = client.convert("EUR", "USD", 100d);
    System.out.println(conversion);
}
catch(Exception e)
{
    System.out.println(e.toString());
}

Check if the market is open:

try
{
     MarketStatus marketStatus = client.getMarketStatus();
     if (marketStatus.marketIsOpen)
     {
         System.out.println("The market is open.");
     }
     else {
         System.out.println("The market is closed.");
     }
}
catch(Exception e)
{
    System.out.println(e.toString());
}

Quota used

try
{
    Quota quota = client.getQuota();
    System.out.println(quota);
}
catch(Exception e)
{
    System.out.println(e.toString());
}

Support and Contact

Please contact me at [email protected] if you have any questions or requests.

License and Terms

This library is provided without warranty under the MIT license.

java-forex-quotes's People

Contributors

aditi-mi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

locactus

java-forex-quotes's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.