Commit cfe19a64 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent ee80fd1d
......@@ -19,14 +19,14 @@ async function init() {
com = JSON.parse(com)
for (let i=0;i<com.length;i++)
{
com[i].platform=com[i].platform.toLowerCase()
let t = com[i].platform
t = t.split('_')
let pair = t[3].replace('USDT', '').replace('USD', '')
let pair = t[3].replace('usdt', '').replace('usd', '')
let lp = t[4]
com[i].lp=lp
let p=t[t.length-1].split('.')
......@@ -51,7 +51,7 @@ async function init() {
t = t.split('_')
let pair = t[3].replace('USDT', '').replace('USD', '')
let pair = t[3].replace('usdt', '').replace('usd', '')
pairs=pair
let p=t[t.length-1].split('.')
p=p[0].split(pairs)[1]
......
let t='1,2022.04.03 13:30:00.000,Buy,BTCUSDT,46575.60,45981.22,2022.04.04 00:30:00.000,-1.28,1.86,-1.78\n' +
'2,2022.04.04 00:30:00.000,Sell,BTCUSDT,45981.22,46806.30,2022.04.04 23:30:00.000,-1.79,1.88,-1.91\n' +
'3,2022.04.04 23:30:00.000,Buy,BTCUSDT,46806.30,45933.99,2022.04.05 14:30:00.000,-1.86,0.84,-2.06\n' +
'4,2022.04.05 14:30:00.000,Sell,BTCUSDT,45933.99,43037.80,2022.04.10 17:30:00.000,6.31,8.33,-0.56\n' +
'5,2022.04.10 17:30:00.000,Buy,BTCUSDT,43037.80,42387.39,2022.04.10 22:30:00.000,-1.51,0.87,-1.60\n' +
'6,2022.04.10 22:30:00.000,Sell,BTCUSDT,42387.39,41298.81,2022.04.13 15:30:00.000,2.57,7.52,-0.11\n' +
'7,2022.04.13 15:30:00.000,Buy,BTCUSDT,41298.81,39964.01,2022.04.14 16:00:00.000,-3.23,0.64,-3.33\n' +
'8,2022.04.14 16:00:00.000,Sell,BTCUSDT,39964.01,40551.90,2022.04.16 00:00:00.000,-1.47,1.03,-2.27\n' +
'9,2022.04.16 00:00:00.000,Buy,BTCUSDT,40551.90,40328.80,2022.04.16 10:00:00.000,-0.55,0.39,-0.68\n' +
'10,2022.04.16 10:00:00.000,Sell,BTCUSDT,40328.80,40211.03,2022.04.18 18:00:00.000,0.29,4.44,-0.92\n' +
'11,2022.04.18 18:00:00.000,Buy,BTCUSDT,40211.03,40609.26,2022.04.21 21:00:00.000,0.99,6.88,0.00\n' +
'12,2022.04.21 21:00:00.000,Sell,BTCUSDT,40609.26,39887.04,2022.04.25 19:00:00.000,1.78,5.93,-0.58\n' +
'13,2022.04.25 19:00:00.000,Buy,BTCUSDT,39887.04,39274.40,2022.04.26 15:00:00.000,-1.54,2.28,-1.67\n' +
'14,2022.04.26 15:00:00.000,Sell,BTCUSDT,39274.40,39489.21,2022.04.28 01:30:00.000,-0.55,4.00,-1.06\n' +
'15,2022.04.28 01:30:00.000,Buy,BTCUSDT,39489.21,39147.86,2022.04.29 10:00:00.000,-0.86,2.24,-1.54\n' +
'16,2022.04.29 10:00:00.000,Sell,BTCUSDT,39147.86,38564.12,2022.05.01 16:30:00.000,1.49,4.50,-0.66\n' +
'17,2022.05.01 16:30:00.000,Buy,BTCUSDT,38564.12,37934.90,2022.05.01 19:00:00.000,-1.63,0.11,-1.69\n' +
'18,2022.05.01 19:00:00.000,Sell,BTCUSDT,37934.90,38516.91,2022.05.01 23:30:00.000,-1.53,0.66,-1.83\n' +
'19,2022.05.01 23:30:00.000,Buy,BTCUSDT,38516.91,38364.82,2022.05.03 14:00:00.000,-0.39,1.69,-1.21\n' +
'20,2022.05.03 14:00:00.000,Sell,BTCUSDT,38364.82,38701.32,2022.05.04 08:00:00.000,-0.88,2.21,-1.02\n' +
'21,2022.05.04 08:00:00.000,Buy,BTCUSDT,38701.32,38992.53,2022.05.05 14:00:00.000,0.75,3.42,-0.29\n' +
'22,2022.05.05 14:00:00.000,Sell,BTCUSDT,38992.53,30014.63,2022.05.13 02:30:00.000,23.02,31.53,-0.16\n' +
'23,2022.05.13 02:30:00.000,Buy,BTCUSDT,30014.63,29287.05,2022.05.14 00:00:00.000,-2.42,3.56,-2.71\n' +
'24,2022.05.14 00:00:00.000,Sell,BTCUSDT,29287.05,30239.33,2022.05.14 23:00:00.000,-3.25,2.24,-3.61\n' +
'25,2022.05.14 23:00:00.000,Buy,BTCUSDT,30239.33,29481.46,2022.05.16 06:30:00.000,-2.51,4.04,-2.85\n' +
'26,2022.05.16 06:30:00.000,Sell,BTCUSDT,29481.46,30363.59,2022.05.17 04:00:00.000,-2.99,1.34,-3.48\n' +
'27,2022.05.17 04:00:00.000,Buy,BTCUSDT,30363.59,29605.95,2022.05.17 18:30:00.000,-2.50,1.40,-3.01\n' +
'28,2022.05.17 18:30:00.000,Sell,BTCUSDT,29605.95,30224.98,2022.05.17 19:30:00.000,-2.09,0.29,-2.32\n' +
'29,2022.05.17 19:30:00.000,Buy,BTCUSDT,30224.98,29549.50,2022.05.18 13:00:00.000,-2.23,1.60,-2.35\n' +
'30,2022.05.18 13:00:00.000,Sell,BTCUSDT,29549.50,29746.94,2022.05.19 14:30:00.000,-0.67,3.03,-1.19\n' +
'31,2022.05.19 14:30:00.000,Buy,BTCUSDT,29746.94,29489.32,2022.05.20 15:00:00.000,-0.87,3.46,-1.17\n' +
'32,2022.05.20 15:00:00.000,Sell,BTCUSDT,29489.32,30140.79,2022.05.22 10:00:00.000,-2.21,2.57,-2.41\n' +
'33,2022.05.22 10:00:00.000,Buy,BTCUSDT,30140.79,29240.00,2022.05.23 19:30:00.000,-2.99,1.76,-3.26\n' +
'34,2022.05.23 19:30:00.000,Sell,BTCUSDT,29240.00,29789.69,2022.05.25 02:00:00.000,-1.88,1.95,-2.07\n' +
'35,2022.05.25 02:00:00.000,Buy,BTCUSDT,29789.69,29380.00,2022.05.25 12:30:00.212,-1.38,1.46,-1.64'
t=t.split('\n')
let arrs=grabData(t)
let ai=require('./ai-new')
let z=ai.run(arrs,5.146277836691405,-2.2190349946977728)
console.log(arrs)
function grabData(data) {
// console.log(data)
let arr = []
for (let i = 0; i < data.length; i++) {
try {
let d = data[i].split(',')
let profit = parseFloat(d[7])
let runUp = parseFloat(d[8])
let drawDown = parseFloat(d[9])
let t=d[6]
t=t.split(':')
let closeTime = t[0]+':'+t[1]
if (isNaN(profit))
continue
arr.push({profit, runUp, drawDown, closeTime})
} catch (e) {
}
}
return arr
}
\ No newline at end of file
let t='last.json-220212212600_O1_BNC_BNBUSDT_Lp1481_1Bnb12.csv'
t=t.toLowerCase()
t = t.split('_')
let pair = t[3].replace('usdt', '').replace('usd', '')
let p=t[t.length-1].split('.')
console.log(p)
p=p[0].toLowerCase().split(pair)[1]
console.log(p)
\ No newline at end of file
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