Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

trigger for PlaySound()

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

    trigger for PlaySound()

    Hey, can some post a basic code snippet to play a sound when a certain unrealized profit is reached? (say..$200) Ive tried several approaches but i can't seem to get the sound to play :-\

    #2
    Hi BishopM05,

    This expression can be created in the condition builder interface. I've attached screenshot of this setup and code snippet generated.

    // Condition set 1
    if (Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) == 200)
    {
    PlaySound("");
    }
    Attached Files
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan, i'm currently using that expression..i just thought it was incorrect, but maybe i missed something. I'll recheck what i have when i can get back to my computer.

      Comment


        #4
        Maybe change operator to >=, that checks unrealized pnl is greater than or equal to. If your Pnl is not exactly equal to 200, the == condition would not trigger. PlaySound is also a real time only action.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks again, the >= did the trick...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, Yesterday, 11:51 AM
          0 responses
          20 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, Yesterday, 11:48 AM
          0 responses
          23 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-25-2026, 09:53 PM
          0 responses
          30 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 03-25-2026, 09:51 PM
          0 responses
          18 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 03-23-2026, 11:13 AM
          0 responses
          24 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X