Open kokucrypto opened 6 years ago
About which amount you tell. Where exactly its shown?
Main page, top left corner tab:
Now its show on Vol fields only the sum amount of coins traded daily, but not his BTC amount. So it show for example 10 ltc traded or 10 doged traded, but not their respective BTC amount (as 99% exchanges have).
I think the string to change its From index.js: const vol = (message.coins[i].volume*1).toFixed(8);
So i think on this string i should change with something like: g_constants.dbTables['history'].selectAll('fromBuyerToSeller) AS volume or similar, but i'm stuck on this.
thanks.
still it would be last trade volume in BTC or MC, how do you set 24H volume in BTC as 99% exchange have.
"still it would be last trade volume in BTC or MC"
Sorry, your answers really doesn't help solving issue posted
May it not help but states a true fact tho
@kokucrypto you provide not so convincing screenshot with zero amounts.
On my exchange without special modifications amounts correct from the start, in that coins, that listed...
@CryptorClub Of course, but your vol is displayed in total coins amount buy/sell, not in BTC.
So, your table display: Coin - Price - Vol - CH
What i would like to display is: Coin - Price - BTCvol - CH
That's why i think the string to be modify to allow BTCvolu is this one: From index.js: const vol = (message.coins[i].volume*1).toFixed(8);
here you go:
add
let vol24 = (message.coins[i].dailyVolume2*1).toFixed(8);
to:
https://github.com/3s3s/opentrade/blob/master/static_pages/js/index.js#L326
then
add
rows[i].dailyVolume2 = g_History24[tick].BTCVolume;
to
https://github.com/3s3s/opentrade/blob/master/server/modules/users/market.js#L96
change
https://github.com/3s3s/opentrade/blob/master/server/modules/api/v1.js#L215
to
g_constants.dbTables['history'].selectAll('max(fromBuyerToSeller/fromSellerToBuyer) AS Height, min(fromBuyerToSeller/fromSellerToBuyer) AS Low, sum(fromSellerToBuyer) AS Volume, avg(price) AS BTCVolume', WHERE, 'GROUP BY coin', (err, rows) => {
then
https://github.com/3s3s/opentrade/blob/master/server/modules/api/v1.js#L221
to
let retData = {MarketName: MarketName, High: 0, Low: 0, Volume: 0, BTCVolume: 0, Last: 0, Bid: 0, Ask: 0, OpenBuyOrders: 0, OpenSellOrders: 0, coin_icon_src: coin_icon_src, coin_info: coin_info}
finally
above https://github.com/3s3s/opentrade/blob/master/server/modules/api/v1.js#L225
add
retData.BTCVolume = ((rows[0].BTCVolume*1)*(rows[0].Volume*1)).toFixed(8);
Something missed with this line: rows[i].dailyVolume2 = g_History24[tick].BTCVolume;
"tick" MC, BTC, LTC - is not defined
oops sorry, just above it let tick = rows[i].ticker;
@jonn4y
Added everything but cames out with this:
TypeError: Cannot read property 'BTCVolume' of undefined on market.js
This is what i added on market.js:
let tick = rows[i].ticker; rows[i].dailyVolume2 = g_History24[tick].BTCVolume;
Just a consideration, after declared in index.js: let vol24 = (message.coins[i].dailyVolume2*1).toFixed(8);
I suppose i need also to declare it here(always on index.js): .append($('
But i'm still get error about "Cannot read property 'BTCVolume' of undefined" on market.js after added:
let tick = rows[i].ticker; rows[i].dailyVolume2 = g_History24[tick].BTCVolume;
Please @jonn4y i'm getting mad about it
did you add BTCVolume to the v1 api file?
@kokucrypto
https://altmarkets.cc/api/v1/public/getmarketsummary?market=BTC-WFF
you must add BTCVolume to the api as that is what is called in the markets.js file
Index.js let vol24 = (message.coins[i].dailyVolume2*1).toFixed(8); .append($(''+vol24+''))
Market.js: let tick = rows[i].ticker; rows[i].dailyVolume2 = g_History24[tick].BTCVolume;
Api.js: g_constants.dbTables['history'].selectAll('max(fromBuyerToSeller/fromSellerToBuyer) AS Height, min(fromBuyerToSeller/fromSellerToBuyer) AS Low, sum(fromSellerToBuyer) AS Volume, avg(price) AS BTCVolume', WHERE, 'GROUP BY coin', (err, rows) => {
let retData = {MarketName: MarketName, High: 0, Low: 0, Volume: 0, BTCVolume: 0, Last: 0, Bid: 0, Ask: 0, OpenBuyOrders: 0, OpenSellOrders: 0, coin_icon_src: coin_icon_src, coin_info: coin_info}
And.....
retData.High = (rows[0].Height*1).toFixed(8);
retData.Low = (rows[0].Low*1).toFixed(8);
retData.Volume = (rows[0].Volume*1).toFixed(8);
retData.BTCVolume = (rows[0].BTCVolume*1).toFixed(8);
Api returns:
So, api looks like correct
But relaunching script after made all modification it returns:
TypeError: Cannot read property 'BTCVolume' of undefined on market.js
i see the issue causing the error
you are calling
retData.BTCVolume = (rows[0].BTCVolume*1).toFixed(8);
but there is no BTCVolume in the rows array you need to change it to
retData.BTCVolume = (g_History24[tick].BTCVolume*1).toFixed(8);
as the array g_History24 calls the API
one other thing i see is in your index.js
let vol24 = (message.coins[i].dailyVolume2*1).toFixed(8);
should be
let vol24 = (message.coins[i].BTCVolume*1).toFixed(8);
as you have named your retData as BTCVolume where as mine was dailyVolume2 but you need to fix the above first then it will work
By changing retData.BTCVolume = (rows[0].BTCVolume1).toFixed(8); With retData.BTCVolume = (g_History24[tick].BTCVolume1).toFixed(8);
Even BTCVolume on chart disappear as well as all other values.
Basically following your previous steps everything is correct: here you go:
add
let vol24 = (message.coins[i].dailyVolume2*1).toFixed(8);
to:
https://github.com/3s3s/opentrade/blob/master/static_pages/js/index.js#L326
then
add
rows[i].dailyVolume2 = g_History24[tick].BTCVolume;
to
https://github.com/3s3s/opentrade/blob/master/server/modules/users/market.js#L96
change
https://github.com/3s3s/opentrade/blob/master/server/modules/api/v1.js#L215
to
g_constants.dbTables['history'].selectAll('max(fromBuyerToSeller/fromSellerToBuyer) AS Height, min(fromBuyerToSeller/fromSellerToBuyer) AS Low, sum(fromSellerToBuyer) AS Volume, avg(price) AS BTCVolume', WHERE, 'GROUP BY coin', (err, rows) => {
then
https://github.com/3s3s/opentrade/blob/master/server/modules/api/v1.js#L221
to
let retData = {MarketName: MarketName, High: 0, Low: 0, Volume: 0, BTCVolume: 0, Last: 0, Bid: 0, Ask: 0, OpenBuyOrders: 0, OpenSellOrders: 0, coin_icon_src: coin_icon_src, coin_info: coin_info}
finally
above https://github.com/3s3s/opentrade/blob/master/server/modules/api/v1.js#L225
add
retData.BTCVolume = ((rows[0].BTCVolume1)(rows[0].Volume*1)).toFixed(8);
It's just that i'm not able to copy 24h BTCvolume on chart on
As it still display coins volume but not BTCVolume as in chart.
Because i'm getting always on market.js same issue: TypeError: Cannot read property 'BTCVolume' of undefined on market.js
Even by following your last comment. Getting mad lol, is there a way to talk privately to solve my night nightmare issue? @jonn4y
Regards.
@kokucrypto are you in our discord still? if so drop me a pm and we can go over it
Ok, thanks
Hello,
I basically found the string to display market volume on BTC instead of coins amount traded, but dunno how to call back fromBuyertoSeller on this string to allow volume on market table to be display on BTC.
From index.js: const vol = (message.coins[i].volume*1).toFixed(8);
This is where i should call fromBuyerToSeller SUM to display btc volume, but i'm getting crazy.