Skip to content

Commit

Permalink
Got basic functionality working for #8 found out Fills gives trade in…
Browse files Browse the repository at this point in the history
…formation. Send a group of symbols to bittrex at same time (different to other exchanges) which seems to be much more efficient also.
  • Loading branch information
Gerard Moroney committed Jan 5, 2018
1 parent 4dd4e1a commit 84d1a05
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ client.on('connect', function() {
var exFn = require("../functions/exchange_functions.js");

// Main program wrapper
function main () {
function main ()
{

// Loop through exchanges (preparation for later)
for (var i = 0; i < config.exchanges.length; i++ )
Expand All @@ -33,6 +34,9 @@ function main () {
// Only process configurationg for exchange if it is active
if ( exchange_active == 'Y') {

// xxx
var exchange_symbol_list = [];

// Loop through config for exchange: connect, transform and create Redis pub/sub
for ( var j = 0; j < exchange_symbol_array.length; j++)
{
Expand All @@ -55,15 +59,11 @@ function main () {
//exFn.processBINANCE( ...args );
exFn.processBINANCE(exchange_name, exchange_wss, exchange_symbol );
} else if ( exchange_name == 'BITTREX' ) {
// concatenate all of the symbols together because thats the way this API works for some reason
if ( j == 0 ) {
exchange_symbol = "\'" + exchange_symbol_array[s].symbol + "\'" ;
} else {
exchange_symbol = exchange_symbol + "," + "\'" + exchange_symbol_array[s].symbol + "\'";
}
//concatenate all of the symbols together because thats the way this API works for some reason
exchange_symbol_list.push(exchange_symbol);
if ( j == ( exchange_symbol_array.length - 1) )
{
exFn.processBITTREX(exchange_name, exchange_wss, exchange_symbol);
exFn.processBITTREX(exchange_name, exchange_wss, exchange_symbol_list);
}
} else {
console.log("ERROR: Unrecognized exchange name in configuration. Please check " + exchange_name );
Expand Down

0 comments on commit 84d1a05

Please sign in to comment.