Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Alert throws to Alert window but no sound file...

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

    Alert throws to Alert window but no sound file...

    Hi,
    I wrote this simple indicator to throw an alert and play a sound file. It does throw an alert to alert window but is not playing sound file. I put the wav file in the sounds folder under "C:\Program Files (x86)\NinjaTrader 7\sounds". It's for the Combined Put Call Ratio ^VRCT.Z chart I have. I did not cut and paste the entire Indciator Any help will be greatly appreciated.
    Thank you.
    HTML Code:
    // This namespace holds all indicators and is required. Do not change it.
    namespace NinjaTrader.Indicator
    {
    ///<summary>
    /// PCR Alert above 1 and below 0.6 throws an alerts both with audio. 
    ///</summary>
    [Description("PCR Alert above 1 and below 0.6 throws an alerts both with audio. ")]
    publicclass PCRalert : Indicator
    {
    #region Variables
    // Wizard generated variables
    // User defined variables (add any user defined variables below)
    #endregion
    ///<summary>
    /// This method is used to configure the indicator and is called once before any bar data is loaded.
    ///</summary>
    protectedoverridevoid Initialize()
    {
    Overlay = true;
    CalculateOnBarClose =false;
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    if (Close[0]>1)
    {
    // Generates an alert
    Alert("PCRabove1", NinjaTrader.Cbi.Priority.High, "PCR above 1", "PCR above1.wav", 30, Color.Green, Color.Black);
    }
    elseif (Close[0]<0.6)
    {
    // Generates an alert
    Alert("PCRbelow0.6", NinjaTrader.Cbi.Priority.High, "PCR below 0.6", "PCR below0.6.wav", 30, Color.Red, Color.Black);
    }
     
    }

    #2
    Hello Blash,

    Are there any error messages in the log tab of the control center?

    Do sounds otherwise work in NinjaTrader? You can turn on under Tools > Options > General tab. Check the sounds for order placement to confirm you're able to hear.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Yes I have sounds that play from the Market Analyzer for the NYSE TICK and they also play when dealing with orders.
      There is a error in log it says "Unable to play sound file 'PCR above1.wav': Not found on hard drive." But this I don't understand because it is on my hard drive. I put it right with the other NT sound in "C:\Program Files (x86)\NinjaTrader 7\sounds".

      You know the NT help says to put the sounds in a place I can't even find. This is what it says:
      File name of .wav file to play. Provide either the absolute file path or just the name if the file is located in C:\Program Files\NinjaTrader Installation Folder\sounds folder.

      ..unless they are just being generic with there reference because I don't have a file called "NinjaTrader Installation Folder".

      I have tried to just keep the wav file with all my other sounds and use the complete path but I receive compiling errors.

      Comment


        #4
        I just looked at the Price alert indciator that comes with NT and saw that for the file location in the alert line it says @"\sounds\Alert4.wav" so I change mine by adding the @\sounds\ part. I will see if it works.

        Comment


          #5
          Correct - the help guide article refers to the generic installation folder, not one specifically named NinjaTrader Installation Folder.

          If you're having trouble with the relative path, you can specify the whole one with:
          @"C:\Program Files (x86)\NinjaTrader 7\sounds\PCR above1.wav"
          Ryan M.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by BarzTrading, Today, 07:25 AM
          2 responses
          15 views
          1 like
          Last Post BarzTrading  
          Started by devatechnologies, 04-14-2024, 02:58 PM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by tkaboris, Today, 08:01 AM
          0 responses
          4 views
          0 likes
          Last Post tkaboris  
          Started by EB Worx, 04-04-2023, 02:34 AM
          7 responses
          162 views
          0 likes
          Last Post VFI26
          by VFI26
           
          Started by Mizzouman1, Today, 07:35 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X