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

NT8 chart alerts aren't working for customized NT script

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

    NT8 chart alerts aren't working for customized NT script

    Hi Team,

    NT 8 chart alerts aren't working with customized script. Attached for your reference.
    I am creating an alert with greearrowdetect equals to 1 (0 bars ago) for buy alert and redarrowdetect equals to 1(0 bars ago) for sell alert.

    chart alert sound or pop up dialog aren't getting generated.

    Can anyone please help me fixing the script to work with chart alerts?

    Please let me know in case of more details.

    Thank you.
    Attached Files

    #2
    Hello amsun,

    Thank you for your note.

    I believe the issue is that you're not using the correct path for your alert sounds.

    Here's what you are currently using for the path:

    private string confirmedUpTrend = @"\sounds\newuptrend.wav";
    private string confirmedDownTrend = @"\sounds\newdowntrend.wav";
    private string potentialUpTrend = @"\sounds\potentialuptrend.wav";
    private string potentialDownTrend = @"\sounds\potentialdowntrend.wav";

    And here's how it should be structured:

    Alert("PotentialUpTrend", Priority.Medium, "PotentialUpTrend", NinjaTrader.Core.Globals.InstallDir+potentialUpTre nd, rearmTime, Brushes.Black, upColor);

    When you leave out the InstallDir part, it can't find the sounds because it doesn't automatically know where the install directory is.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Kate,

      Thank you for the details.

      The provided details helped and I see the alerts are generating now.

      Thanks.
      Last edited by amsun; 04-15-2020, 01:59 PM.

      Comment


        #4
        Hello amsun,

        Thank you for your reply.

        This sounds like perhaps greenarrowdetect and redarrowdetect are never equal to 1 for some reason.

        The first thing I would recommend would be to turn on the Order Trace function if you're trying to see what's happening with any orders you're trying to submit:

        Strategy Builder > Default Properties > More Properties > Trace Orders, or:

        if (State == State.SetDefaults)
        {
        TraceOrders = true;
        }

        Once you then recompile the strategy, you can open a new NinjaScript Output window under New > NinjaScript Output. This will print a log of any orders submitted by the strategy during while it's running, along with any ignored orders. You can then look through and see what may be occurring.

        Here is a link to our help guide that goes into more detail on tracing orders:



        Trace orders alone may not give you the full picture of whether or not something should occur on a given bar, so adding prints to your strategy that will show in the NinjaScript Output window, with information on what the variables you're using for your conditions are on a particular bar, can be helpful.

        This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction. You can even add these using the Strategy Builder.



        If you run into issues like we saw here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently. With the printout information you can assess what is different between the two. I would specifically have it print the values for greenarrowdetect and redarrowdetect.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thank you kate.

          This helps and I am progressing now. Currently sound alerts are resolved and working on submit order actions.

          Once again, thank you very much for you help.

          Amar

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Option Whisperer, Today, 07:58 PM
          4 responses
          14 views
          0 likes
          Last Post Option Whisperer  
          Started by ETFVoyageur, 05-07-2024, 07:05 PM
          13 responses
          83 views
          0 likes
          Last Post ETFVoyageur  
          Started by cupir2, Today, 07:44 PM
          0 responses
          8 views
          0 likes
          Last Post cupir2
          by cupir2
           
          Started by reynoldsn, Today, 07:23 AM
          6 responses
          19 views
          1 like
          Last Post reynoldsn  
          Started by reynoldsn, Today, 07:26 PM
          0 responses
          7 views
          0 likes
          Last Post reynoldsn  
          Working...
          X