Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Crossover Alert question

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

    Crossover Alert question

    I am trying to set an audible alert in the market analyzer when CCI crosses the zeroline. I have the condition set to equal 0 in hopes when the value went from positive to negative it would hit the 0 value and trigger, but it seems to skip right over it.

    Anyone have an idea how to make this work?

    Thanks

    #2
    Hello SubRock,

    Thank you for your post.

    Unfortunatley this is expected. It would have to equal exactly zero and this is not always the case with crossover.

    For version 7 we have added CrossOver conditions in the market analyzer so these can be created in a simple point and click interface. This version is in public beta and can be downloaded here.

    For version 6.5, crossover conditions must be custom coded. Below is a snippet that will assign a value of 1 to an indicator if CCI crosses over zero line and 0 if there's no crossover. It tests for crossovers in either direction. You could then check for when this indicator == 1 in the market analyzer.

    Code:
     
    if (CrossAbove(CCI(14), 0, 1) || CrossBelow(CCI(14), 0, 1))
    Plot0.Set(1);
    
    else Plot0.Set(0);
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan, where about do I add this code?

      Comment


        #4
        Subrock,

        You will have to create a new indicator through Tools > New NinjaScript > Indicator.

        Click next through the wizard. The only setting you should customize is the name of the indicator. Otherwise the default settings will work.

        Then copy and paste the snippet from my previous post in between the curly brackets {} of the OnBarUpdate() method. I have attached a screenshot of where this goes.

        If you have any issues let me know and I can export it to a file.
        Attached Files
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Ryan I really appreciate the help on this.

          Upon compiling for some reason I keep getting this error

          Comment


            #6
            Hi Subrock,

            That error points to issues with another file VOLSMA.cs

            You will have to resolve the programming errors for this indicator before your new one will compile.
            • Open NinjaTrader
            • From the Control Center select the Tools menu--> select the Edit NinjaScript menu item--> select Indicator
            • Select an indicator and double click on it.
            • A new window will appear and you will need to right click in the window and select Compile to compile the indicators.
            • At the bottom of the window a new section will appear were you can find the error locations.
            • From there you have the option to remove the indicator or debug it.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7


              Thanks a ton Ryan, works like a charm!

              Comment


                #8
                swap alerts

                I have a method to provide autoimated exits without using strategy which is useful when entering manually. I'm willing to swap this for an alert for the macd when my parameters are met.
                Anyone intertested?

                Comment


                  #9
                  Originally posted by jerry1 View Post
                  I have a method to provide autoimated exits without using strategy which is useful when entering manually. I'm willing to swap this for an alert for the macd when my parameters are met.
                  Anyone intertested?
                  Jerry, Did you ever get an answer on the MACD crossover alert? I am trying to get an audible alert strategy going on the control center for the MACD 2 line cross, but what support helped me set up, worked for a couple of days, then mysteriously locked up. They offer no further help saying I need to reduce my code conditions or hire a programmer. How can one further reduce one simple condition and then one simple action? I don't think so. I am at a loss how to get it working. Bob
                  Last edited by snakeoil; 10-01-2012, 11:45 AM.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DavidHP, Today, 07:56 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by kujista, Today, 06:23 AM
                  3 responses
                  6 views
                  0 likes
                  Last Post kujista
                  by kujista
                   
                  Started by Mindset, Yesterday, 02:04 AM
                  2 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_RyanS  
                  Started by f.saeidi, Today, 08:03 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by samish18, 04-17-2024, 08:57 AM
                  15 responses
                  53 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X