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 junkone, Today, 11:37 AM
          0 responses
          2 views
          0 likes
          Last Post junkone
          by junkone
           
          Started by quantismo, 04-17-2024, 05:13 PM
          5 responses
          34 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by proptrade13, Today, 11:06 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          34 views
          0 likes
          Last Post love2code2trade  
          Started by cls71, Today, 04:45 AM
          2 responses
          10 views
          0 likes
          Last Post eDanny
          by eDanny
           
          Working...
          X