Commit bdeb3ee0 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 3973cf6c
......@@ -13,6 +13,7 @@ let avgRunup = 0
let avgDrawdown = 0
let avgProfit = 0
let startt = 30
let baseCompund=100
//
function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, maxTradeDays, targetPercentage, candlesData, fft, ProfitZeroProfit, fftRunup, ProfitZeroProfitRunup, ProfitZeroDrawDownProfit, ProfitZeroDrawDown, ddPlusRunCount, RunupDrawDownZeroRunupDrawDown, ProfitZeroRunupProfit, ProfitZeroRunupDrawDown, RunUpDrawDownZeroProfit, RunUpDrawDownZeroDrawDownProfit, RunUpDrawDownZeroDrawdown, RunUpDrawDownZeroRunupProfit, RunupZeroRunupDrawDown, RunupZeroProfit, RunupZeroProfitDrawDown, RunupZeroDrawDown, RunupZeroProfitRunup, DrawDownZeroDrawDown, DrawDownnZeroProfit, DrawDownZeroProfitDrawDown, DrawDownZeroProfitRunup, DrawDownZeroRunupDrawDown, ProfitDrawDownZeroDrawDown, ProfitDrawDownZeroProfit, ProfitDrawDownZeroProfitDrawDown, ProfitDrawDownZeroProfitRunup, ProfitDrawDownZeroRunupDrawDown
......@@ -249,6 +250,8 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
for (let i = 0; i < data.length; i++) {
if (allDonePer < -70)
return null
if (maxDays > maxTradeDays)
......@@ -561,6 +564,8 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (runBefore === false)
continue
allDone++
if (data[i].profit>0.1)
baseCompund=baseCompund+data[i].profit
if (data[i].side === 'LONG') {
allLongDone++
......@@ -939,9 +944,9 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
allLoss: allLoss,
totalFinal: oldTotalFinal,
totalPlus: totalPlus,
totalCompound: sum,
totalCompound: baseCompund,
profitPerMonth: Math.abs(profitPerMonth),
compoundPerMonth: compoundPerMonth,
compoundPerMonth: (baseCompund * dur)/30,
dateString: dateString,
runupString: runupString,
sideString: sideString,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment