Commit 7fccad9f authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 3443fad0
...@@ -12,8 +12,7 @@ const client = redis.createClient( ...@@ -12,8 +12,7 @@ const client = redis.createClient(
); );
let datas = [] let datas = []
appendDiffProfitLog('test1')
appendDiffProfitLog('test2')
const ccxt = require('ccxt') const ccxt = require('ccxt')
...@@ -158,7 +157,7 @@ async function updateVars(name) { ...@@ -158,7 +157,7 @@ async function updateVars(name) {
let data = grabData([lastData]) let data = grabData([lastData])
closer(sig, data[0].closeTime, data[0]) closer(sig, data[0].closeTime, data[0],allData.id)
let vars = ai.run(data, allData.avgRunup, allData.avgDrawdown, getVarsFromName(name)) let vars = ai.run(data, allData.avgRunup, allData.avgDrawdown, getVarsFromName(name))
...@@ -254,7 +253,7 @@ function getVarFromUsage(vars, usage) { ...@@ -254,7 +253,7 @@ function getVarFromUsage(vars, usage) {
} }
async function closer(sig, date, bigData) { async function closer(sig, date, bigData,id) {
let lastToken = sig + '_2' + date let lastToken = sig + '_2' + date
lastToken = lastToken.replace(/_/g, '').replace(/Lp/g, '').replace(/BTC/g, '').replace(/ /g, '') lastToken = lastToken.replace(/_/g, '').replace(/Lp/g, '').replace(/BTC/g, '').replace(/ /g, '')
const [data, delStatus] = await client const [data, delStatus] = await client
...@@ -310,7 +309,8 @@ async function closer(sig, date, bigData) { ...@@ -310,7 +309,8 @@ async function closer(sig, date, bigData) {
if (newData.side ==='sell') if (newData.side ==='sell')
profit=profit*-1 profit=profit*-1
console.log('bybit profit:',profit,'yashil profit:',bigData.profit,'diff:',profit-bigData.profit) let t=id +' :'+'bybit profit:'+' '+profit+' yashil profit:'+bigData.profit+' diff:'+(profit-bigData.profit)
appendDiffProfitLog(t)
} }
......
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