Commit 994ed27d authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent d0b021bb
......@@ -37,6 +37,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
let profit = 0
let lastCom = 0
let lastMoney = 0
let maxMetaStep=0
let levels = []
let detailLevel = []
let durDetail=[]
......@@ -105,6 +106,9 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (d.meta < 0 && Math.abs(d.meta) > Math.abs(maxMeta))
maxMeta = d.meta
if (d.meta < 0 && Math.abs(d.meta) > Math.abs(maxMetaStep))
maxMetaStep = d.meta
// console.log(maxAllocatedMoney)
if (money > maxAllocatedMoney)
maxAllocatedMoney = money
......@@ -155,7 +159,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (d.done === true) {
let endDays = getNewMinDiff(startDays, data[i].closeDate)
detailLevel.push({step: step, dur: endDays})
durDetail.push({dur:endDays,step:step,days:startDays.split(' ')[0]+'-'+data[i].closeDate.split(' ')[0]})
durDetail.push({meta:maxMetaStep,dur:endDays,step:step,days:startDays.split(' ')[0]+'-'+data[i].closeDate.split(' ')[0]})
// console.log(typeof endDays)
//console.log(endDays)
if (endDays > maxDays)
......@@ -168,6 +172,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
step = 0
reserv = 0
profit = 0
maxMetaStep=0
lastCom = 0
curDrawDown = 0
lastMoney = 0
......@@ -258,7 +263,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
{
if (i>10)
break
durDetailText=durDetailText+durDetail[i].step+':'+parseFloat(durDetail[i].dur).toFixed(2)+':'+durDetail[i].days+'///'
durDetailText=durDetailText+durDetail[i].step+':'+parseFloat(durDetail[i].dur).toFixed(2)+':'+durDetail[i].days+':'+parseFloat(durDetail[i].meta).toFixed(2)+'///'
}
// console.log(newLevelText)
......
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