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

Imported Wav files not activating

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

    Imported Wav files not activating

    I am testing various ema strategies. I have placed wav files in the sounds folder of NT6.5. The resident voice gives me order filled through my EMA strategy, but I wish to set an ALERT voice to say Entered Short or Entered Long or Exit Long or Exit Short so as to audibly identify the specific Interval chart that activated.None of the wav files I have imported activate. I placed a rearm of 10 secs on each. These files were entered through the Wizard's/play sound / and Alert function.

    #2
    Unfortunately overwriting the existing sounds files is not supported.

    Note: You could play custom sounds in NinjaScript by PlaySound() : http://www.ninjatrader-support.com/H...PlaySound.html

    Comment


      #3
      .Wav Files not overwritten

      I am trading using an active LIVE account. However, I have the SIM account checked as to allow me real time Sim trading, unless that is not the case. I am not replaying historical data. The NT reference you sent about PLAYSOUND()...Calls to this method are ignored on historical data, it will only work in real-time seems to indicate that I should be hearing the audible .wav file. These files were created and dragged to the sound folder. No files were overwritten. SHOULD I NOT HEAR THE FILE? Are LIVE and SIM two different feeds? If I were to go LIVE should I then hear them?

      Comment


        #4
        You will hear the file:
        - if it's in a sound format which windows can replay and
        - you issue the PlaySound command on the realtime NinjaScript strategy (sim of live account does not matter, will not work on historical data) and
        - the filename parameter in the PlaySound command is correct

        If still not working, then I would not know.

        Comment


          #5
          Should this not work

          The following is my wizard code. I am not having success with this latest revision. I must have a dot, jot or titel off somewhere.

          #region Using declarations
          using System;
          using System.ComponentModel;
          using System.Diagnostics;
          using System.Drawing;
          using System.Drawing.Drawing2D;
          using System.Xml.Serialization;
          using NinjaTrader.Cbi;
          using NinjaTrader.Data;
          using NinjaTrader.Indicator;
          using NinjaTrader.Strategy;
          #endregion
          // This namespace holds all strategies and is required. Do not change it.
          namespace NinjaTrader.Strategy
          {
          ///<summary>
          /// 5 and 6 EMA crossing below. Exit 56LONG
          ///</summary>
          [Description("5 and 6 EMA crossing below. Exit 56LONG")]
          publicclass EMA56SHORTexit56LONG : Strategy
          {
          #region Variables
          // Wizard generated variables
          privateint fast = 5; // Default setting for Fast
          privateint slow = 6; // Default setting for Slow
          // User defined variables (add any user defined variables below)
          #endregion
          ///<summary>
          /// This method is used to configure the strategy and is called once before any strategy method is called.
          ///</summary>
          protectedoverridevoid Initialize()
          {
          Add(EMA(
          5));
          Add(EMA(
          6));
          CalculateOnBarClose =
          true;
          }
          ///<summary>
          /// Called on each bar update event (incoming tick)
          ///</summary>
          protectedoverridevoid OnBarUpdate()
          {
          // Condition set 1
          if (CrossBelow(EMA(5), EMA(6), 1))
          {
          EnterShort(DefaultQuantity,
          "");
          PlaySound(
          @"C:\Program Files\NinjaTrader 6.5\sounds\EnterShort.wav");
          }
          // Condition set 2
          if (CrossAbove(EMA(5), EMA(6), 1))
          {
          ExitShort(
          "", "");
          PlaySound(
          @"C:\Program Files\NinjaTrader 6.5\sounds\ExitShort.wav");
          }
          }

          Comment


            #6
            At first glance I can not find any error in your script.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            11 responses
            38 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by FrazMann, Today, 11:21 AM
            0 responses
            3 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            24 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            21 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X