Skip to content

Commit

Permalink
Add potential setting for min hits before acting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Siebler committed Jan 17, 2018
1 parent a7304d2 commit c50d8e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ var botOptions = {
trading: {
paperOnly: true,
// only candidates with over x% gain potential are queued for trading
minQueuePercentageThreshold: 3
minQueuePercentageThreshold: 3,
// how many times we need to see the same opportunity before deciding to act on it
minHitsThreshold: 5
}
},
ctrl = {
Expand Down
2 changes: 1 addition & 1 deletion lib/TradingCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TradingCore.prototype.processQueue = (queue, opts, currencyCore, stream)=>{
let cand = queue[keys[i]];

let liveRate = currencyCore.getArbitageRate(stream, cand.a_step_from, cand.b_step_from, cand.c_step_from);
if(liveRate >= opts.minQueuePercentageThreshold){
if(liveRate >= opts.minQueuePercentageThreshold && cand.hits >= opts.minHitsThreshold){
// begin trading logic. Plan:
/*
Expand Down

0 comments on commit c50d8e1

Please sign in to comment.