Commit 185f92b8 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 444384e8
......@@ -166,7 +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
let tempAlldonePer = 0
// console.log(data)
......@@ -575,9 +575,6 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
baseCompund = baseCompund + percentage2(baseCompund, data[i].profit - 0.1)
if (data[i].side === 'LONG') {
allLongDone++
......@@ -765,9 +762,8 @@ 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
if (allDonePer > 0 && tempAlldonePer < allDonePer) {
tempAlldonePer = allDonePer
allDoneCount++
}
......@@ -932,6 +928,14 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
sum = sum - Math.abs(maxAllocatedMoney)
let newCompund = sum / dur
let newBasePerComp=allDonePer/allDoneCount
let lastSumCompound=100
for (let z=0;z<allDoneCount;z++)
{
lastSumCompound=lastSumCompound+percentage2(lastSumCompound,newBasePerComp)
}
let compoundPerMonth = (newCompund * 30 * 100) / Math.abs(maxAllocatedMoney)
let drawDown = Math.abs(((maxReserve * 100) / maxAllocatedMoney))
......@@ -947,7 +951,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
maxReseve: baseDrawDown,
maxMeta: baseMeta,
dur: dur,
upperCount:allDoneCount,
upperCount: allDoneCount,
allLongDone: allLongDone,
allLongDonePer: allLongDonePer,
allShortDone: allShortDone,
......@@ -972,7 +976,7 @@ upperCount:allDoneCount,
allLoss: allLoss,
totalFinal: oldTotalFinal,
totalPlus: totalPlus,
totalCompound: baseCompund/1000,
totalCompound: lastSumCompound,
compoundPerMonth: (baseCompund / dur) * 30,
profitPerMonth: Math.abs(profitPerMonth),
......@@ -1193,6 +1197,7 @@ function percentage(base, per) {
let temp = base * percentager
return base + temp
}
function percentage2(base, per) {
base = parseFloat(base)
......
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