Skip to content

Commit

Permalink
Update backtest_nncci.js
Browse files Browse the repository at this point in the history
  • Loading branch information
universalbit-dev authored May 2, 2024
1 parent 9ff4a27 commit 09e0259
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ecosystem/backtest/backtest_nncci.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ config.NNCCI.thresholds={up:100,down:-100,persistence:0};
//Trading Advisor
config.tradingAdvisor = {enabled:true,candleSize:5,historySize:40,method:'NNCCI'};//candleSize (5 minutes)* historySize (40 minutes) == period

//Date.prototype.toISOString()
//Previous Month
var previous_month = new Date();
previous_month.setDate(1);
previous_month.setMonth(previous_month.getMonth()-1);
previous_month.setDate(2);
var previous = previous_month.toString().slice(0, -14);
//Current Month
var current_month = new Date();
current_month.setDate(1);
current_month.setMonth(current_month.getMonth());
//Backtest Exchange Data FROM first date previous month TO first date current month
current_month.setDate(2);
var current = current_month.toString().slice(0, -14);

//Backtest Exchange Data FROM previous month TO current month

config.backtest = {enabled:true,
daterange:{from:previous_month,to:current_month},
batchSize: 60
Expand Down

0 comments on commit 09e0259

Please sign in to comment.