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

Basic alert

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

    Basic alert

    Hi all.

    It wil be of a great help if anyone can create and post here the this basic alert:

    When price closed above MA () draw an uparrow below the bar and send an audio alert.
    When price closed below MA () draw a downarrow above the bar and send an audio alert.
    And also, to where in the indicator to copy and paste it.

    After 2 days I gave up on it and had to ask for your help (not an easy task for me...asking for help or directions...)

    Thanks in advance.

    #2
    I will ask one of our tech's in training to create something as a learning excercise. Might be a week or so.
    RayNinjaTrader Customer Service

    Comment


      #3
      Many thanks. I am sure that many other users will be happy to have it too.

      Comment


        #4
        Hi Tzachi,

        I am the tech in training that is creating your alert. Could you please verify when you would like an arrow to be drawn on the chart.

        Do you want an arrow to be drawn for each bar that closes above/below the Simple Moving Average or do you mean to draw an arrow on a bar only when the price crosses above/below the Simple Moving Average?
        JasonNinjaTrader Customer Service

        Comment


          #5
          Jason,
          Thanks for looking into it.

          I would like to add an uparrow or downarrow for the first time that a price closed above/below the HiLoActivator.

          Comment


            #6
            Hi Tzachi,

            You can find the indicator attached in this post. It will play a sound and draw the arrows when your conditions evaluate to true.

            Instructions to import the .zip file into NinjaTrader can be found at the link below.


            Once the file is imported, please see the following link how to apply the indicator in your chart.
            Attached Files
            JasonNinjaTrader Customer Service

            Comment


              #7
              Jason,

              I put it on the chart and I have only 2 words for you:

              Beautiful job.

              Comment


                #8
                Hello,
                Nice job on this indicator. Thanks.
                Question: If I wanted to add another element for the signal to be true...how would I do it.
                Example: If I wanted to add the condition that the CCI must be greater than the zero line when the crossover occurs.

                if (CrossAbove(Close, SMA(periodSMA), 1)) add(and the CCI > 0)
                DrawArrowUp

                and the opposite for a short.


                Can this be done?

                Thanks for your help

                Comment


                  #9
                  To add an additional condition you can use the && operator within the if ( ). For or statements the operator is ||.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks Josh,
                    I cant get this to compile.
                    Will you check out why, please.

                    Thanks

                    if ((CrossAbove(Close, SMA(periodSMA), 1))&& (CCI(Close,(periodCCI)>0)))

                    The best overloaded method match for 'NinjaTrader.Indicator.Indicator.CCI(NinjaTrader.D ata.IDataSeries, int)' has some invalid arguments CS1502 - click for info 44 50

                    Argument '2': cannot convert from 'bool' to 'int' CS1503 - click for info 44 60

                    Also...sometimes I get an error that I cant use '>'

                    Comment


                      #11
                      You can't close the if() statement before your second condition.

                      Code:
                      if (condition 1 && condition 2)
                      not
                      Code:
                      if (condition 1) && condition 2
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks Josh,
                        I'm getting closer.
                        Now I get this message:

                        Operator '>' cannot be applied to operands of type 'NinjaTrader.Indicator.PriceOscillator' and 'int' CS0019 - click for info 45 9

                        if (CrossAbove(PriceOscillator(Close,1,34,3), PriceOscillator(Close,1,34,15), 1) && PriceOscillator(Close,1,34,15) > 0)

                        How can I fix that?

                        Thanks

                        Comment


                          #13
                          Right. If you are trying to compare values of the indicator you need to use the index [].

                          [0] would mean current bar. [1] would mean previous bar. etc.

                          Code:
                          [FONT=Courier New][SIZE=2]PriceOscillator(Close,[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]34[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]15[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])[0] > [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT]
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks Josh,
                            Finally got it...lol

                            Thanks for your help

                            Comment


                              #15
                              SMA to EMA

                              Hi:

                              I'm very new to NT and I was wondering how I would go about changing the SMA to and EMA?

                              I tried editing the script by changing the SMA to EMA but no luck.

                              Suggestions?

                              Thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              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
                               
                              Started by kulwinder73, Today, 10:31 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Working...
                              X