Exchange and Market as global variables.
This commit is contained in:
1 parent
91dfa45b61
commit
1d00aaf6d2
6 files changed
+40
-26
No files matched your search
+2
-9
@@ -29,13 +29,6 @@
|
||||
let processDatetime;
|
||||
let exchangeAPI;
|
||||
|
||||
/* The current bots trades only at one market: USDT_BTC. */
|
||||
|
||||
const MARKET = {
|
||||
assetA: "USDT",
|
||||
assetB: "BTC",
|
||||
};
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize(pProcessDatetime, pBotContext, pExchangeAPI, callBackFunction) {
|
||||
@@ -99,7 +92,7 @@
|
||||
|
||||
*/
|
||||
|
||||
exchangeAPI.getOpenPositions(MARKET, onResponse);
|
||||
exchangeAPI.getOpenPositions(global.MARKET, onResponse);
|
||||
|
||||
function onResponse(err, pExchangePositions) {
|
||||
|
||||
@@ -432,7 +425,7 @@
|
||||
function putPositionAtExchange(pType, pRate, pAmountA, pAmountB, callBack) {
|
||||
|
||||
try {
|
||||
exchangeAPI.putPosition(MARKET, pType, pRate, pAmountA, pAmountB, onResponse);
|
||||
exchangeAPI.putPosition(global.MARKET, pType, pRate, pAmountA, pAmountB, onResponse);
|
||||
|
||||
function onResponse(err, pPositionId) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user