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

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.

    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.


                  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 bortz, 11-06-2023, 08:04 AM
                        47 responses
                        1,602 views
                        0 likes
                        Last Post aligator  
                        Started by jaybedreamin, Today, 05:56 PM
                        0 responses
                        8 views
                        0 likes
                        Last Post jaybedreamin  
                        Started by DJ888, 04-16-2024, 06:09 PM
                        6 responses
                        18 views
                        0 likes
                        Last Post DJ888
                        by DJ888
                         
                        Started by Jon17, Today, 04:33 PM
                        0 responses
                        4 views
                        0 likes
                        Last Post Jon17
                        by Jon17
                         
                        Started by Javierw.ok, Today, 04:12 PM
                        0 responses
                        12 views
                        0 likes
                        Last Post Javierw.ok  
                        Working...
                        X