//THREE_STRINGS_AND_DOUBLE(tradebot,monitor,exchange,base,rel,commission);
var Tradebot_monitor_api=function(){
var exchange=$('#Tradebot_exchange').val();
var base=$('#Tradebot_base').val();
var rel=$('#Tradebot_rel').val();
var commission=$('#Tradebot_commission').val();
var request='{"agent":"tradebot","method":"monitor","exchange":"'+exchange+'","base":"'+base+'","rel":"'+rel+'", "commission":'+commission+'}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
//console.log("Monitor called");
};
var set_Tradebot_monitor_table=function(){
var html='
Base:
Rel:
Commission:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//STRING_AND_DOUBLE(tradebot,monitorall,exchange,commission);
var Tradebot_monitorall_api=function(){
var exchange=$('#Tradebot_exchange').val();
var commission=$('#Tradebot_commission').val();
var request='{"agent":"tradebot","method":"monitorall","exchange":"'+exchange+'","commission":'+commission+'}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_monitorall_table=function(){
var html='
Commission:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//THREE_STRINGS(tradebot,unmonitor,exchange,base,rel);
var Tradebot_unmonitor_api=function(){
var exchange=$('#Tradebot_exchange').val();
var base=$('#Tradebot_base').val();
var rel=$('#Tradebot_rel').val();
//var commission=$('#Tradebot_commission').val();
var request='{"agent":"tradebot","method":"unmonitor","exchange":"'+exchange+'","base":"'+base+'","rel":"'+rel+'"}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
//console.log("Monitor called");
};
var set_Tradebot_unmonitor_table=function(){
var html='
Base:
Rel:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//THREE_STRINGS_AND_THREE_DOUBLES(tradebot,accumulate,exchange,base,rel,price,volume,duration);
var Tradebot_accumulate_api=function(){
var exchange=$('#Tradebot_exchange').val();
var base=$('#Tradebot_base').val();
var rel=$('#Tradebot_rel').val();
var price=$('#Tradebot_price').val();
var volume=$('#Tradebot_volume').val();
var duration=$('#Tradebot_duration').val();
var request='{"agent":"tradebot","method":"accumulate","exchange":"'+exchange+'","base":"'+base+'","rel":"'+rel+'", "price":'+price+',"volume":'+volume+',"duration":'+duration+' }';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_accumulate_table=function(){
var html='
Base:
Rel:
Price:
Volume:
Duration:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//THREE_STRINGS_AND_THREE_DOUBLES(tradebot,divest,exchange,base,rel,price,volume,duration);
var Tradebot_divest_api=function(){
var exchange=$('#Tradebot_exchange').val();
var base=$('#Tradebot_base').val();
var rel=$('#Tradebot_rel').val();
var price=$('#Tradebot_price').val();
var volume=$('#Tradebot_volume').val();
var duration=$('#Tradebot_duration').val();
var request='{"agent":"tradebot","method":"divest","exchange":"'+exchange+'","base":"'+base+'","rel":"'+rel+'", "price":'+price+',"volume":'+volume+',"duration":'+duration+' }';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_divest_table=function(){
var html='
Base:
Rel:
Price:
Volume:
Duration:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//STRING_ARG(tradebot,activebots,exchange);
var Tradebot_activebots_api=function(){
var exchange=$('#Tradebot_exchange').val();
var request='{"agent":"tradebot","method":"activebots","exchange":"'+exchange+'"}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_activebots_table=function(){
var html='
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//TWO_STRINGS(tradebot,status,exchange,botid);
var Tradebot_status_api=function(){
var exchange=$('#Tradebot_exchange').val();
var botid=$('#Tradebot_botid').val();
var request='{"agent":"tradebot","method":"status","exchange":"'+exchange+'","botid":"'+botid+'"}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_status_table=function(){
var html='
Botid:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//TWO_STRINGS(tradebot,pause,exchange,botid);
var Tradebot_pause_api=function(){
var exchange=$('#Tradebot_exchange').val();
var botid=$('#Tradebot_botid').val();
var request='{"agent":"tradebot","method":"pause","exchange":"'+exchange+'","botid":"'+botid+'"}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_pause_table=function(){
var html='
Botid:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//TWO_STRINGS(tradebot,stop,exchange,botid);
var Tradebot_stop_api=function(){
var exchange=$('#Tradebot_exchange').val();
var botid=$('#Tradebot_botid').val();
var request='{"agent":"tradebot","method":"stop","exchange":"'+exchange+'","botid":"'+botid+'"}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_stop_table=function(){
var html='
Botid:
Exchange:
';
$('#tradebot_input').html(html);
if(exchanges!==""){
$('#Tradebot_exchange').html(exchanges);
if(SPNAPI.settings.prefferedExchange!==""){
changePrefferedEx("Tradebot_exchange");}
}
};
//TWO_STRINGS(tradebot,resume,exchange,botid);
var Tradebot_resume_api=function(){
var exchange=$('#Tradebot_exchange').val();
var botid=$('#Tradebot_botid').val();
var request='{"agent":"tradebot","method":"resume","exchange":"'+exchange+'","botid":"'+botid+'"}';
SPNAPI.makeRequest(request, function(request,response){
show_tradebot_resposnse(response);
}
);
};
var set_Tradebot_resume_table=function(){
var html='