Commit 42b66eab authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 16a1e113
...@@ -46,6 +46,9 @@ async function format(name) { ...@@ -46,6 +46,9 @@ async function format(name) {
let greenCounter=0 let greenCounter=0
let maxGreenArray=[] let maxGreenArray=[]
let maxRedArray=[] let maxRedArray=[]
let maxTimeGreen=0
let maxTimeRed=0
for (let i = 1; i < (res.length - 1); i++) { for (let i = 1; i < (res.length - 1); i++) {
try { try {
let d = res[i].split(',') let d = res[i].split(',')
...@@ -54,16 +57,20 @@ async function format(name) { ...@@ -54,16 +57,20 @@ async function format(name) {
if (close < open) { if (close < open) {
if (greenCounter !==0) if (greenCounter !==0)
maxGreenArray.push(greenCounter) maxGreenArray.push(greenCounter)
if (greenCounter>maxGreen) if (greenCounter>maxGreen) {
maxGreen=greenCounter maxTimeGreen=d[0]
maxGreen = greenCounter
}
greenCounter=0 greenCounter=0
redCounter++ redCounter++
con++ con++
} else { } else {
if (redCounter !==0) if (redCounter !==0)
maxRedArray.push(redCounter) maxRedArray.push(redCounter)
if (redCounter > maxRed) if (redCounter > maxRed) {
maxTimeRed=d[0]
maxRed = redCounter maxRed = redCounter
}
redCounter = 0 redCounter = 0
greenCounter++ greenCounter++
allGreeeCon++ allGreeeCon++
...@@ -82,7 +89,7 @@ async function format(name) { ...@@ -82,7 +89,7 @@ async function format(name) {
// twoCounter++ // twoCounter++
console.log('from ' + res.length + ' red ' + con, ' max red:'+maxRed ,' green:'+allGreeeCon +' max green:'+maxGreen) console.log('from ' + res.length + ' red ' + con, ' max red:'+maxRed ,'Max red Timestamp:'+maxTimeRed ,' green:'+allGreeeCon +' max green:'+maxGreen + ' max green time end:'+maxTimeGreen)
// console.log('total '+con +' avg runup:'+(allProfit/con)) // console.log('total '+con +' avg runup:'+(allProfit/con))
maxRedArray=_.orderBy(maxRedArray) maxRedArray=_.orderBy(maxRedArray)
maxRedArray=_.reverse(maxRedArray) maxRedArray=_.reverse(maxRedArray)
......
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