Hello,
As a side to my current main project, this library has emerged.
I hope that some may find it useful in their search for ever increasing RR ratios.
Let this topic be a discussion of the project. Any bug reports or improvements will be welcomed.
I do not have much time, this project will be worked upon alongside my other projects,
and less frequent, yet more concise code in releases is my goal here.
I will endeavor to keep your client code syntax intact.
Best,
Will
Example:
Index
// SETUP
setup($server=Optional, $apiKey=Optional, $userName=Optional, $accountName=Optional)
// DIRECT NETWORK ACCESS
stream($url, $callback)
// ACCOUNT WRAPPERS
account($accountId)
accounts($username)
account_named($accountName, $uName)
account_id($accountName, $uName)
// INSTRUMENT WRAPPERS
instruments()
instrument($pair)
instrument_name($home, $away)
instrument_split($pair)
instrument_pip($pair)
// NAV (NET ACCOUNT VALUE) WRAPPERS
convert($pair, $amount, $homeIndex=0)
percent_nav ($pair, $percent, $leverage=1)
// TRANSACTION WRAPPERS
transaction_all($number=50, $pair="all")
transaction_types($types, $number=50, $pair="all")
transaction_get($transactionId)
// ORDER WRAPPERS
order($orderId)
order_pair($pair, $number=50)
order_open($side, $units, $pair, $type, $rest = Optional)
order_open_extended($side, $units, $pair, $type, $price, $expiry, $rest = Optional)
order_modify($orderId, $options)
order_close($orderId)
order_close_all($pair)
// TRADE WRAPPERS
trade($tradeId)
trade_pair($pair, $number=50)
trade_modify($tradeId, $options)
trade_close($tradeId)
trade_close_all($pair)
trade_modify_all($pair, $options)
// POSITION WRAPPERS
position_all()
position($pair)
position_close($positionId)
position_close_pair($pair)
// BIDIRECTIONAL WRAPPERS
market($side, $units, $pair, $rest = Optional)
stop($side, $units, $pair, $price, $rest = Optional)
mit($side, $units, $pair, $price, $expiry, $rest = Optional)
limit($side, $units, $pair, $price, $expiry, $rest = Optional)
// BUYING WRAPPERS
buy_market($units, $pair, $rest = Optional)
buy_stop($units, $pair, $price, $rest = Optional)
buy_mit($units, $pair, $price, $expiry, $rest = Optional)
buy_limit($units, $pair, $price, $expiry, $rest = Optional)
// SELLING WRAPPERS
sell_market($units, $pair, $rest = Optional)
sell_limit($units, $pair, $price, $rest = Optional)
sell_stop($units, $pair, $price, $rest = Optional)
sell_mit($units, $pair, $price, $expiry, $rest = Optional)
// EXPIRY WRAPPERS
expiry($seconds=5)
expiry_min($minutes=5)
expiry_hour($hours=1)
// MODIFICATION WRAPPERS
units_set($id, $units)
expiry_set($id, $time)
tp_set($type, $id, $price)
stop_set($type, $id, $price)
trailing_stop_set($type, $id, $distance)
// PRICE WRAPPERS
price($pair)
prices($pairs)
candles($pair, $gran, $number)
Download:
As a side to my current main project, this library has emerged.
I hope that some may find it useful in their search for ever increasing RR ratios.
Let this topic be a discussion of the project. Any bug reports or improvements will be welcomed.
I do not have much time, this project will be worked upon alongside my other projects,
and less frequent, yet more concise code in releases is my goal here.
I will endeavor to keep your client code syntax intact.
Best,
Will
Example:
Code:
<?php
include "OandaWrap.php";
OandaWrap::setup(); // Setup a sandbox environment
$audPrice = OandaWrap::price("AUD_USD"); // Return a decoded json object
echo "The price of AUD/USD is: " . $audPrice->ask . " at the ask.";
?>
Index
// SETUP
setup($server=Optional, $apiKey=Optional, $userName=Optional, $accountName=Optional)
// DIRECT NETWORK ACCESS
stream($url, $callback)
// ACCOUNT WRAPPERS
account($accountId)
accounts($username)
account_named($accountName, $uName)
account_id($accountName, $uName)
// INSTRUMENT WRAPPERS
instruments()
instrument($pair)
instrument_name($home, $away)
instrument_split($pair)
instrument_pip($pair)
// NAV (NET ACCOUNT VALUE) WRAPPERS
convert($pair, $amount, $homeIndex=0)
percent_nav ($pair, $percent, $leverage=1)
// TRANSACTION WRAPPERS
transaction_all($number=50, $pair="all")
transaction_types($types, $number=50, $pair="all")
transaction_get($transactionId)
// ORDER WRAPPERS
order($orderId)
order_pair($pair, $number=50)
order_open($side, $units, $pair, $type, $rest = Optional)
order_open_extended($side, $units, $pair, $type, $price, $expiry, $rest = Optional)
order_modify($orderId, $options)
order_close($orderId)
order_close_all($pair)
// TRADE WRAPPERS
trade($tradeId)
trade_pair($pair, $number=50)
trade_modify($tradeId, $options)
trade_close($tradeId)
trade_close_all($pair)
trade_modify_all($pair, $options)
// POSITION WRAPPERS
position_all()
position($pair)
position_close($positionId)
position_close_pair($pair)
// BIDIRECTIONAL WRAPPERS
market($side, $units, $pair, $rest = Optional)
stop($side, $units, $pair, $price, $rest = Optional)
mit($side, $units, $pair, $price, $expiry, $rest = Optional)
limit($side, $units, $pair, $price, $expiry, $rest = Optional)
// BUYING WRAPPERS
buy_market($units, $pair, $rest = Optional)
buy_stop($units, $pair, $price, $rest = Optional)
buy_mit($units, $pair, $price, $expiry, $rest = Optional)
buy_limit($units, $pair, $price, $expiry, $rest = Optional)
// SELLING WRAPPERS
sell_market($units, $pair, $rest = Optional)
sell_limit($units, $pair, $price, $rest = Optional)
sell_stop($units, $pair, $price, $rest = Optional)
sell_mit($units, $pair, $price, $expiry, $rest = Optional)
// EXPIRY WRAPPERS
expiry($seconds=5)
expiry_min($minutes=5)
expiry_hour($hours=1)
// MODIFICATION WRAPPERS
units_set($id, $units)
expiry_set($id, $time)
tp_set($type, $id, $price)
stop_set($type, $id, $price)
trailing_stop_set($type, $id, $distance)
// PRICE WRAPPERS
price($pair)
prices($pairs)
candles($pair, $gran, $number)
Download:
Attachments
Last edited: