Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Notification via Messenger

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Notification via Messenger

    Hello,

    I'm trying to build a messenger notification for all my strategies. The goal is that I get a notification, when a strategy executes an trade.

    For the first step, I tried to write this programm as own strategy, which receive following events :

    Code:
    		protected override void OnAccountItemUpdate(Cbi.Account account, Cbi.AccountItem accountItem, double value)
    		{
    			SendMessage("OnAccountItemUpdate");
    		}
    
    		protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
    		{
    			SendMessage("OnConnectionStatusUpdate");
    		}
    
    		protected override void OnExecutionUpdate(Cbi.Execution execution, string executionId, double price, int quantity, 
    			Cbi.MarketPosition marketPosition, string orderId, DateTime time)
    		{
    			SendMessage("OnExecutionUpdate");
    			SendMessage("Executed " + ((marketPosition == Cbi.MarketPosition.Short) ? "Short" : "Long") + " price : " + price + " Anzahl : " + quantity);
    			SendMessage("ExecutionStringMethod : " + execution.ToString());
    		}
    
    		protected override void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice, 
    			int quantity, int filled, double averageFillPrice, 
    			Cbi.OrderState orderState, DateTime time, Cbi.ErrorCode error, string comment)
    		{
    			SendMessage("OnOrderUpdate");
    		}
    
    		protected override void OnPositionUpdate(Cbi.Position position, double averagePrice, 
    			int quantity, Cbi.MarketPosition marketPosition)
    		{
    			SendMessage("OnPositionUpdate");
    		}
    The sendMessage function can send the string via Telegram ( This is working)

    My focus is the "OnExecutionUpdate" Event, but this event isn't triggerd when my strategy executes an order. I only receive the "OnAccountItemUpdate" Event.

    Because that I have three questions:

    1. What is the correct Event for notification for a new Order on the markt ?
    2. The best way for implementation is the addon or ? This feature shouldn't be a strategy ?
    2.1 Is it possible to enable/disable addons and check which addons are running?

    Thank your for your help

    #2
    Hello,

    Thank you for the post.

    If you were using a single strategy, that would only be good for that specific strategies performance. if you want to observe the account you should instead use an addon as that is the purpose of an addon.
    There is an example of an addon that observes the execution override here:


    Regarding enable/disable addons, you would need to implement this yourself. An addon will start upon the platform starting, and also after a recompile. Any other special logic that you want it to do you would need to develop. You could use a Static property that your addon watchs as one example, you could also create a UI for the addon or any other form of control you need. We have a sample showing how to create a window here: https://ninjatrader.com/support/help...t_overview.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    86 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    151 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    79 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    52 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    59 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X