Ninjatrader Telegram Addon - futures io
futures io



Ninjatrader Telegram Addon


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one sam028 with 5 posts (6 thanks)
    2. looks_two darkmarine with 2 posts (0 thanks)
    3. looks_3 cutzpr with 2 posts (0 thanks)
    4. looks_4 cls71 with 1 posts (0 thanks)
    1. trending_up 3,406 views
    2. thumb_up 6 thanks given
    3. group 10 followers
    1. forum 10 posts
    2. 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)

 
Search this Thread
 

Ninjatrader Telegram Addon

(login for full post details)
  #1 (permalink)
 cutzpr 
United States
 
Experience: None
Platform: MT4,TWS,Ninja Trader
Trading: Forex
 
cutzpr's Avatar
 
Posts: 35 since Apr 2012
Thanks: 10 given, 10 received

Any experienced programmers willing to build a Telegram messaging Addon Share Service for Ninja trader? Telegram is one of the only full blown messaging apps that have an API. There's a ton of different API solutions people have already built to use with C#, unfortunately I am not talented enough to do it myself.

https://telegram.org/
https://core.telegram.org/api
https://github.com/sochix/TLSharp
https://github.com/TelegramBots/Telegram.Bot
https://github.com/everbytes/SharpTelegram/blob/master/README.md

Started this thread Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(311 thanks from 30 posts)
looks_twoSalao's Journalby Salao
(81 thanks from 13 posts)
looks_3Deeteeís DAX Trading Journal (time based)by Deetee
(50 thanks from 21 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(38 thanks from 16 posts)
looks_5Maybe a little bit different journalby Malykubo
(17 thanks from 18 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
The Crude Dude Oil Trading System
116 thanks
Big Mike in Ecuador
45 thanks
Help improve the FIO community
38 thanks
Next New Poll Ideas/Suggestions
20 thanks
futures io site changelog and issues/problem reporting
17 thanks
 
(login for full post details)
  #2 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,676 since Jun 2009
Thanks: 3,790 given, 4,508 received


cutzpr View Post
Any experienced programmers willing to build a Telegram messaging Addon Share Service for Ninja trader? Telegram is one of the only full blown messaging apps that have an API. There's a ton of different API solutions people have already built to use with C#, unfortunately I am not talented enough to do it myself.

https://telegram.org/
https://core.telegram.org/api
https://github.com/sochix/TLSharp
https://github.com/TelegramBots/Telegram.Bot
https://github.com/everbytes/SharpTelegram/blob/master/README.md

I'll try something during the next weeks.
If I forgot send me a reminder .

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following 2 users say Thank You to sam028 for this post:
 
(login for full post details)
  #3 (permalink)
supreme23
Vancouver
 
 
Posts: 29 since Apr 2018
Thanks: 19 given, 9 received



sam028 View Post
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

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,676 since Jun 2009
Thanks: 3,790 given, 4,508 received


supreme23 View Post
Reminder ! Letís work together guys and figure it out


Sent using the futures.io mobile app

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)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #5 (permalink)
 cutzpr 
United States
 
Experience: None
Platform: MT4,TWS,Ninja Trader
Trading: Forex
 
cutzpr's Avatar
 
Posts: 35 since Apr 2012
Thanks: 10 given, 10 received


sam028 View Post
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.

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,676 since Jun 2009
Thanks: 3,790 given, 4,508 received


cutzpr View Post
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)
Follow me on Twitter Reply With Quote
 
(login for full post details)
  #7 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
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)
Follow me on Twitter Reply With Quote
The following 3 users say Thank You to sam028 for this post:
 
(login for full post details)
  #8 (permalink)
 bobwest 
Site Moderator
Sarasota FL
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
 
bobwest's Avatar
 
Posts: 6,459 since Jan 2013
Thanks: 48,936 given, 21,596 received


cls71 View Post
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
Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
 darkmarine 
NEW BRUNSWICK
 
Experience: Intermediate
Platform: ninjatrader
Trading: nq
 
Posts: 11 since Jun 2020
Thanks: 2 given, 0 received


sam028 View Post
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();

Reply With Quote
 
(login for full post details)
  #10 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
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)
Follow me on Twitter Reply With Quote
 
(login for full post details)
  #11 (permalink)
 darkmarine 
NEW BRUNSWICK
 
Experience: Intermediate
Platform: ninjatrader
Trading: nq
 
Posts: 11 since Jun 2020
Thanks: 2 given, 0 received


sam028 View Post
Hard to say without more details about the error message.

Donít get a error just donít get any message in telegram

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Ninjatrader Telegram Addon


Last Updated on October 11, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

An Introduction to CME Group Micro Bitcoin Futures w/David Lerman

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts