Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Any Ninjascript for Chart marker following Alert? / Same alert for multiple markets.

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

    Any Ninjascript for Chart marker following Alert? / Same alert for multiple markets.

    I am inquiring as to whether there is any Ninjascript that can plot a Chart Marker, namely an Arrow Up following an alert to identify a Bullish candle and vice versa for a Bearish one.. rather than the pop up dialog box in the Alerts Actions section.

    Also is there any process for setting the same Alert to multiple markets as opposed to setting the Alerts box to every chart?

    Thank you

    #2
    Hello dmackay41,

    Thanks for your post.

    Alert() would be used to create alerts when a certain condition becomes true.

    Draw.ArrowUp() would be used to draw an up arrow on the chart whenever a certain condition becomes true. Similarly, Draw.ArrowDown() would be used to draw a down arrow on the chart. For example, something you could do is check if there is an up bar (Close[0] > Open[0]) and then call Draw.ArrowUp() to draw an up arrow. Note that to have that up arrow draw on each bar the condition is true instead of just the most recent bar, you would need to add CurrentBar to the tag parameter.

    For example, the code below calls an alert and draws an up arrow 5 ticks above the High price when we have an up bar.

    Code:
    if (Close[0] > Open[0])
    {
         Alert("myAlert", Priority.High, "Up Bar", NinjaTrader.Core.Globals.InstallDir+@"\sounds\Alert1.wav", 10, Brushes.Black, Brushes.Yellow);
        Draw.ArrowUp(this, "tag1" + CurrentBar, true, 0, High[0] + 5 * TickSize, Brushes.Green);
    }
    It would be possible to set Alerts for multiple instruments in a NinjaScript. To do so, you would need to add additional data series to your script using AddDataSeries(). Then, you would reference the BarsInProgress value of the added series and call Alert(). This will produce an alert when a certain condition becomes true on the specified added series.

    See the help guide documentation below for examples and more information.

    Alert(): https://ninjatrader.com/support/help.../nt8/alert.htm
    Draw.ArrowUp(): https://ninjatrader.com/support/help...aw_arrowup.htm
    Draw.ArrowDown(): https://ninjatrader.com/support/help..._arrowdown.htm
    AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm
    BarsInProgress(): https://ninjatrader.com/support/help...inprogress.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
    626 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    567 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X