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 cutzpr with 2 posts (0 thanks)
    3. looks_3 darkmarine with 2 posts (0 thanks)
    4. looks_4 arturo8317 with 2 posts (0 thanks)
    1. trending_up 3,926 views
    2. thumb_up 6 thanks given
    3. group 14 followers
    1. forum 13 posts
    2. attach_file 3 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)
  #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

Can you help answer these questions
from other members on futures io?
MacdBB V402 NT804 + gradient + pullback not working on N …
NinjaTrader
TradingView help in improving Anchored Vwap
Platforms and Indicators
Eurex Denali vs dxFeed
Sierra Chart
Experience with AGN (Introducing Broker)
Brokers
For the experts of Metastock
Platforms and Indicators
 
 
(login for full post details)
  #12 (permalink)
arturo8317
cali valle
 
 
Posts: 4 since May 2021
Thanks: 1 given, 0 received

hi I have the code of an indicator that sends messages with screenshots from ninjatrader to telegram but for the moment it only sends the message when I add it to the chart and I want to combine the function so that it sends the code when a short or a long or when I close an order but I don't know anything about codes and I want help to give that order to the code this is the code



#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
using System.Windows.Media.Imaging;
using System.IO;
using Telegram.Bot;

#endregion

//This namespace holds Indicators in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Indicators.Utilities
{
public class Zi8ScreenSnapShot : Indicator
{
// Token del bot que he creado desde 'BothFather' en Telegram:
private const string API_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
// Nombre del canal de Telegram donde se enviarán los mensajes (el bot tiene que
// estar autorizado como administrador en el canal):
private const string CHAT_ID = "@xxxxxxxxx";

// Variable para referenciar el Bot en Telegram:
private TelegramBotClient Bot;

// Variable para referenciar al Chart y poder capturar la pantalla:
private Chart ch;



protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "Zi8ScreenSnapShot";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;

}
else if (State == State.DataLoaded)
{
Bot = new TelegramBotClient(API_TOKEN);
}
else if (State == State.Historical)
{
if (ChartControl != null)
{
Dispatcher.BeginInvoke(new Action(() =>
{
ch = Window.GetWindow(ChartControl) as Chart;
}));
}


}
}




protected override void OnBarUpdate()
{
if (CurrentBar == 20)
{
sendCombiMessage();
}
}

private async Task sendCombiMessage()
{
Dispatcher.Invoke(new Action(async () =>
{
try
{
Chart _chart = Window.GetWindow(ChartControl) as Chart;
if (_chart != null)
{
RenderTargetBitmap screenCapture = _chart.GetScreenshot(ShareScreenshotType.Chart);
if (screenCapture == null)
return;
BitmapFrame outputframe = BitmapFrame.Create(screenCapture);
using (MemoryStream ns = new MemoryStream())
{
PngBitmapEncoder png = new PngBitmapEncoder();
png.Frames.Add(outputframe);
png.Save(ns);

byte[] bb = ns.ToArray();
MemoryStream nsbb = new MemoryStream(bb);
await Bot.SendTextMessageAsync(CHAT_ID, "orden a mercado ....");
await Bot.SendPhotoAsync(CHAT_ID, nsbb);
}
}

}



catch (Exception ex)
{
Print(ex.ToString());
}
}));
}
}}
#region NinjaScript generated code. Neither change nor remove.

namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private Utilities.Zi8ScreenSnapShot[] cacheZi8ScreenSnapShot;
public Utilities.Zi8ScreenSnapShot Zi8ScreenSnapShot()
{
return Zi8ScreenSnapShot(Input);
}

public Utilities.Zi8ScreenSnapShot Zi8ScreenSnapShot(ISeries<double> input)
{
if (cacheZi8ScreenSnapShot != null)
for (int idx = 0; idx < cacheZi8ScreenSnapShot.Length; idx++)
if (cacheZi8ScreenSnapShot[idx] != null && cacheZi8ScreenSnapShot[idx].EqualsInput(input))
return cacheZi8ScreenSnapShot[idx];
return CacheIndicator<Utilities.Zi8ScreenSnapShot>(new Utilities.Zi8ScreenSnapShot(), input, ref cacheZi8ScreenSnapShot);
}
}
}

namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.Utilities.Zi8ScreenSnapShot Zi8ScreenSnapShot()
{
return indicator.Zi8ScreenSnapShot(Input);
}

public Indicators.Utilities.Zi8ScreenSnapShot Zi8ScreenSnapShot(ISeries<double> input )
{
return indicator.Zi8ScreenSnapShot(input);
}
}
}

namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.Utilities.Zi8ScreenSnapShot Zi8ScreenSnapShot()
{
return indicator.Zi8ScreenSnapShot(Input);
}

public Indicators.Utilities.Zi8ScreenSnapShot Zi8ScreenSnapShot(ISeries<double> input )
{
return indicator.Zi8ScreenSnapShot(input);
}
}
}

#endregion

Reply With Quote
 
(login for full post details)
  #13 (permalink)
arturo8317
cali valle
 
 
Posts: 4 since May 2021
Thanks: 1 given, 0 received


the 2 DLL's, must be copied to the \ Documents \ NinjaTrader 8 \ bin \ Custom directory.

After we start NinjaTrader, we open the NinjaScript Editor, right click to open the context menu, click on References…, click on add and add the 2 previous DLL's.

create a new indicator with the data from the notebook


I send you the attached DLLS thank you very much

Attached Files
Register to download File Type: dll Newtonsoft.Json.dll (647.0 KB, 4 views)
Register to download File Type: dll Telegram.Bot.dll (178.0 KB, 4 views)
Register to download File Type: txt telegrammensajes.txt (5.1 KB, 4 views)
Reply With Quote
 
(login for full post details)
  #14 (permalink)
rocker84
Buenos Aires
 
 
Posts: 1 since Jun 2012
Thanks: 0 given, 0 received


arturo8317 View Post
the 2 DLL's, must be copied to the \ Documents \ NinjaTrader 8 \ bin \ Custom directory.

After we start NinjaTrader, we open the NinjaScript Editor, right click to open the context menu, click on References…, click on add and add the 2 previous DLL's.

create a new indicator with the data from the notebook


I send you the attached DLLS thank you very much

hi!, thanks for this, any news? I tried to get it work but no messages arrived on the group
-create the bot with BotFather
-start the bot with /start
-add the bot to the group and set as administrator

Reply With Quote


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


Last Updated on July 3, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



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