Strategy vault / Tools & templates
BTC LTC Address Monitoring SMS Notification
There are new transactions, please be reminded immediately
JavaScriptTools & templates
There are new transactions, please be reminded immediately
Parameters
| Name | Default | What it controls |
|---|---|---|
| Type | 0 | Type: BTC | LTC |
| Addr | 1LuckyY9fRzcJre7aou7ZhWVXktxjjBb9S | Address |
| Interval | 3 | Polling Interval |
| EnableSMS | false | Enable SMS notifications |
| SMSUser | *** | SMSBao username |
| SMSPass | *** | SMS MD5 password |
| PhoneNum | 1111 | Receive SMS mobile number |
Source JavaScript
var LastMsg = "";
function SMSSend(msg) {
if (msg == LastMsg) {
return true;
}
Log('SMS:', msg);
LastMsg = msg;
var ret = false;
var phones = PhoneNum.split(',');
for (var i = 0; i < phones.length; i++) {
ret = HttpQuery("http://www.smsbao.com/sms?u=" + encodeURIComponent(SMSUser) + "&p=" + SMSPass.toUpperCase() + "&m=" + phones[i] + "&c=" + encodeURIComponent(msg)) == "0";
if (ret) {
Log("SMS Notification", phones[i], "Success");
} else {
Log("SMS Notification", phones[i], "Failed");
}
}
return ret;
}
function main() {
var url = "http://open.qukuai.com/address/" + Addr + "?key=2ejf4jgfNoya8Y3GnQf68e4J23HherpUh1&limit=1";
if (Type == 1) {
url += "<c=true";
}
var lt = "";
Log("Monitor: ", Addr, Type == 0 ? 'BTC' : 'LTC');
if (EnableSMS) {
if (!SMSSend("Strategy started successfully")) {
return false;
}
}
while (true) {
try {
var res = HttpQuery(url);
if (res) {
var obj = JSON.parse(res);
if (typeof(obj.t0) !='undefined' && obj.t0.length > 0) {
if (obj.t0.toString() != lt) {
if (lt != "") {
LogProfit(obj.balance, obj.received);
if (EnableSMS) SMSSend('New Transaction, Current Balance: ' + obj.balance/100000000 + 'Total Received: ' + obj.received/100000000);
}
lt = obj.t0.toString();
}
}
}
} catch(e) {
Log(e);
}
Sleep(Interval*1000);
}
}Published by Zero on the FMZ strategy square · last modified 2014-11-07. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a tested, production-ready module from strategies/BTC-LTC-Address-Monitoring-SMS-Notification.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Binance Account Cross Transfer Small ToolJavaScript · Tools & templates
- Get cryptocurrency current and max supplyJavaScript · Tools & templates
- Interaction TemplateJavaScript · Tools & templates
- KuCoin Fund Transfer PluginJavaScript · Tools & templates
- Moving Average Bot 30 linesJavaScript · Tools & templates · 1d
- OKEx V5 Candlestick Data Paginated Query ExampleJavaScript · Tools & templates