• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Macd cross arrows on price panel and hide macd

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

    Macd cross arrows on price panel and hide macd

    I have attached macd indicaor which draws arrow on crossing of macd with its average. I want to hide macd in lower panel and draw arrows on price panel instead. Thanks for help
    Attached Files

    #2
    Hello trader333,

    Thank you for your post.

    In the Initialize() method set the following:
    Code:
    			DrawOnPricePanel = true;
    			Overlay = true;
    For the Plot you would need to set it's color to Transparent.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      did'nt work. I have tried your suggestions. I have tried to display it in same as price input and panel#1, if I display it in panel #2, it would display indicator in new panel but no arrows. see screenshot
      Attached Files

      Comment


        #4
        trader333, I've changed your code a bit up as a courtesy to plot the MACD arrows at price based values and not based on the MACD price itself, further I have removed the 0 line.

        This should now draw as you expected and not show any plots, but only the MACD signals on price.
        Attached Files
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand
          Thanks it worked.

          Comment


            #6
            I like the coding for the cross of slow & fast of MACD signals and displaying arrows. But instead of cross of slow & fast MA I would like to display in Price Panel the blue arrow whenever the slow MA line cross the zero line from below and red arrow whenever the slow MA line cross the zero line from above. It will be greatly appreciated if you can help me coding this for NT7. Thanks.

            Comment


              #7
              Hello sukhob,

              With CrossAbove() / CrossBelow() you can supply a double value.

              CrossAbove(IDataSeries series1, double value, int lookBackPeriod)

              Below is a link to the help guide.
              https://ninjatrader.com/support/help...crossabove.htm
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                I tried to use the above code but it doesn't display any arrow whenever the slow MA crosses above/below zeroline. I am attaching the code file. What am I doing wrong here?
                Attached Files

                Comment


                  #9
                  Hello sukhob,

                  Use prints to find out if the condition to draw the object is evaluating as true. (Or if the else that removes the object is evaluating as true)

                  Below is a link to a forum post that demonstrates using prints to understand behavior.
                  https://ninjatrader.com/support/foru...121#post791121

                  Please include the output from the prints and the code of the print and I will be happy to assist in analyzing the output and the behavior.

                  As a test, you could try drawing the arrows outside of the condition to ensure they are drawing as expected. This would also point to the condition that draws the objects as the issue.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    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


                      #11
                      Hello forextrader2003,

                      While our NinjaTrader Support is not able to create, debug, or modify, code or logic for our clients, this thread will remain open for any community members that would like to make these modifications as a convenience to you.

                      You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.


                      That said, I am happy to answer any questions you may have about NinjaScript if you decide to code this yourself.

                      In the condition set that draws the up arrow, you could add a condition that the myMACD.Default[0] is greater than 0. And for the condition set that draws the down arrow require myMACD.Default[0] to be less than 0.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Thank all of your for your responses.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by newuser, Today, 08:37 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post newuser
                        by newuser
                         
                        Started by bc24fl, Today, 06:51 AM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_Jim  
                        Started by U0000999, Yesterday, 05:17 AM
                        1 response
                        15 views
                        0 likes
                        Last Post NinjaTrader_Kate  
                        Started by asmmbillah, Today, 05:03 AM
                        2 responses
                        26 views
                        0 likes
                        Last Post asmmbillah  
                        Started by lordvader34, Today, 06:18 AM
                        1 response
                        9 views
                        0 likes
                        Last Post NinjaTrader_PaulH  
                        Working...
                        X