Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

help

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

    help

    i am using a macd and i have placed two lines at certain values of the macd using the constant line indicator in the ninja indicator list. I am trying to create a strategy in the wizard where when the macd crosses one of the lines of the constant line indicator i want a arrow to draw on chart, if macd crosses up through the top line a green arrow and down through the bottom line a red arrow. Both of these constant lines are above and below the zero line of the macd. I also want the arrows to calculate on bar close true. Thank you

    #2
    Hello born again,

    Thank you for your post.

    I created a video on this item, please visit the following link to view this video: http://screencast.com/t/cPXEDF14gx

    Comment


      #3
      Patrick thank you i have done as you have said when these conditions happen i would like an arrow to draw on chart when i run a backtest and pull a chart up there are no arrows i also noticed on the chart that the constant lines are not plotting in the macd indicator panel.

      Comment


        #4
        Hello born again,

        Thank you for your response.

        You will need to go to the Do The Following section of each set > Add > Drawing > Down or Up Arrow.

        For the ConstantLines please left click on the '...' button for the 'When the following conditions are true' for the condition you created > on the right side of the window set the ConstantLines parameter 'Plot On Chart' to True > OK.

        Please let me know if I may be of further assistance.

        Comment


          #5
          thats what i have done still no arrows would it have any thing to do with the constant lines not being in the macd panel on the chart

          Comment


            #6
            Hello born again,

            Thank you for your response.

            The ConstantLines should not effect the arrows. Can you attach your strategy .cs file to your response?

            You will find your strategy in the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Strategy > the file will be a .cs type.

            I look forward to your response.

            Comment


              #7
              Thank you patrick this is what i have
              Attached Files

              Comment


                #8
                Try CurrentBar.ToString()

                Comment


                  #9
                  Originally posted by stocktraderbmp View Post
                  Try CurrentBar.ToString()

                  And your 'Y' axis value is wrong - should be something like this:

                  DrawArrowUp("tag1"+CurrentBar.ToString(), true, 0, Low[0] - 1*TickSize, Color.Lime);

                  Comment


                    #10
                    noy sure how to do that do i have to unlock code and enter string where it says true or false

                    Comment


                      #11
                      or can i unlock code and copy and paste what you have written

                      Comment


                        #12
                        Hello born again,

                        Thank you for your response.

                        You will need to set the Y value of the arrows to the Price Data > Close + your desired offset. Please refer to the attached image for an example.
                        Attached Files

                        Comment


                          #13
                          Originally posted by born again View Post
                          noy sure how to do that do i have to unlock code and enter string where it says true or false

                          Yes - this is what you can see at the moment

                          if (CrossAbove(MACD(3, 10, 18), ConstantLines(MACD(3, 10, 18), 0.02, 0, 0, 0).Line1, 1))
                          {
                          DrawArrowUp("My up arrow" + CurrentBar, false, 0, 3, Color.Lime);
                          }

                          Change it to
                          if (CrossAbove(MACD(3, 10, 18), ConstantLines(MACD(3, 10, 18), 0.02, 0, 0, 0).Line1, 1))
                          {
                          DrawArrowUp("My up arrow" + CurrentBar.ToString(), false, 0, Low[0] - 2*TickSize, Color.Lime);
                          }

                          Obviously you will do the opposite for the down arrow. So it will be High[0] + 2*TickSize

                          Comment


                            #14
                            Apologies Patrick-H didn't mean to confuse !

                            Comment


                              #15
                              Hello stocktraderbmp,

                              No worries, thank you for your assistance!

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              663 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              376 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              575 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X