Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Alert on Total PnL

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

    Alert on Total PnL

    I am trying to set an audio alert but it's a bit tricky.
    I have 2 position opened on 2 different instruments. I would like to set an alert if the difference of the total PnL is above ...let's say $50.
    It goes like this: Instrument 1 total PnL $100. Instrument 2 total PnL $ - 50 . Account PnL 100 - 50 = 50 . Trigger alert.
    I have been using market analyzer , chose my 2 instruments and add a column "Profit Loss" then set conditions : ProfitLoss ...greater ...numeric value.
    The problem is that the alert is triggered when the PnL of any of my intruments is higher than my numeric value (50 in my example). The first time when instrument 1 gets to 50 my alert is triggered.
    But as you can see in my example instrument 1 needs to get to 100 for the alert to be triggered .
    Is there a way around this?

    #2
    Hello cosmin1ke,

    You can get the PnL from strategy positions from the SystemPerformance collection.
    https://ninjatrader.com/support/help...erformance.htm
    https://ninjatrader.com/support/help...8/currency.htm

    Compare the AverageProfit to be greater than 100.

    You can get the PnL from the Account object with Account.Get(AccountItem.RealizedProfitLoss).

    https://ninjatrader.com/support/help...ccountitem.htm

    To send an alert to the Alerts Log window from a NinjaScript Strategy (in real-time only) call the Alert() method.
    https://ninjatrader.com/support/help.../nt8/alert.htm

    I have been using market analyzer
    The Market Analyzer cannot run NinjaScript Strategies. Your post in the Strategy Development section of the forums and not the Indicator Development or General Development (for an Addon or Market Analyzer Window) section of the forums.
    May I confirm this is NinjaScript Strategy and not another script type?

    But as you can see in my example
    I'm not seeing an example in your post.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    47 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X