Trading Articles
Article Categories
Article Tools
Ninjatrader Telegram Addon
Updated October 11, 2020
Top Posters
looks_one
sam028
with 5 posts (6 thanks)
looks_two
darkmarine
with 2 posts (0 thanks)
looks_3
cutzpr
with 2 posts (0 thanks)
looks_4
cls71
with 1 posts (0 thanks)
trending_up
3,406 views
thumb_up
6 thanks given
group
10 followers
forum
10 posts
attach_file
0 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
(login for full post details)
#2 (permalink )
Site Moderator
Posts: 3,676 since Jun 2009
Thanks: 3,790 given,
4,508
received
cutzpr
I'll try something during the next weeks.
If I forgot send me a reminder .
Success requires no deodorant! (Sun Tzu)
The following 2 users say Thank You to sam028 for this post:
(login for full post details)
#3 (permalink )
Vancouver
Posts: 29 since Apr 2018
Thanks: 19 given,
9
received
sam028
I'll try something during the next weeks.
If I forgot send me a reminder
.
Reminder ! Let’s work together guys and figure it out
Sent using the futures.io mobile app
(login for full post details)
#4 (permalink )
Site Moderator
Posts: 3,676 since Jun 2009
Thanks: 3,790 given,
4,508
received
supreme23
It's more painful than expected, and when you have things like this:
'Flood prevention. Telegram now requires your program to do requests again only after 62734 seconds have passed (TimeToWait property). If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.'
it's not helping.
Wait & see...
Success requires no deodorant! (Sun Tzu)
The following user says Thank You to sam028 for this post:
(login for full post details)
#5 (permalink )
United States
Experience: None
Platform: MT4,TWS,Ninja Trader
Trading: Forex
Posts: 35 since Apr 2012
Thanks: 10 given,
10
received
sam028
It's more painful than expected, and when you have things like this:
'Flood prevention. Telegram now requires your program to do requests again only after 62734 seconds have passed (TimeToWait property). If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.'
it's not helping.
Wait & see...
Any luck? I appreciate you taking on this endeavor.
(login for full post details)
#6 (permalink )
Site Moderator
Posts: 3,676 since Jun 2009
Thanks: 3,790 given,
4,508
received
cutzpr
Any luck? I appreciate you taking on this endeavor.
I gave up, too many bugs in the C# libraries.
I tried with some Python libraries and it was much better but it will require to integrate this in C# code which I haven't done. One day maybe...
Success requires no deodorant! (Sun Tzu)
(login for full post details)
#7 (permalink )
Site Moderator
Posts: 3,676 since Jun 2009
Thanks: 3,790 given,
4,508
received
At the end the solution I used was:
- one .exe program, which can be use in command line, which send a Telegram message
- a strategY/indicator which calls this .exe when needed
The .exe code:
Code
namespace TelegramSam
{
class Program {
static int Main ( string [] args ) {
if ( args . Length != 3 ) {
Console . WriteLine ( "Please enter your API token, your chatID and the message." );
Console . WriteLine ( "Usage: TeleLennard <bottoken <chatID> <test to send>" );
return 1 ;
}
ServicePointManager . Expect100Continue = true ;
ServicePointManager . SecurityProtocol = SecurityProtocolType . Tls12 ;
string apiToken = args [ 0 ];
string chatId = args [ 1 ];
string message = args [ 2 ];
var toto = "https://api.telegram.org/" + apiToken + "/sendMessage?chat_id=" + chatId + "&text=" + message ;
WebRequest request = WebRequest . Create ( toto );
Stream rs = request . GetResponse (). GetResponseStream ();
StreamReader reader = new StreamReader ( rs );
string line = "" ;
StringBuilder sb = new StringBuilder ();
while ( line != null ) {
line = reader . ReadLine ();
if ( line != null )
sb . Append ( line );
}
string response = sb . ToString ();
Console . WriteLine ( message );
return 0 ;
}
}
}
The NinjaScript:
Code
public class TeleTest : Strategy
{
string apiToken = "botXXX" ;
string chatId = "0123456798" ;
string a = "Is Sam" ;
string b = "a genius" ;
string c = "or what?" ;
string msg ;
string exeToRun = @ "C:\Users\sam\Source\repos\Tele\bin\Release\Tele.exe" ;
private void sendToTelegram ( object msg ){
ProcessStartInfo startInfo = new ProcessStartInfo ();
startInfo . FileName = exeToRun ;
startInfo . Arguments = apiToken + " " + chatId + " " + msg ;
startInfo . WindowStyle = ProcessWindowStyle . Hidden ;
Process . Start ( startInfo );
}
protected override void Initialize ()
{
CalculateOnBarClose = true ;
Thread thread = new Thread ( sendToTelegram );
msg = "\"" + a + " " + b + " " + c + "\"" ;
thread . Start ( msg );
}
}
Success requires no deodorant! (Sun Tzu)
The following 3 users say Thank You to sam028 for this post:
(login for full post details)
#8 (permalink )
Site Moderator
Sarasota FL
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Posts: 6,459 since Jan 2013
Thanks: 48,936 given,
21,596
received
cls71
This article (in spanish) explains step by step how to send messages (text & images ) to Telegram from
NinjaTrader 8.
Hi @cls71
I have had to delete your message, because it contains a link to your company web site, where you offer paid services and courses in addition to the information about Telegram.
Forum rules to not allow a vendor to post links to their web site or otherwise do anything that could promote their products or services.
You may not have intended to violate the rules, but this requirement must be enforced to ensure a commercial-free environment in the forum.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote
(login for full post details)
#9 (permalink )
NEW BRUNSWICK
Experience: Intermediate
Platform: ninjatrader
Trading: nq
Posts: 11 since Jun 2020
Thanks: 2 given,
0
received
sam028
At the end the solution I used was:
- one .exe program, which can be use in command line, which send a Telegram message
- a strategY/indicator which calls this .exe when needed
The .exe code:
Code
namespace TelegramSam
{
class Program {
static int Main ( string [] args ) {
if ( args . Length != 3 ) {
Console . WriteLine ( "Please enter your API token, your chatID and the message." );
Console . WriteLine ( "Usage: TeleLennard <bottoken <chatID> <test to send>" );
return 1 ;
}
ServicePointManager . Expect100Continue = true ;
ServicePointManager . SecurityProtocol = SecurityProtocolType . Tls12 ;
string apiToken = args [ 0 ];
string chatId = args [ 1 ];
string message = args [ 2 ];
var toto = "https://api.telegram.org/" + apiToken + "/sendMessage?chat_id=" + chatId + "&text=" + message ;
WebRequest request = WebRequest . Create ( toto );
Stream rs = request . GetResponse (). GetResponseStream ();
StreamReader reader = new StreamReader ( rs );
string line = "" ;
StringBuilder sb = new StringBuilder ();
while ( line != null ) {
line = reader . ReadLine ();
if ( line != null )
sb . Append ( line );
}
string response = sb . ToString ();
Console . WriteLine ( message );
return 0 ;
}
}
}
The NinjaScript:
Code
public class TeleTest : Strategy
{
string apiToken = "botXXX" ;
string chatId = "0123456798" ;
string a = "Is Sam" ;
string b = "a genius" ;
string c = "or what?" ;
string msg ;
string exeToRun = @ "C:\Users\sam\Source\repos\Tele\bin\Release\Tele.exe" ;
private void sendToTelegram ( object msg ){
ProcessStartInfo startInfo = new ProcessStartInfo ();
startInfo . FileName = exeToRun ;
startInfo . Arguments = apiToken + " " + chatId + " " + msg ;
startInfo . WindowStyle = ProcessWindowStyle . Hidden ;
Process . Start ( startInfo );
}
protected override void Initialize ()
{
CalculateOnBarClose = true ;
Thread thread = new Thread ( sendToTelegram );
msg = "\"" + a + " " + b + " " + c + "\"" ;
thread . Start ( msg );
}
}
Hello
Could you check the below code to see if you could find out why is not working
//Set-up for telegram BOT
private DateTime dateTime;
private string botUrl = "https://api.telegram.org/bot{0}/sendMessage?chat_id={1}&text={2}";
private string apiKey = "4902146:AAHrSh0GVj_2TDeGiXiSDTr0DVKsF02y9J A";
private string chatId = "-1001278608";
private string messageText = "";
private string instrumentName = "";
private string contractMonth = "";
private string signalSeries = "";
private string CurrentDate = "";
private string dataSeriesDate = "";
private string indicatorName = "HeikenAshi CandleSticks Entry \n";
/For Telegram Bot
if (CurrentDate == dataSeriesDate && TelegramAlert == true)
{
signalSeries = indicatorName + instrumentName + " " + contractMonth + " " + vCall.ToString() + " CE";
messageText = signalSeries;
botUrl = "https://api.telegram.org/bot{0}/sendMessage?chat_id={1}&text={2}";
botUrl = String.Format(botUrl, apiKey, chatId, messageText);
WebRequest request = WebRequest.Create(botUrl);
request.GetResponse();
(login for full post details)
#10 (permalink )
Site Moderator
Posts: 3,676 since Jun 2009
Thanks: 3,790 given,
4,508
received
Hard to say without more details about the error message.
Success requires no deodorant! (Sun Tzu)
(login for full post details)
#11 (permalink )
NEW BRUNSWICK
Experience: Intermediate
Platform: ninjatrader
Trading: nq
Posts: 11 since Jun 2020
Thanks: 2 given,
0
received
sam028
Hard to say without more details about the error message.
Don’t get a error just don’t get any message in telegram
Last Updated on October 11, 2020
Right now
Ongoing
Right now
April
Elite only