Merge pull request #8 from matbenitez/master

Partial orders
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2018-05-07 17:20:59 +02:00
commit c28e9527fe
3 files changed
+11 -9

No files matched your search

+3 -1
View File
@@ -704,7 +704,9 @@
logger.write("[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> sumAssetB = " + sumAssetB);
logger.write("[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> Cannot be confirmed that a partially execution was done well.");
callBack(global.DEFAULT_FAIL_RESPONSE);
/* There are diferences on the responses between the getPosition and getTrades that causes some issues, let's retry. */
callBack(global.DEFAULT_RETRY_RESPONSE);
return;
}
+2 -2
View File
@@ -443,8 +443,8 @@
once we advance into multiple competitions scheme.
*/
const INITIAL_INVESTMENT_A = 57.23872937; // This is just for this release of the platform.
const INITIAL_INVESTMENT_B = 0; // This is just for this release of the platform.
const INITIAL_INVESTMENT_A = 0; // This is just for this release of the platform.
const INITIAL_INVESTMENT_B = .001; // This is just for this release of the platform.
thisObject.executionContext = {
investment: { // This is used to calculate profits.
+6 -6
View File
@@ -403,16 +403,16 @@
logger.write("[INFO] analizeResponse -> exchangeErr = " + stringExchangeErr);
logger.write("[INFO] analizeResponse -> exchangeResponse = " + stringExchangeResponse);
if (
stringExchangeResponse.indexOf("Connection timed out") > 0 ||
stringExchangeResponse.indexOf("Connection Error") > 0 ||
stringExchangeResponse.indexOf("Bad gateway") > 0 ||
stringExchangeErr.indexOf("ETIMEDOUT") > 0 ||
if (stringExchangeErr.indexOf("ETIMEDOUT") > 0 ||
stringExchangeErr.indexOf("ENOTFOUND") > 0 ||
stringExchangeErr.indexOf("ECONNREFUSED") > 0 ||
stringExchangeErr.indexOf("ESOCKETTIMEDOUT") > 0 ||
stringExchangeErr.indexOf("ECONNRESET") > 0 ||
stringExchangeResponse.indexOf("Internal error. Please try again") > 0) {
(stringExchangeResponse !== undefined && (
stringExchangeResponse.indexOf("Connection timed out") > 0 ||
stringExchangeResponse.indexOf("Connection Error") > 0 ||
stringExchangeResponse.indexOf("Bad gateway") > 0 ||
stringExchangeResponse.indexOf("Internal error. Please try again") > 0))) {
logger.write("[WARN] analizeResponse -> Timeout reached or connection problem while trying to access the Exchange API. Requesting new execution later.");
notOkCallBack(global.DEFAULT_RETRY_RESPONSE);