Commit 477e09b1 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 3fc881db
...@@ -8,15 +8,21 @@ let arr = [] ...@@ -8,15 +8,21 @@ let arr = []
let lastBalance=1000 let lastBalance=1000
let balance =lastBalance let balance =lastBalance
init() init()
let com
//profitLossString //profitLossString
//drawDownString //drawDownString
async function init() { async function init() {
let com = await fs.readFileSync('t.json', 'utf8'); com = await fs.readFileSync('t.json', 'utf8');
com = JSON.parse(com) com = JSON.parse(com)
com=_.shuffle(com) com=_.shuffle(com)
}
function run()
{
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
let closeDate = com[i].closeDate.split('_') let closeDate = com[i].closeDate.split('_')
let profits = com[i].profitLossString.split('_') let profits = com[i].profitLossString.split('_')
...@@ -66,10 +72,10 @@ async function init() { ...@@ -66,10 +72,10 @@ async function init() {
start=true start=true
arr2.push(arr[i]) arr2.push(arr[i])
} }
// else if (arr[i].date === arrNew[0].date ) // else if (arr[i].date === arrNew[0].date )
// { // {
// arr2.push(arr[i]) // arr2.push(arr[i])
// break // break
// } // }
else if (start) else if (start)
arr2.push(arr[i]) arr2.push(arr[i])
...@@ -81,9 +87,9 @@ async function init() { ...@@ -81,9 +87,9 @@ async function init() {
balance=balance+arr2[i].profit balance=balance+arr2[i].profit
arr2[i].balance=balance arr2[i].balance=balance
} }
createfileADV(JSON.stringify(arr2, null, 2)) // createfileADV(JSON.stringify(arr2, null, 2))
// let index=arrNew[0].index // let index=arrNew[0].index
// arrNew=[] // arrNew=[]
// for (let i = index; i < index+1; i++) { // for (let i = index; i < index+1; i++) {
// let sums = 0 // let sums = 0
...@@ -100,8 +106,7 @@ async function init() { ...@@ -100,8 +106,7 @@ async function init() {
// } // }
// //
// } // }
return run()
} }
......
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