Commit 0ae3b049 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 9782e139
...@@ -96,8 +96,29 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -96,8 +96,29 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (maxDays > maxTradeDays) if (maxDays > maxTradeDays)
return null return null
if (runBefore === false) {
if (usage === 'fft') {
if (countDrop < fft)
runBefore=false
} else if (usage === 'fftPercent') {
if (allLossProfit > fftPercent)
runBefore=false
} else if (usage === 'fftRunup') {
if (countDropRunup < fftRunup)
runBefore=false
} else if (usage ==='fftDiffDrawDownProfit') {
if (diffDrawdownProfitAll > fftDiffDrawDownProfit)
runBefore=false
}
else if (usage ==='fftPercentRunup') {
if (canCreateRunupPercent ===false)
runBefore=false
}
}
if (data[i].profit < 0) { if (data[i].profit < 0) {
allLossProfit = allLossProfit + data[i].profit allLossProfit = allLossProfit + data[i].profit
diffDrawdownProfitAll = diffDrawdownProfitAll + (data[i].drawDown - data[i].profit) diffDrawdownProfitAll = diffDrawdownProfitAll + (data[i].drawDown - data[i].profit)
...@@ -136,28 +157,11 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -136,28 +157,11 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
} }
if (runBefore === false) {
if (usage === 'fft') {
if (countDrop < fft)
continue
} else if (usage === 'fftPercent') {
if (allLossProfit > fftPercent)
continue
} else if (usage === 'fftRunup') {
if (countDropRunup < fftRunup)
continue
} else if (usage ==='fftDiffDrawDownProfit') {
if (diffDrawdownProfitAll > fftDiffDrawDownProfit)
continue
}
else if (usage ==='fftPercentRunup') {
if (canCreateRunupPercent ===false)
continue
}
} if (runBefore ===false)
continue
canCreateRunupPercent=false canCreateRunupPercent=false
runBefore = true runBefore = true
let obj let obj
......
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