Skip to content

Commit

Permalink
Update backtest_stochrsi.js
Browse files Browse the repository at this point in the history
  • Loading branch information
universalbit-dev authored May 2, 2024
1 parent 166da64 commit 2d00da0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ecosystem/backtest/backtest_stochrsi.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ config.STOCHRSI.thresholds={low:30,high:70,persistence:5};
//Trading Advisor
config.tradingAdvisor = {enabled:true,candleSize:5,historySize:40,method:'STOCHRSI'};//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 2d00da0

Please sign in to comment.