Commit 40fdaab4 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent e556e125
......@@ -91,7 +91,7 @@ let obj
obj.maxAllocatedMoney=maxAllocatedMoney
obj.maxLevel=maxLevel
obj.step=step
obj.money=money
}
if (d.done === true) {
......@@ -116,7 +116,7 @@ let obj
obj.profit=profit
obj.lastMoney=lastMoney
obj.lastCom=lastCom
}
......@@ -262,11 +262,16 @@ function inlineCheck(money, com, data, profit, lastCom, tar,riskFree) {
// console.log(profit)
com = com * money
let minProf=profit*-1
let target = money + minProf + com + lastCom
let target = money + Math.abs(profit) + com + lastCom
let targetDetail='('+money+')' +'+'+'('+minProf+')+('+com +')+('+lastCom+')'
if (!riskFree)
{
target=target+tar
targetDetail=targetDetail+'+('+tar+')'
}
let reserve = percentage(money, data.drawDown)
......@@ -279,9 +284,9 @@ function inlineCheck(money, com, data, profit, lastCom, tar,riskFree) {
if (percentage(money, data.runUp) > target)
return {done: true, reserve: diff,riskFree}
return {done: true,money:money, reserve: diff,riskFree,profitLastSteps:profit,profit: profitMoney,lastCom:lastCom,com: com,target:target,targetDetail:targetDetail}
else
return {done: false, reserve: diff, profit: profitMoney, com: com, lastMoney: money}
return {done: false,money:money, reserve: diff, profitLastSteps:profit,profit: profitMoney, lastMoney: money,com: com,target:target,targetDetail:targetDetail}
}
......
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