Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add Tabname to alert message

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

    Add Tabname to alert message

    Hello, how can I add the Tabname in message to an alert in a strategy ?

    #2
    Hello Uregon,

    Thanks for writing in.

    We do not have any sample code for getting the text of a tab in a strategy to use in an alert. Instead, you could consider adding the name of the instrument in the message string when setting up your alert.

    See this help guide page for more information about Alert(): https://ninjatrader.com/support/helpGuides/nt7/alert.htm

    Let us know if we may assist further.
    Last edited by NinjaTrader_BrandonH; 10-28-2021, 08:31 AM.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      NinjaTrader_BrandonH How an I show the timeframe from the Chart in my alert protocoll. 5Minute timeframe and so on. shown as message notification.

      Comment


        #4
        Hello Uregon,

        Thanks for your note.

        I see this is posted in the NinjaTrader 7 - Strategy Development section of the forums. Did you mean to post this in the NinjaTrader 8 - Strategy development section of the forums?

        In regard to your initial inquiry, NinjaTrader 7 does not contain chart tabs. Also, we do not have documented code to get the tab name in NinjaTrader 8. However, this could be accomplished using undocumented code in NinjaTrader 8. Note that using undocumented code would not be supported.

        For example, see below

        ChartControl.Dispatcher.InvokeAsync(new Action(() => {
        Print((ChartControl.OwnerChart.MainTabControl.Sele ctedContent as ChartTab).ActualTabName);
        }));


        To get the chart interval (timeframe) that a strategy is running on, you could use BarsPeriod. If you enabled the strategy on a 5-minute ES 12-21 chart, then BarsPeriod would refer to the 5-minute interval. For example, see below.

        Print("BarsPeriod: " + BarsPeriod);

        Also, see this help guide for more information: https://ninjatrader.com/support/help...barsperiod.htm

        Let us know if we may assist further.




        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X