new Demo()
Demo Account Implementation.
Methods
-
cancelOrder(tfc, order, cb)
-
Cancel a previously placed open order.
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
order
object | Array.<object> Order or set of orders to cancel
cb
function Callback function
-
closeAllPositions(tfc, cb)
-
Close all positions in the account.
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
cb
function Callback function
-
closePosition(tfc, position, cb)
-
Close one position.
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
position
object Position to close
cb
function Callback function
-
closeTrade(tfc, trade, cb)
-
Close one trade.
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
trade
object Trade to close
cb
function Callback function
-
execute(order, price)
-
Simulate an execution of an open order.
Parameters:
Name Type Description order
object Order to execute
price
number Price to execute at
-
fetchBalances(cb)
-
Retrieve balances from source.
Parameters:
Name Type Description cb
function Callback function
-
fetchOpenOrders(cb)
-
Retrieve open orders from source.
Parameters:
Name Type Description cb
function Callback function
-
fetchPositions(cb)
-
Retrieve positions from source.
Parameters:
Name Type Description cb
function Callback function
-
fetchTrades(cb)
-
Retrieve trades from source.
Parameters:
Name Type Description cb
function Callback function
-
placeOrder(tfc, order, cb)
-
Place an order to the remote API.
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
order
object | Array.<object> Order or set of orders to place
cb
function Callback function
-
replaceOrder(tfc, order, cb)
-
Replace an order with another one.
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
order
object | Array.<object> Order or set of orders to replace
cb
function Callback function
-
setProtection(tfc, order, cb)
-
Set protection on an order (take profit, stop loss).
Parameters:
Name Type Description tfc
CIQ.TFC Trade From Chart object
order
object | Array.<object> Order or set of orders to set protection on
cb
function Callback function