TrueFX

The TrueFX API client for Crystal. Read TrueFX for more information.

Installation

Add this to your application's shard.yml:

dependencies:
  truefx:
    github: tonkla/truefx

Usage

TrueFX provides a price feed of these ten paris by default,
EUR/USD, USD/JPY, GBP/USD, EUR/GBP, USD/CHF, EUR/JPY, EUR/CHF, USD/CAD, AUD/USD, GBP/JPY

require "truefx"

feed = TrueFX::Feed.new

Get tick of the specific pair

feed.get("EUR/USD")

Results in JSON string

"[{\"symbol\":\"EUR/USD\",\"timestamp\":1485416232386,\"bid\":1.0737,\"offer\":1.07374,\"high\":1.07363,\"low\":1.07661,\"open\":1.0754,\"spread\":0.4}]"

Get tick of more specific pairs, separate by comma

feed.get("EUR/USD,USD/JPY")

Get ticks of all default pairs

feed.get

Authorized session can access to more minor pairs. Register

AUD/CAD, AUD/CHF, AUD/JPY, AUD/NZD, CAD/CHF, CAD/JPY, CHF/JPY, EUR/AUD, EUR/CAD,
EUR/NOK, EUR/NZD, GBP/CAD, GBP/CHF, NZD/JPY, NZD/USD, USD/NOK, USD/SEK

feed = TrueFX::Feed.new(username: "USERNAME", password: "PASSWORD")
feed.get("AUD/JPY")

Contributing

  1. Fork it ( https://github.com/tonkla/truefx/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors