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

Checking for cross over conditions and generating an alert

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

    Checking for cross over conditions and generating an alert

    Attached is an indicator that will check for a cross over condition of two simple moving averages. It will:

    - Plot a dot on the bar of the cross over condition
    - Generate an an alert to the "Alerts" window and play a sound on a cross over condition on real-time data only

    To use or reviewthe code for this indicator:

    - Unzip the contents of this file to "My Documents\NinjaTrader 6\bin\Custom\Indicator"
    - Start NT
    - Tools > Edit NinjaScript > Open CrossAlert
    - Compile from within the NinjaScript Editor by pressing the F5 key
    - Apply to a chart

    Ray

    Attached Files
    RayNinjaTrader Customer Service

    #2
    imported post

    Oddly, I have downloaded this crossover custom indicator zip file and extracted the crossover.cs fileto the exact directory and folder in NT 6 as noted (and even gone to that folder to note that it is the only custom indicator file there) but when I then load up NT6 and go to Tools, Edit Ninja Script and try to then find the CrossOver indicator.. it is nowhere to be found in the list.

    Any idea what I am doing wrong? I had no problem with the NT 5 custom indicators but I can't seem to get this to work at all. I have also noticed, that unlike in NT5, the file I extracted and put in that folder, is not preceded by an @, not that it has anything to do with it. Can you suggest a work around or is there a glitch in NT6 yet to be fixed such that we should not be trying to download custom indicators into the latest beta version yet.

    Thanks in advance for any help you can provide...

    Randy

    Comment


      #3
      imported post

      If you are on the latest beta (7), its located under My Documents\NinjaTrader 6\bin\Custom\Indicator
      RayNinjaTrader Customer Service

      Comment


        #4
        imported post

        Thanks.. I tried that. First I went and deleted it from the prior location to which I had extracted it. Then downloaded the original again and extracted it to that new location that is under MyDocuments instead of ProgramFiles. When I opened up NT V6 and clicked on tools, the indicator was listed this time. However, when I clicked ok and then went to compile, I got the following error message instead of the "ok" check box:

        'NinjaTrader.Cbi.Globals' does not contain a definition for 'InstallDir' File: Indicator/CrossAlert.cs Line: 53 Column: 92

        and a second instance of that same exact error message right below that but this one showed location of Line: 62 Column:92

        If you have a solution, do please let me know.

        Thanks...

        Comment


          #5
          imported post

          Open up the file via Tools > Edit NinjaScript > Indicator

          Replace "Cbi.Globals.InstallDir"

          with "Cbi.Core.InstallDir"

          and recompile. This should take care of it.

          Ray
          RayNinjaTrader Customer Service

          Comment


            #6
            imported post

            Ray.. Thanks for the prompt turnaround.. it now loads up just fine. I edited it to use the much faster hull moving averages and it seems to be very accurate. Thanks again. It also mentions that this indicator provides an alert box and alert sound. I frankly had no idea thatNT Version 6 had those capabilities at this stage. Does it or are those something still to come in the future?

            Thanks,

            Randy

            Comment


              #7
              imported post

              It has Alert capabilitiesat this stage
              RayNinjaTrader Customer Service

              Comment


                #8
                Nt7

                I can't get this to appear on NT7. Is it possible/ Thanks.

                Comment


                  #9
                  Hello CrossCreak,

                  I've changed it so that it now works in version 7.

                  To Import
                  1. Download the attached file to your desktop
                  2. From the Control Center window select the menu File > Utilities > Import NinjaScript
                  3. Select the downloaded file
                  Attached Files
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    nt7 cross alert

                    Fantastic! Many thanks.

                    Comment


                      #11
                      Works great, but the alert1 sound is rather jarring. I changed the code to alert4, but it still generates alert1 sound. Is there a way to do this, or it can't be changed?
                      Thanks again.

                      Comment


                        #12
                        Hi Crosscreek,

                        You should just be able to change the .wav file used to whatever you like. There are two alert statements. One plays Alert1 and the other plays Alert2.

                        If it hasn't responded to your changes, make sure you compile and then add and remove the indicator.
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_RyanM View Post
                          Hi Crosscreek,

                          You should just be able to change the .wav file used to whatever you like. There are two alert statements. One plays Alert1 and the other plays Alert2.

                          If it hasn't responded to your changes, make sure you compile and then add and remove the indicator.
                          Thanks again. One last question, if I may. I tried to change the code to ema cross but when I load it back in the indicator file it does not show up. What am I doing wrong?

                          Comment


                            #14
                            Did you compile by pressing F5 after putting your changes in?

                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Getting error code CS0101, clicked for info then get:

                              Unfortunately we do not have NinjaScript context based Help information on this specific error code. You can check the Microsoft MSDN site section on error codes for futher information.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ghoul, Today, 06:02 PM
                              3 responses
                              14 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              44 views
                              0 likes
                              Last Post jeronymite  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              7 responses
                              20 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              10 responses
                              180 views
                              0 likes
                              Last Post jeronymite  
                              Started by DanielSanMartin, Yesterday, 02:37 PM
                              2 responses
                              13 views
                              0 likes
                              Last Post DanielSanMartin  
                              Working...
                              X