Ninjatrader Telegram Addon - futures io
futures io futures trading



Ninjatrader Telegram Addon


Discussion in NinjaTrader

Updated by sam028
      Top Posters
    1. looks_one sam028 with 4 posts (5 thanks)
    2. looks_two cutzpr with 2 posts (0 thanks)
    3. looks_3 supreme23 with 1 posts (0 thanks)
    4. looks_4 i4traders with 1 posts (0 thanks)
    1. trending_up 1,592 views
    2. thumb_up 5 thanks given
    3. group 7 followers
    1. forum 6 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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)
United States
 
Experience: None
Platform: MT4,TWS,Ninja Trader
Trading: Forex
 
cutzpr's Avatar
 
Posts: 32 since Apr 2012
Thanks: 10 given, 9 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

Reply With Quote

 
 
(login for full post details)
  #2 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,758 given, 4,438 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)
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)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,758 given, 4,438 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)
United States
 
Experience: None
Platform: MT4,TWS,Ninja Trader
Trading: Forex
 
cutzpr's Avatar
 
Posts: 32 since Apr 2012
Thanks: 10 given, 9 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.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,758 given, 4,438 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)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,758 given, 4,438 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 2 users say Thank You to sam028 for this post:


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


June 25, 2020


Upcoming Webinars and Events
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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