mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-08-23 07:38:12 +00:00
revert: remove chart generation (plotters approach dropped)
Chart image via plotters looked bad and TradingView webhook can't send chart screenshots programmatically. Reverted to text-only Telegram notifications. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e285ab3ee0
commit
954cf6b8cf
+5
-14
@@ -9,42 +9,33 @@ async fn main() -> Result<()> {
|
|||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
tracing_subscriber::fmt().with_max_level(tracing::Level::INFO).init();
|
tracing_subscriber::fmt().with_max_level(tracing::Level::INFO).init();
|
||||||
|
|
||||||
let token = std::env::var("TELEGRAM_BOT_TOKEN").expect("TELEGRAM_BOT_TOKEN");
|
let token = std::env::var("TELEGRAM_BOT_TOKEN").expect("TELEGRAM_BOT_TOKEN");
|
||||||
let chat_id = std::env::var("TELEGRAM_CHAT_ID").expect("TELEGRAM_CHAT_ID").parse::<i64>()?;
|
let chat_id = std::env::var("TELEGRAM_CHAT_ID").expect("TELEGRAM_CHAT_ID").parse::<i64>()?;
|
||||||
let thread_id = std::env::var("TELEGRAM_THREAD_ID").ok().and_then(|s| s.parse::<i64>().ok());
|
let thread_id = std::env::var("TELEGRAM_THREAD_ID").ok().and_then(|s| s.parse::<i64>().ok());
|
||||||
|
|
||||||
let tg = TelegramConfig { token, chat_id, thread_id };
|
let tg = TelegramConfig { token, chat_id, thread_id };
|
||||||
let http = Client::new();
|
let http = Client::new();
|
||||||
|
|
||||||
// ── 1. Pending order placed ───────────────────────────────────────────────
|
// 1. Pending
|
||||||
tracing::info!("step 1: PENDING");
|
tracing::info!("step 1: PENDING");
|
||||||
let msg_id = tg.send(&http,
|
let msg_id = tg.send(&http,
|
||||||
"🟡 <b>PENDING</b>\nXAUUSDm Long\nEntry: 3325.50\nSL: 3320.00 TP: 3333.75\nVol: 0.03 lot RR: 1.5",
|
"🟡 <b>PENDING</b>\nXAUUSDm Long\nEntry: 3325.50\nSL: 3320.00 TP: 3333.75\nVol: 0.03 lot RR: 1.5",
|
||||||
).await?;
|
).await?;
|
||||||
tracing::info!(msg_id, "sent");
|
tracing::info!(msg_id, "sent");
|
||||||
|
|
||||||
sleep(Duration::from_secs(3)).await;
|
sleep(Duration::from_secs(3)).await;
|
||||||
|
|
||||||
// ── 2. Limit order triggered / filled ────────────────────────────────────
|
// 2. Filled
|
||||||
tracing::info!("step 2: FILLED");
|
tracing::info!("step 2: FILLED");
|
||||||
tg.edit(&http, msg_id,
|
tg.edit(&http, msg_id,
|
||||||
"⚡ <b>FILLED</b>\nXAUUSDm Long\nEntry: 3325.50\nSL: 3320.00 TP: 3333.75\nVol: 0.03 lot",
|
"⚡ <b>FILLED</b>\nXAUUSDm Long\nEntry: 3325.50\nSL: 3320.00 TP: 3333.75\nVol: 0.03 lot",
|
||||||
).await?;
|
).await?;
|
||||||
tracing::info!(msg_id, "edited");
|
|
||||||
|
|
||||||
sleep(Duration::from_secs(3)).await;
|
sleep(Duration::from_secs(3)).await;
|
||||||
|
|
||||||
// ── 3a. TP hit ────────────────────────────────────────────────────────────
|
// 3. Result
|
||||||
tracing::info!("step 3: TP HIT");
|
tracing::info!("step 3: TP HIT");
|
||||||
tg.edit(&http, msg_id,
|
tg.edit(&http, msg_id,
|
||||||
"✅ <b>TP HIT +12.68</b>\nXAUUSDm Long\n3325.50 → 3333.75\nVol: 0.03 lot\nBal: $5012.68",
|
"✅ <b>TP HIT +12.68</b>\nXAUUSDm Long\n3325.50 → 3333.75\nVol: 0.03 lot\nBal: $5012.68",
|
||||||
).await?;
|
).await?;
|
||||||
tracing::info!(msg_id, "edited TP HIT");
|
|
||||||
|
|
||||||
// uncomment to test SL hit instead:
|
|
||||||
// tg.edit(&http, msg_id,
|
|
||||||
// "❌ <b>SL HIT -7.50</b>\nXAUUSDm Long\n3325.50 → 3320.00\nVol: 0.03 lot\nBal: $4992.50",
|
|
||||||
// ).await?;
|
|
||||||
|
|
||||||
println!("\nDone ✅ check Telegram");
|
println!("\nDone ✅ check Telegram");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user