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 AaronKoRn, Today, 09:49 PM
          0 responses
          10 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Today, 08:42 PM
          0 responses
          9 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Today, 07:51 PM
          0 responses
          10 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,980 views
          3 likes
          Last Post jhudas88  
          Started by rbeckmann05, Today, 06:48 PM
          0 responses
          9 views
          0 likes
          Last Post rbeckmann05  
          Working...
          X