var payout = "60"; payout = +payout; var xValues = []; var yValues = []; var x = 0; var realchart = new Chart("myChart", { type: "line", data: { labels: xValues, datasets: [{ fill: false, lineTension: 0, backgroundColor: "rgba(0,0,255,1.0)", borderColor: "green", data: yValues }] }, options: { legend: {display: false}, } }); setInterval(function(){ x = x + 1; fetch("https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT", {cache: "no-store", }) .then(response => response.json()) .then(data => { var round1 = +data.price; yValues.push(round1) ; xValues.push(x); }); setTimeout(function(){realchart.update();}, 1000); //if(x>10){xValues.shift();yValues.shift();x = 0;} }, 1000); var plus = 5; var getbudget = "1,2,3,4,5,10,15,20,25,50" ; var budget = getbudget.split(","); document.getElementById("plus").addEventListener("click", function(){ plus++; if(plus>budget.length-1){plus=budget.length-1 ;} document.getElementById("amount").value = budget[plus]; var rereturn = +budget[plus]*payout/100; rereturn = rereturn + +budget[plus]; rereturn=rereturn.toFixed(2);document.getElementById("return").innerHTML ="$" + rereturn; document.getElementById("profit").innerHTML = "+" + +budget[plus]*payout/100;}); document.getElementById("minus").addEventListener("click", function(){ plus--; if(plus<0){plus=0;} document.getElementById("amount").value = budget[plus];var rereturnmin = +budget[plus]*payout/100; rereturnmin = rereturnmin + +budget[plus]; rereturnmin=rereturnmin.toFixed(2); document.getElementById("return").innerHTML ="$" + rereturnmin; document.getElementById("profit").innerHTML = "+" + +budget[plus]*payout/100;}); var timer = 30; timer = +timer; var maxtime = 75; maxtime = +maxtime; document.getElementById("timeplus").addEventListener("click", function(){ if(timer>19){ timer = timer+5 } else{timer = timer + 1;}; if(timer>maxtime){timer=maxtime;};document.getElementById("timing").innerHTML = timer +" " + "seconds";}); document.getElementById("timeminus").addEventListener("click", function(){ if(timer>24){ timer = timer-5 } else{timer = timer - 1;}; if(timer<30){timer=30;}; document.getElementById("timing").innerHTML = timer +" "+"seconds";}); var firstprice = []; var lastprice = []; var balance = 1000; var hiprice = 0; var bud = +budget[plus]; var nl = 0; var orde = 0; document.getElementById("hi").addEventListener("click", function(){ orde++; bud = +budget[plus]; if(balance>bud || balance == bud){ nl++; balance = balance - bud; document.getElementById("balance").innerHTML = balance.toFixed(2) ; var timeup = +timer; var httime = timer; var fnh = nl; var ordre = orde; document.getElementById("open").innerHTML += "

"+ "" + bud + "" ; document.getElementById("timer").innerHTML += "

"+ "" + httime + "" ; document.getElementById("close").innerHTML += "

"+" " ; var myhiInterval = setInterval(function(){ document.getElementById(fnh).innerHTML = httime-- ; if(httime<0){clearInterval(myhiInterval);}; }, 1000); fetch("https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT", {cache: "no-store", }) .then(response => response.json()) .then(data => { var round2 = +data.price ; firstprice.push(round2) ; console.log("firstprice", firstprice); }); document.getElementById("iframes").setAttribute("src", "frame.php?lohi=hi&amount="+bud+"&time="+timeup); //setTimeout(function(){document.getElementById('iframes').contentWindow.location.reload();}, 1000); setTimeout(function(){ fetch("https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT", {cache: "no-store", }) .then(response => response.json()) .then(data => {var round3 = +data.price; lastprice.push(round3) ; console.log("lastprice", lastprice); }); document.getElementById("iframes").setAttribute("src", "frame.php?last=1"); //setTimeout(function(){document.getElementById('iframes').contentWindow.location.reload();}, 1000); setTimeout(function(){ if(lastprice[hiprice]>firstprice[hiprice]){ document.getElementById("cl"+ordre).innerHTML = +bud*payout/100 ; balance = balance + bud + bud*payout/100; document.getElementById("balance").innerHTML = balance.toFixed(2) ; } else{ document.getElementById("cl"+ordre).innerHTML = 0 ; }; hiprice = hiprice + 1; }, 1000); }, timeup*1000); }; }); var lastloprice = [] ; var firstloprice = [] ; var loprice = 0; var lotime = []; document.getElementById("lo").addEventListener("click", function(){ orde++; var redordre = orde; bud = +budget[plus]; if(balance>bud || balance == bud){ balance = balance - bud; nl++; var timedown = +timer; var ttime = timer; var lofnl = nl; document.getElementById("balance").innerHTML = balance.toFixed(2) ; document.getElementById("timer").innerHTML += "

"+ "" + ttime + "" ; var myInterval = setInterval(function(){ document.getElementById(lofnl).innerHTML = ttime-- ; if(ttime<0){clearInterval(myInterval);}; }, 1000); document.getElementById("open").innerHTML += "

"+ "" + bud + ""; document.getElementById("close").innerHTML += "

"+" " ; fetch("https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT", {cache: "no-store", }) .then(response => response.json()) .then(data => { var round4 = +data.price; firstloprice.push(round4) ; console.log("firstloprice", firstloprice); }); document.getElementById("iframes").setAttribute("src", "frame.php?lohi=lo&amount="+bud+"&time="+timedown); //setTimeout(function(){document.getElementById('iframes').contentWindow.location.reload();}, 1000); setTimeout(function(){ fetch("https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT", {cache: "no-store", }) .then(response => response.json()) .then(data => { var round5 = +data.price; lastloprice.push(round5) ; console.log("lastloprice", lastloprice); }); document.getElementById("iframes").setAttribute("src", "frame.php?last=1"); //setTimeout(function(){document.getElementById('iframes').contentWindow.location.reload();}, 1000); setTimeout(function(){ if( firstloprice[loprice] > lastloprice[loprice]){ document.getElementById("cl"+redordre).innerHTML = +bud*payout/100 ; balance = balance + bud + bud*payout/100; document.getElementById("balance").innerHTML = balance.toFixed(2) ; } else{ document.getElementById("cl"+redordre).innerHTML = 0 ; }; loprice = loprice + 1; }, 1000); }, +timedown*1000); }; }); setInterval(function(){ var hoursnow = (new Date()).getUTCHours()+3; if(hoursnow>24){hoursnow = hoursnow-24;} document.getElementById("timenow").innerHTML = hoursnow + ":"+ (new Date()).getUTCMinutes() + ":" + (new Date()).getUTCSeconds(); }, 1000); var nn = -1; document.getElementById("pairsdown").addEventListener("click", function(){nn++; if(nn%2!=0){document.getElementById("pairslist").style.visibility = "hidden"; document.getElementById("currencylist").style.visibility = "hidden"} else{ document.getElementById("pairslist").style.visibility = "hidden"; } }); document.getElementById("currencydiv").addEventListener("click", function(){ document.getElementById("pairslist").style.visibility = "hidden"; document.getElementById("currencylist").style.visibility = "visible"; }); document.getElementById("cryptodiv").addEventListener("click", function(){ document.getElementById("pairslist").style.visibility = "visible"; document.getElementById("currencylist").style.visibility = "hidden"; }); document.getElementById("crypdiv").addEventListener("click", function(){ document.getElementById("pairslist").style.visibility = "visible"; document.getElementById("currencylist").style.visibility = "hidden"; }); for(var i=0;i