Commit b569bd06 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 69c4141a
......@@ -10,6 +10,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel) {
let commision = config.commision
let money = config.base
let total = 0
let allTotal=0
let maxReserve = 0
let maxAllocatedMoney = 0
let maxLevel = 0
......@@ -65,6 +66,8 @@ function run(data, config, risk, pfTrade, riskFreeLevel) {
profit = 0
lastCom = 0
lastMoney = 0
allTotal++
if (!d.riskFree)
total++
} else {
......@@ -141,6 +144,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel) {
platform: data[0].signal,
type: config.type + ' param:' + config.param + ' base:' + config.base + ' target:' + config.target,
total: total,
allTotal:allTotal,
avgLevel: maxLevel / total,
maxLevel: maxLevel,
dur: dur,
......@@ -219,7 +223,7 @@ function inlineCheck(money, com, data, profit, lastCom, tar,riskFree) {
if (percentage(money, data.runUp) > target)
return {done: true, reserve: diff}
return {done: true, reserve: diff,riskFree}
else
return {done: false, reserve: diff, profit: profitMoney, com: com, lastMoney: money}
......
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