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