Hi there,
Is it possible to make a telegram group where I get some signals from my trading bot? And Is it possible to send a telegram message when there is a buying opportunity?
And were do I find all this information?
I found this one:
https://lean-api-docs.netlify.app/classQuantConnect_1_1Notifications_1_1NotificationTelegram.html
But how do I put this in my code?
{
//PLACING ORDER
var quantity = NormalizeQuantity(symbol, btcAmount / data[symbol].Close);
//var msg = $"\n\n AANKOOP ter waarde van {btcAmount} BTC | {symbol} Hoeveelheid: {quantity} voor een bedrag van {usdAmount} euro | Aankoopprijs {symbol} van {data[symbol].Price}BTC\n\n";
//Log(msg);
//Debug(msg);
if (quantity == 0) continue;
MarketOrder(symbol, quantity);
Plot("Trades", "AANKOOP", price);
Debug($"\n\n ********** AANKOOP: {symbol} aankoopprijs {data[symbol].Price} ter waarde van {usdAmount}euro **********\n\n"); // Als het order gemaakt is word dit bevestigd door de debug
//Notify.Email("***@gmail.com", "TradeAlert",$"Gekocht {symbol} op {data[symbol].Price}");
Log($"prijs {price} en Max 24uur {symbolData.MaxExchange} en MIN 24uur {symbolData.MinExchange}");
symbolData.TargetPrice = price * (1 + _targetPercent); //DETERMINE WICH SELLING PRICE WHEN PROFIT.
symbolData.StopPrice = price * (1 - _stopPercent); //DETERMINE WICH SELLING PRICE WHEN LOSS.
}
Thanks in advance.
Greetings,
David
Fred Painchaud
Hi David,
Check this out:
https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/LiveFeaturesAlgorithm.py
Instead of calling self.Notify.Email(), you would call self.Notify.Telegram().
Out-of-the-box, you cannot receive from Telegram in your algo, you can only send to Telegram from it. Accessing and parsing Telegram messages from the algo has not been implemented.
Fred
Mak K
Hi Vronghel,
As far as I know you do not need to put anything in your code for this, simply run your trading algorithm on a paper trading node or live node if you also want to automatically enter the trades, if you only want to use it for the group signal or discretionary entry then run it on the paper trading one, when you choose to go live there is an option to send telegram notifications, let me walk you through the steps;
First you will need to purchase a live trading node and a researcher seat;
Then you need to go to the algorithm that you want to send the signals for, click on “Go Live” in the top right corner;
Once you are there you need to select the Paper Trading Brokerage or any brokerage of your choice if you want to automatically take the trades with real cash, once you have done that you need to check mark “Order Events” under the “Notifications" tab and then click on telegram and enter your telegram group ID and hit deploy;
Thanks!
Vronghel
Thanks Fred Painchaud for your answer and thanks Mak K for your extensive and complete answer.
I gonna I gonna try both options and see whats best for me.
Thanks u guys again. 😊
Mak K
vronghel
You're very welcome!
Vronghel
I implemented telegram like this:
personal id on telegram: -1001559247635
Id bot on telegram : 5087994843:AAGz-tc6Jc5rXuHtNSQcWAJVZygTlZSpUdL
For further information look this link:
https://lean-api-docs.netlify.app/Notification_8cs_source.html
Vronghel
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!