Commit 444384e8 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 7b0f39c1
......@@ -133,6 +133,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
let lossDone = 0
let allDone = 0
let allDonePer = 0
let allDoneCount = 0
let allLongDone = 0
let allLongDonePer = 0
let lossLongDone = 0
......@@ -165,6 +166,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
let avgRunup = 0
let avgDrawdown = 0
let avgProfit = 0
let tempAlldonePer=0
// console.log(data)
......@@ -574,20 +576,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (data[i].profit > 0.1) {
tempMeta = 0
tempDrawDown = 0
} else {
tempMeta = tempMeta + data[i].profit + 0.1
tempDrawDown = tempDrawDown + data[i].drawDown
// console.log(tempMeta,tempDrawDown)
if (tempMeta < baseMeta)
baseMeta = tempMeta
if (tempDrawDown < baseDrawDown)
baseDrawDown = tempDrawDown
}
if (data[i].side === 'LONG') {
allLongDone++
......@@ -776,6 +765,12 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
lossDonePer = lossDonePer + data[i].profit - 0.1
}
allDonePer = allDonePer + data[i].profit - 0.1
if (allDonePer >0 && tempAlldonePer<allDonePer)
{
tempAlldonePer=allDonePer
allDoneCount++
}
if (data[i].side === 'LONG') {
allLongDonePer = allLongDonePer + data[i].profit - 0.1
......@@ -952,7 +947,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
maxReseve: baseDrawDown,
maxMeta: baseMeta,
dur: dur,
upperCount:allDoneCount,
allLongDone: allLongDone,
allLongDonePer: allLongDonePer,
allShortDone: allShortDone,
......
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