Commit e98bf3a6 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent b08ed8d3
...@@ -70,12 +70,15 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -70,12 +70,15 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
// console.log(newP) // console.log(newP)
if (pfTrade < newP) if (pfTrade < newP)
return null return null
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
if (maxDays > maxTradeDays) if (maxDays > maxTradeDays)
return null return null
if (data[i].profit <0) { if (data[i].profit <0) {
allLossProfit=allLossProfit+data[i].profit allLossProfit=allLossProfit+data[i].profit
countDrop++ countDrop++
...@@ -92,6 +95,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -92,6 +95,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (allLossProfit> fftPercent) if (allLossProfit> fftPercent)
continue continue
} }
runBefore=true runBefore=true
let obj let obj
if (step === 0) { if (step === 0) {
......
...@@ -52,6 +52,7 @@ async function run() { ...@@ -52,6 +52,7 @@ async function run() {
let count = 0 let count = 0
let arr2 = [] let arr2 = []
let arr3 = [] let arr3 = []
// console.log(arr)
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
let inline = arr[i] let inline = arr[i]
for (let j = 0; j < inline.length; j++) { for (let j = 0; j < inline.length; j++) {
...@@ -61,7 +62,7 @@ async function run() { ...@@ -61,7 +62,7 @@ async function run() {
} }
} }
// console.log(arr2)
arr2 = _.without(arr2, undefined, null); arr2 = _.without(arr2, undefined, null);
......
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