S
S
Smugl912018-04-13 16:36:10
API
Smugl91, 2018-04-13 16:36:10

How to isolate a bid ask from the exchange using the API?

Hello. Please tell me what is the error in writing the script. Thanks in advance!
function stok(asset,option){
if (option == undefined){
var option = 'last';
}
else {
option = option.toLowerCase().trim();
}
var asset = asset;
var data = loadJSON(' https://stocks.exchange/api2/ticker ');
for (var i=0; i < data.length; i++){
var symbol = data['market_name'];
symbol = symbol.toLowerCase().trim();
if (asset == symbol){
var value = data[option];
return value;
}
}
}
5ad0b1dd705a8255484654.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question