New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sand-ex

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sand-ex

Cryptocurrency Exchange sandbox for backtesting

latest
Source
npmnpm
Version
0.1.8
Version published
Weekly downloads
5
-50%
Maintainers
1
Weekly downloads
 
Created
Source

SandEx

npm DeepScan grade Coverage Status

SandEx allow you to backtest your trading strategies and order execution in a simple way, or replay your trades based on OHLCV input.

Basic Usage:

import SandExchange from 'sand-ex';

const exchangeOptions = {
  balanceAsset: 1.0,
  balanceQuote: 20000.0,
  fee: 0.00075,
 // feeMaker: 0.00075, // Optional
 // feeTaker: 0.00075, // Optional
 // candleData: OHLCV[]; // Optional
 // candlePrice?: CandlePrice; // Optional , Default: Close
};

const Exchange = new SandExchange(exchangeOptions);

Update([time,open,high,low,close]):

Update Exchange with OHLCV candleStick

Exchange.update([1569160500000, 9977.09, 9992.3, 9972.63, 9986.24, 56.127912]);

nextTick():

If you have CandleData[] as input you can replay tick to tick

Exchange.nextTick();

getBalance():

Exchange.getBalance();

createNewOrder({orderDetails}):

Exchange.createNewOrder({
side: 'BUY',
type: 'LIMIT,
price: 10000,
quantity: 0.8,
});

cancelOrder(orderId):

Exchange.cancelOrder(1);

getOrders():

Get All Orders (New,Filled,Canceled)

Exchange.getOrders();

Keywords

exchanges

FAQs

Package last updated on 12 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts