Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator with sound

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

    Indicator with sound

    Hi all,
    I would like to add a sound to CurrentDayOHL indicator.
    Whenever the price reaches new Low or High of the day, I would like to play it sound. How should I modify that indicator?
    Any help appreciated. Thanks a lot
    Godi

    #2
    Use "alert"

    Comment


      #3
      Reply

      I was thinking about function Playsound(@"C:\Buzzer.wav"); but I do not know where to paste it in that indicator

      Comment


        #4
        You would first of all need to create a condition that expresses when you want Alert or PlaySound to be called, like

        Code:
        if (High[0] > CurrentDayOHL().CurrentHigh[1])
                    {
                        PlaySound / RaiseAlert etc
                    }

        Comment


          #5
          I think that condotion is in that indicator already. It draws the line when new H/L appears and it calculates it each tick, not just at the end of time.
          I think, actual condition is:


          protected override void OnBarUpdate()
          {
          if (Bars.SessionBreak)
          {
          currentHigh = High[0];
          currentLow = Low[0];
          }

          currentHigh = Math.Max(currentHigh, High[0]);
          currentLow = Math.Min(currentLow, Low[0]);

          if (ShowHigh)
          {
          if (!PlotCurrentValue || currentHigh != High[0])
          CurrentHigh.Set(currentHigh);
          else
          for (int idx = 0; idx < CurrentHigh.Count; idx++)
          CurrentHigh.Set(idx, currentHigh);
          }

          if (ShowLow)
          {
          if (!PlotCurrentValue || currentLow != Low[0])
          CurrentLow.Set(currentLow);
          else
          for (int idx = 0; idx < CurrentLow.Count; idx++)
          CurrentLow.Set(idx, currentLow);
          }
          }


          I just donnt know where to paste the sound

          Comment


            #6
            Hi godiamond,

            This can be placed with the new High actions...

            Code:
            if (!PlotCurrentValue || currentHigh != High[0])
            {
            CurrentHigh.Set(currentHigh);
            PlaySound("sound file");
            }
            TimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X