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

Created Indicator MACD crossing zero line -- show up down arrow...compilation error

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

    Created Indicator MACD crossing zero line -- show up down arrow...compilation error

    Created Indicator MACD crossing zero line -- show up down arrow...compilation error

    Also it's not working even after removing user input (compilation error goes but not showing up down arrow).

    If you can provide some video link as to what options to select for a indicator to cross USER Input level then it will of great help.

    Also kindly have a look at this ninjascript as to what lines to be changed.

    Thanks a lot for your efforts in helping out novice users like me.
    Attached Files

    #2
    Hello kashyapjdave,

    Thanks for your post.

    The file as is compiles just fine. If you are getting compile errors it may be caused by another file. NinjaTrader will compile all files at the same time so an error in any file will not permit a successful compilation until the error is corrected or the file is excluded or removed. When you compile and there are compilations errors, take a look at the left column of the error messages at the bottom of the script as it will advise which file contains the error.

    The indicator is creating a new panel and I suspect you want this to be added to the price panel. To have the indicator overlay on the price panel, set the property IsOverLay = true; currently, it shows as false.
    Reference: http://ninjatrader.com/support/helpG...?isoverlay.htm

    Only the "latest" crossover arrows appear, if you want to see all of the arrows, add +Currentbar to the tag name of the arrow statement. For example:

    Draw.ArrowUp(this, @"kashemacrossover Arrow up_1"+CurrentBar, false, 0, (Low[0] + (-4 * TickSize)) , Brushes.Lime);
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Sir..showing error in this file only...kindly see the atachment

      Sir,
      I am making this MACD Cross above / below Indicator so that it plots / shows ARROW UP / DOWN in MACD PANEL SUBGRAPH when MACD crosses above / below ZERO LINE.

      Kindly help so that my objective is achieved and file compiles.

      Thanks.
      Attached Files

      Comment


        #4
        Hello kashyapjdave,

        Thanks for your post.

        I think I must have been reviewing your EMA crossover indicator by mistake.

        The file you attached has the region properties in the wrong area relative to the "{ " "}". and it does not contain coding to plot a MACD.

        To accomplish your goal with the MACD, I recommend that you make a copy of the MACD indicator (Open the MACD indicator in the Ninjascript editor, right mouse click on the code and select "save as" with a new name. Then you can and add your crossover checks and arrow drawing. This will then provide the indicator in the panel, along with your arrows.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I do not want to plot MACD...I just want to plot arrows when MACD crosses ZERO LINE

          I do not want to plot MACD...I just want to plot arrows when MACD crosses ZERO LINE.

          Since I do not know coding..I do not know Syntax..but I am taking help from your reference help and videos.

          I got my EMA Crossover properly through your help where I didnt plot EMA I just got my ARROW UP DOWN when EMA 1 fast crosses EMA 2 slow.

          I just want UP DOWN ARROWS to be plotted in MACD PANEL when MACD crosses ZERO LINE.

          Please provide help of video or some other thing or proper syntax to be added.

          IF YOU THINK THERE HAS TO BE MAJOR SYNTAX / LINES TO BE ADDED THEN PLEASE GUIDE.

          Thanks.

          Comment


            #6
            Originally posted by NinjaTrader_Paul View Post
            Hello kashyapjdave,

            Thanks for your post.

            I think I must have been reviewing your EMA crossover indicator by mistake.

            The file you attached has the region properties in the wrong area relative to the "{ " "}". and it does not contain coding to plot a MACD.

            To accomplish your goal with the MACD, I recommend that you make a copy of the MACD indicator (Open the MACD indicator in the Ninjascript editor, right mouse click on the code and select "save as" with a new name. Then you can and add your crossover checks and arrow drawing. This will then provide the indicator in the panel, along with your arrows.
            Sir, This INDICATOR is for MACD crossing above / below ZERO LINE - PLOTS / DRAWS Arrows...it has nothing to do with CROSSOVER.

            Comment


              #7
              Hello,

              Thanks for your replies.

              With reference to your last post in this thread: http://ninjatrader.com/support/forum...ad.php?t=97917 I understand you have resolved the issue.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Sir...MACD crossing ZERO LINE hasnt been solved yet..pls help.

                Sir...MACD crossing ZERO LINE hasnt been solved yet..pls help.

                I just want UP DOWN ARROWS to be plotted in MACD PANEL when MACD crosses ZERO LINE.

                Since I do not know coding..I do not know Syntax..but I am taking help from your reference help and videos.

                I just dont know how to solve this....

                Please provide help of video or some other thing or proper syntax to be added.

                IF YOU THINK THERE HAS TO BE MAJOR SYNTAX / LINES TO BE ADDED THEN PLEASE GUIDE.

                Thanks.
                Attached Files

                Comment


                  #9
                  Hello,

                  Thanks for your reply.

                  Just for clarity: In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

                  If you are interested to have several indicators or strategies created you may want to consider hiring a 3rd party programmer. If this is of interest we can provide you with reference links to 3rd party programmers.

                  For today, here is what you can change in your code to show arrows on the MACD indicator assuming you have added the MACD indicator to the chart.

                  1) Delete the "}" on line 107
                  2) Delete the "}" on line 106
                  3) Cut the lines 86 through 104 (this should remove these lines)
                  4) Paste the cut lines between line 82 and 83
                  5) In line 79, change @"kashmacdlevelcross" to @"kashmacdlevelcross1"
                  6) In Line 79, change + 0.ToString() to + CurrentBar (to show all arrows)
                  7) In Line 74, change + 0.ToString() to + CurrentBar (to show all arrows)
                  8) On line 40, change DrawOnPricePanel from true to false
                  9) Compile the indicator

                  When you add the indicator to the chart, make sure that you select the same panel as the MACD
                  Attached Files
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    I want the arrows to be plotted when MACD crosses above below ZERO LINE

                    Sir, it is showing arrows and compiling but arrows are coming when avg crosses above below zero line.

                    " I want the arrows to be plotted when MACD crosses above below ZERO LINE but this indicator plots arrows when AVG crosses above below ZERO LINE " *****

                    Kindly provide the changes need to be done to get my desired results so that arrows get plotted when MACD crosses above below ZERO LINE.

                    Also If I need OFFSET in plotting arrows...where to insert this line and what line to insert ?

                    Thanks a lot for all your efforts and help you are providing.
                    Attached Files
                    Last edited by kashyapjdave; 03-24-2017, 12:49 AM.

                    Comment


                      #11
                      Hello kashyapjdave,

                      Thanks for your reply.

                      The indicator you created uses the average line of the MACD. To use the MACD line itself, you would need to change MACD1.Avg to MACD1.Default

                      In the Draw.Arrow statements it shows ... false, 0, 0, Brushes.... The 2nd zero is the vertical location to draw the arrow. Because you are placing arrows in the MACD panel you would need to use some value that relates to the MACD itself. Zero works well here because the arrow is showing where the zero cross occurs. You would have to try other values as shown on the scale of the MACD scale on the right side. Depending on the instrument and price movement this can be quite different. I would advise you to test other instruments and observe what scaling the MACD goes to and determine if there is any value that would consistently work here. Again I would advise to use zero as that would be consistent.
                      Paul H.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello,

                        I have searched the internet high and low for a modification to the below indicator, one that has the option to only show buy arrows above the zero line and only sell arrows below the zero line, would it be possible for someone here to make this modification for me, it would greatly be appreciated.

                        Thank You !!!
                        Attached Files

                        Comment


                          #13
                          Hello forextrader2003,

                          Thanks for your post.

                          We note that this is the 3rd duplicate of your post in other threads and we request that in the future you do not create multiple posts on the same subject. As is we have responded to your previous posts both with code advise as well as a complete rework for you. Links to other posts on this:



                          Thanks for your help and understanding to limit your futures posts to just 1 on the same subject.
                          Paul H.NinjaTrader Customer Service

                          Comment


                            #14
                            Ok im sorry, I did not know that I was doing anything incorrect, I will not do this in the future, I wish I had seen this post sooner, because I did it again but will refrain from now on sorry again.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Pattontje, Yesterday, 02:10 PM
                            2 responses
                            15 views
                            0 likes
                            Last Post Pattontje  
                            Started by flybuzz, 04-21-2024, 04:07 PM
                            17 responses
                            229 views
                            0 likes
                            Last Post TradingLoss  
                            Started by agclub, 04-21-2024, 08:57 PM
                            3 responses
                            17 views
                            0 likes
                            Last Post TradingLoss  
                            Started by TradingLoss, 04-21-2024, 04:32 PM
                            4 responses
                            44 views
                            2 likes
                            Last Post TradingLoss  
                            Started by cre8able, 04-17-2024, 04:16 PM
                            6 responses
                            57 views
                            0 likes
                            Last Post cre8able  
                            Working...
                            X