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