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

Drawing Tools

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

    Drawing Tools

    Hello,


    I want to ask if it is possible somehow to use different templates for pitchforks. Of course one can change colors but this is unnecessary work all the time...


    Isnt it possible to have different templates as we can do for example with fibonacci retracements?


    When drawing 3 pitchforks it looks like a mikado game. And changing colors for few instruments in 1 minute charts is drawing and changing all the time.



    Thank you
    Tony

    #2
    Hello tonynt,

    Thanks for your post.

    In NinjaTrader7 the pitchfork drawing tool does not have templates processing other than setting a default.

    In NinjaTrader8, we implemented all drawing tools access to templates.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello Paul,


      thank you for your reply.


      I see that it is not possible in the properties.



      But is there a possibilty for a workaround? Or if not to use it as an indicator and save with different names "pfup" and "pfdown". Or any other idea?



      Thank you!
      Tony

      Comment


        #4
        Hello tonynt,

        Thanks for your reply.

        There is no other workaround with templates or drawing tools

        You could create an indicator where you can specify the color for the entire pitchfork. Please see the helpguide here: https://ninjatrader.com/support/help...spitchfork.htm

        You could create an indicator to loop through the drawing objects collections and have it color them according to some system of coloring you devise. Please see: https://ninjatrader.com/support/help...rawobjects.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello Paul,


          thank you for your reply. When I do as shown in the sample, then it will snap back with onbarupdate to the High and Low in the code after I modify it manually, no?





          Best
          Tony
          Last edited by tonynt; 07-05-2018, 08:33 AM. Reason: clearify

          Comment


            #6
            Hello tonynt,

            Thanks for your reply.

            You are referring to the code shown to create the pitchfork through NS:
            DrawAndrewsPitchfork("tag1", true, 4, Low[4], 3, High[3], 1, Low[1], Color.Blue, DashStyle.Solid, 3);

            Indeed it would. You could use a bool so that OnBarUpdate() would only draw it once:

            if (doitonce)
            {
            DrawAndrewsPitchfork("tag1", true, 4, Low[4], 3, High[3], 1, Low[1], Color.Blue, DashStyle.Solid, 3);
            doitonce = false; // set bool to false to prevent redrawing.
            }
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hello Paul,


              thank you for that hint! Great idea.



              This moment I see your swing indicator in the forum. Is it possible to draw an upfork and a downfork using your swing highs and lows in that indicator?


              Thank you!
              Tony

              Comment


                #8
                Hello tonynt,

                Thanks for your reply.

                I do not know which forum swing indicator you are referring to but if you use the NinjaTrader swing indicator, yes you can as the methods for the swing high/low value and swing high/low bar are exposed.
                Reference: https://ninjatrader.com/support/help...nt7/?swing.htm.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  This here:


                  Comment


                    #10
                    Hello tonynt,

                    Thanks for your reply.

                    The link you provided is the category (indicators) link and it does not specify the indicator.
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello Tony,

                      I've created a short example script using the swing indicator set to a strength of 5 which will draw a PitchFork based on the previous swing low, recent swing high and recent swing low, on live (or replay data) after the first live bar closes. I've also attached a screenshot of expected results.
                      Attached Files
                      Paul H.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello Paul,


                        sorry for wrong posting. Here is the name of the indicator you shared in the indicator section:
                        "350 Swing Trade Indicator as published in February 2010´s Stocks and Commodities Magazine"
                        "RSI_MA_350"









                        Best
                        Tony

                        Comment


                          #13
                          Hello Paul,

                          thank you for the short example you posted. Working with this I have the following questions please:

                          * is it possible to have it plotted not only realtime, it will start plotting every day new when starting NT, no? (so pitchforks in higher timeframes will be gone)

                          * it plots also backwards. Why? How to avoid this please?

                          * I tried to understand the parameters but I cant find in the helpguide the "Swing(5)SswingLowBar(0,2,50)" "....(0,1,50)"

                          * Can you give an hint please how the colors of the pitchfork can be used depending if its an upfork or a downfork to have upforks in green color and downforks in red color? (also the blue ones in between - if possible)?


                          Thank you!
                          Tony
                          Attached Files
                          Last edited by tonynt; 07-05-2018, 04:29 PM. Reason: Clearifying

                          Comment


                            #14
                            Hello tonynt,

                            Thanks for your replies.

                            Yes, you can use the logic of the RSIMA350 indicator to define your pitchfork, however, please note that the indicator actually works off of an SMA of an RSI for determining swings.

                            is it possible to have it plotted not only realtime, it will start plotting every day new when starting NT, no? (so pitchforks in higher timeframes will be gone)
                            You can create an indicator that can plot historically and/or live.

                            it plots also backwards. Why? How to avoid this please? The example I provided was to show how to connect the swing indicator to the pitchfork drawing tool. When you create your indicator you can define the logic of determining the swing points and direction to draw.

                            I tried to understand the parameters but I cant find in the helpguide the "Swing(5)SswingLowBar(0,2,50)" "....(0,1,50)" First, here is a link to the helpguide page: https://ninjatrader.com/support/help...nt7/?swing.htm

                            The swing() method provides for methods to determine Swing High, Swing Low, Swing High Bar and Swing Low Bar. In the case of your question, the parameters of the method are: Swing(IDataSeries input, int strength).SwingLowBar(int barsAgo, int instance, int lookBackPeriod)

                            The parameters are defined in the table in the referenced helpguide page, here is the table list for convenience:

                            barsAgo - The number of bars ago that serves as the starting bar and works backwards
                            input - Indicator source data (?)
                            instance - The occurrence to check for (1 is the most recent, 2 is the 2nd most recent, etc...)
                            lookBackPeriod - Number of bars to look back to check for the test condition. Test is evaluated on the current bar and the bars in the look back period.
                            strength - The number of required bars to the left and right of the swing point

                            In the cases of (0,2,50) and (0,1,50), the code is getting the current bar value of the swing indicator for the 2(nd) instance and the 1(st) instance in the last 50 bars of a swing low bar.

                            Can you give an hint please how the colors of the pitchfork can be used depending if its an upfork or a downfork to have upforks in green color and downforks in red color? (also the blue ones in between - if possible)? You would need to determine this in your code that determines how to draw your pitchfork. I suggest that you add the swing indicator to a chart and then draw your pitchforks using the swing points. Once you determine your swing points for the pitchfork you can then see what sequence creates an up or down direction allowing you then to code the same and select the color for up or down.

                            Please note that if you would like this created for you, you can always ask for a 3rd party coder how can provide this coding service.

                            Alternatively, in NinjaTrader8 you have unlimited templates that you can use.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Hello,


                              usually the helpguide is fine but the explanation for swings is not a really good one. I have now in the code

                              prior3Low = Low[Swing(5).SwingLowBar(0, 3, 50)];
                              prior3High = High[Swing(5).SwingHighBar(0, 3, 50)];
                              prior2Low = Low[Swing(5).SwingLowBar(0, 2, 50)];
                              prior2High = High[Swing(5).SwingHighBar(0, 2, 50)];
                              priorLow = Low[Swing(5).SwingLowBar(0, 1, 50)];
                              priorHigh = High[Swing(5).SwingHighBar(0, 1, 50)];
                              recentLow = Swing(5).SwingLow[0];
                              recentHigh = Swing(5).SwingHigh[0];

                              I want to ask please why recent... and prior... show same value and why prior3Low shows 69.63 which is not the value of the the 3rd lower swing that should be 69.15.

                              I have added the values plotting to the basic swing indicator of NT7.


                              Thank you!
                              Tony
                              Attached Files
                              Last edited by tonynt; 07-26-2018, 11:08 AM. Reason: clearifying

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DanielSanMartin, Yesterday, 02:37 PM
                              2 responses
                              12 views
                              0 likes
                              Last Post DanielSanMartin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              4 responses
                              12 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by terofs, Today, 04:18 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by nandhumca, Today, 03:41 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post nandhumca  
                              Started by The_Sec, Today, 03:37 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post The_Sec
                              by The_Sec
                               
                              Working...
                              X