<meta name='viewport' content='width=device-width, initial-scale=1'/><!
DOCTYPE
html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Robotmagic 2.1 - Automático</title>
<style>
body { background: #111; color: #eee; font-family: monospace; padding: 20px; }
h1 { color: #00ffcc; }
input, button {
padding: 10px;
margin: 5px 0;
width: 300px;
border: 1px solid #00ffcc;
background: #222;
color: #00ffcc;
}
button { cursor: pointer; font-weight: bold; }
#log {
background: #000;
border: 1px solid #00ffcc;
padding: 15px;
margin-top: 10px;
height: 300px;
overflow-y: scroll;
}
</style>
</head>
<body>
<h1>🤖 Robotmagic 2.1 - Operação Automática</h1>
<p>Token da Deriv (real ou demo):</p>
<input id="token" placeholder="Cole seu token aqui..." />
<button onclick="startBot()">Iniciar Robô</button>
<div id="log">Aguardando conexão...</div>
<script>
let ws, token, balance = 0, lucro = 0, perda = 0, contratoAtivo = "R_100";
let valorEntrada = 0.5, metaLucro = 1.0, limitePerda = 2.0;
let emOperacao = false;
function log(msg) {
const el = document.getElementById("log");
el.innerHTML += "<br>" + msg;
el.scrollTop = el.scrollHeight;
}
function startBot() {
token = document.getElementById("token").value.trim();
if (!token) return alert("Insira seu token.");
ws = new WebSocket("wss://ws.derivws.com/websockets/v3?app_id=1089");
ws.onopen = () => {
ws.send(JSON.stringify({ authorize: token }));
log("🔐 Conectando...");
};
ws.onmessage = (msg) => {
const data = JSON.parse(msg.data);
if (data.msg_type === "authorize") {
log("✅ Conectado: " + data.authorize.loginid);
ws.send(JSON.stringify({ balance: 1 }));
ws.send(JSON.stringify({ ticks: contratoAtivo, subscribe: 1 }));
}
if (data.msg_type === "balance") {
balance = data.balance.balance;
log("💰 Saldo atual: $" + balance.toFixed(2));
}
if (data.msg_type === "tick" && !emOperacao) {
analisarTicks(data.tick.quote);
}
if (data.msg_type === "buy") {
const id = data.buy.buy_id;
log("🟢 Compra feita. ID: " + id);
monitorarResultado(id);
}
if (data.msg_type === "proposal_open_contract") {
if (data.proposal_open_contract.status === "sold") {
const lucroOuPreju = data.proposal_open_contract.profit;
if (lucroOuPreju >= 0) {
lucro += lucroOuPreju;
log("✅ Lucro: $" + lucroOuPreju.toFixed(2));
} else {
perda += Math.abs(lucroOuPreju);
log("❌ Perda: $" + Math.abs(lucroOuPreju).toFixed(2));
}
emOperacao = false;
if (lucro >= metaLucro) {
log("🎯 Meta de lucro atingida! Robô parado.");
ws.close();
} else if (perda >= limitePerda) {
log("🛑 Limite de perda atingido! Robô parado.");
ws.close();
}
}
}
};
}
let ultimosDigitos = [];
function analisarTicks(preco) {
const digito = parseInt(preco.toString().slice(-1));
ultimosDigitos.push(digito);
if (ultimosDigitos.length > 5) ultimosDigitos.shift();
const high = ultimosDigitos.filter(d => d >= 3).length;
const low = ultimosDigitos.filter(d => d <= 2).length;
if (high >= 4) {
comprar("DIGITOVER");
} else if (low >= 4) {
comprar("DIGITUNDER");
}
}
function comprar(tipo) {
emOperacao = true;
log("🧠 Sinal detectado: " + tipo + " | Enviando ordem...");
ws.send(JSON.stringify({
buy: 1,
price: valorEntrada,
parameters: {
amount: valorEntrada,
basis: "stake",
contract_type: tipo,
currency: "USD",
duration: 1,
duration_unit: "t",
symbol: contratoAtivo
}
}));
}
function monitorarResultado(id) {
setTimeout(() => {
ws.send(JSON.stringify({
proposal_open_contract: 1,
contract_id: id
}));
}, 5000);
}
</script>
</body>
</html>
<script><!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Robotmagic 2.1 - Automático</title>
<style>
body { background: #111; color: #eee; font-family: monospace; padding: 20px; }
h1 { color: #00ffcc; }
input, button {
padding: 10px;
margin: 5px 0;
width: 300px;
border: 1px solid #00ffcc;
background: #222;
color: #00ffcc;
}
button { cursor: pointer; font-weight: bold; }
#log {
background: #000;
border: 1px solid #00ffcc;
padding: 15px;
margin-top: 10px;
height: 300px;
overflow-y: scroll;
}
</style>
</head>
<body>
<h1>🤖 Robotmagic 2.1 - Operação Automática</h1>
<p>Token da Deriv (real ou demo):</p>
<input id="token" placeholder="Cole seu token aqui..." />
<button onclick="startBot()">Iniciar Robô</button>
<div id="log">Aguardando conexão...</div>
<script>
let ws, token, balance = 0, lucro = 0, perda = 0, contratoAtivo = "R_100";
let valorEntrada = 0.5, metaLucro = 1.0, limitePerda = 2.0;
let emOperacao = false;
function log(msg) {
const el = document.getElementById("log");
el.innerHTML += "<br>" + msg;
el.scrollTop = el.scrollHeight;
}
function startBot() {
token = document.getElementById("token").value.trim();
if (!token) return alert("Insira seu token.");
ws = new WebSocket("wss://ws.derivws.com/websockets/v3?app_id=1089");
ws.onopen = () => {
ws.send(JSON.stringify({ authorize: token }));
log("🔐 Conectando...");
};
ws.onmessage = (msg) => {
const data = JSON.parse(msg.data);
if (data.msg_type === "authorize") {
log("✅ Conectado: " + data.authorize.loginid);
ws.send(JSON.stringify({ balance: 1 }));
ws.send(JSON.stringify({ ticks: contratoAtivo, subscribe: 1 }));
}
if (data.msg_type === "balance") {
balance = data.balance.balance;
log("💰 Saldo atual: $" + balance.toFixed(2));
}
if (data.msg_type === "tick" && !emOperacao) {
analisarTicks(data.tick.quote);
}
if (data.msg_type === "buy") {
const id = data.buy.buy_id;
log("🟢 Compra feita. ID: " + id);
monitorarResultado(id);
}
if (data.msg_type === "proposal_open_contract") {
if (data.proposal_open_contract.status === "sold") {
const lucroOuPreju = data.proposal_open_contract.profit;
if (lucroOuPreju >= 0) {
lucro += lucroOuPreju;
log("✅ Lucro: $" + lucroOuPreju.toFixed(2));
} else {
perda += Math.abs(lucroOuPreju);
log("❌ Perda: $" + Math.abs(lucroOuPreju).toFixed(2));
}
emOperacao = false;
if (lucro >= metaLucro) {
log("🎯 Meta de lucro atingida! Robô parado.");
ws.close();
} else if (perda >= limitePerda) {
log("🛑 Limite de perda atingido! Robô parado.");
ws.close();
}
}
}
};
}
let ultimosDigitos = [];
function analisarTicks(preco) {
const digito = parseInt(preco.toString().slice(-1));
ultimosDigitos.push(digito);
if (ultimosDigitos.length > 5) ultimosDigitos.shift();
const high = ultimosDigitos.filter(d => d >= 3).length;
const low = ultimosDigitos.filter(d => d <= 2).length;
if (high >= 4) {
comprar("DIGITOVER");
} else if (low >= 4) {
comprar("DIGITUNDER");
}
}
function comprar(tipo) {
emOperacao = true;
log("🧠 Sinal detectado: " + tipo + " | Enviando ordem...");
ws.send(JSON.stringify({
buy: 1,
price: valorEntrada,
parameters: {
amount: valorEntrada,
basis: "stake",
contract_type: tipo,
currency: "USD",
duration: 1,
duration_unit: "t",
symbol: contratoAtivo
}
}));
}
function monitorarResultado(id) {
setTimeout(() => {
ws.send(JSON.stringify({
proposal_open_contract: 1,
contract_id: id
}));
}, 5000);
}
</script>
</body>
</html>
</script>