Interest Rate Parity JS
A library to calculate forward rate considering interest rate parity in Node.js
Installation
npm install --save interest-rate-parity
Usage
ES5
var forwardRate = require('interest-rate-parity').forwardRate;
var spotExchangeRate = 0.78;
var audInterestRate = 0.018;
var usdInterestRate = 0.01;
var timePeriod = 1;
var rate = forwardRate(spotExchangeRate, audInterestRate, usdInterestRate);
console.log('Forward rate of AUD/USD considering the Interest Rate Parity is ' + rate);
ES6
import { forwardRate } from 'interest-rate-parity'
const spotExchangeRate = 0.78;
const audInterestRate = 0.018;
const usdInterestRate = 0.01;
const timePeriod = 1;
const rate = forwardRate(spotExchangeRate, audInterestRate, usdInterestRate);
console.log('Forward rate of AUD/USD considering the Interest Rate Parity is ' + rate);
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
Copyright (c) 2016 Supasate Choochaisri
Licensed under the Apache License.