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 WHICKED, Today, 12:45 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by samish18, Today, 01:01 PM
          0 responses
          5 views
          0 likes
          Last Post samish18  
          Started by WHICKED, Today, 12:56 PM
          0 responses
          8 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Spiderbird, Today, 12:15 PM
          2 responses
          11 views
          0 likes
          Last Post Spiderbird  
          Started by FrazMann, Today, 11:21 AM
          2 responses
          8 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Working...
          X