Commit d16291a5 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 343419b8
...@@ -570,7 +570,9 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -570,7 +570,9 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
continue continue
allDone++ allDone++
if (data[i].profit > 0.1) if (data[i].profit > 0.1)
baseCompund = baseCompund + percentageAdv(baseCompund,data[i].profit - 0.1) baseCompund = baseCompund + percentage2(baseCompund, data[i].profit - 0.1)
if (data[i].profit > 0.1) { if (data[i].profit > 0.1) {
tempMeta = 0 tempMeta = 0
...@@ -579,7 +581,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -579,7 +581,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
} else { } else {
tempMeta = tempMeta + data[i].profit + 0.1 tempMeta = tempMeta + data[i].profit + 0.1
tempDrawDown = tempDrawDown + data[i].drawDown tempDrawDown = tempDrawDown + data[i].drawDown
// console.log(tempMeta,tempDrawDown) // console.log(tempMeta,tempDrawDown)
if (tempMeta < baseMeta) if (tempMeta < baseMeta)
baseMeta = tempMeta baseMeta = tempMeta
...@@ -679,7 +681,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -679,7 +681,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
obj.currentDrawDown = 0 obj.currentDrawDown = 0
obj.maxReserve = baseDrawDown obj.maxReserve = baseDrawDown
obj.maxMeta=baseMeta obj.maxMeta = baseMeta
obj.maxAllocatedMoney = maxAllocatedMoney obj.maxAllocatedMoney = maxAllocatedMoney
obj.maxLevel = maxLevel obj.maxLevel = maxLevel
obj.step = step obj.step = step
...@@ -1196,6 +1198,14 @@ function percentage(base, per) { ...@@ -1196,6 +1198,14 @@ function percentage(base, per) {
let temp = base * percentager let temp = base * percentager
return base + temp return base + temp
} }
function percentage2(base, per) {
base = parseFloat(base)
per = parseFloat(per)
let percentager = per / 100
let temp = base * percentager
return temp
}
function percentageMinus(base, per) { function percentageMinus(base, per) {
......
...@@ -14,9 +14,12 @@ ...@@ -14,9 +14,12 @@
// console.log(f.length) // console.log(f.length)
// console.log(sum / f.length) // console.log(sum / f.length)
console.log(percentage(100,2))
function percentage(base, per) {
let t='2017-08-21 00:30:00' base = parseFloat(base)
let ft=t.split('-') per = parseFloat(per)
let y=parseFloat(ft[0]) let percentager = per / 100
let m=parseFloat(ft[1]) let temp = base * percentager
console.log(y,m) return temp
\ No newline at end of file }
\ No newline at end of file
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