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

Detecting Shave Bars and One Tick Tails?

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

    Detecting Shave Bars and One Tick Tails?

    How do I detect:

    - Shaved bars, with no tail on top or bottom
    - Bars with a shaved top, and a one-tick tail on the bottom.

    In both cases, the bar is shaved on the top side in the momentum of the trade. On the bottom side, it's either shaved or a one tick tail. I can't find the right property to unlock this bar attribute. Thanks.
    Attached Files

    #2
    Hello timmbbo,

    Thanks for your post.

    There is no bar attribute that matches your descriptions. To detect these conditions you would need to create an indicator.

    The conditions could be coded something like:

    if (Close[0] > Open[0] && Low[0] == Open[0] && Close[0] == High[0])
    {
    //shaved up bar, do something
    }

    else if (Close[0] > Open[0] && Low[0] == Open[0] - 1 * TickSize && Close[0] == High[0])
    {
    // Shaved top with 1 tick tail, do something
    }
    else if (...)

    You would continue to code in that manner to detect the various conditions you are looking for.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the example - I have it working now.

      Comment


        #4
        Hi timmbbo or PaulH I'm new to this forum and was reading over your request and wanted to know if you didn't mind sharing the file? I'm a total newbie at coding and I'm not sure how to add in the information provided. Thanks in advance

        Comment


          #5
          Hello JustinaM,

          Thanks for your post and welcome to the NinjaTrader forums!

          I do not have the file to share.

          The code I showed would go into the OnBarUpdate() method, however, all I showed was how to configure the condition as I did not know what actions member timmbbo wanted to perform.

          NinjaScripts are built on C#. While we do not provide programming education services in the Support Department, there are a vast number of educational C# resources external to NinjaTrader and we do have some tutorials and tools that can assist in the learning process.

          Many users report that a good way to start before fully learning C# is to go through the NinjaTrader 7 NinjaScript tutorials in the help documentation to get a fundamental grasp on .NET framework and how it is used in NinjaScript. From there I suggest looking at the Code Breaking changes for NinjaTrader 8 to understand the differences between NinjaTrader 7 and NinjaTrader 8.

          You can view the tutorials for NinjaTrader 7 here: https://ninjatrader.com/support/help...?tutorials.htm

          Although we do not currently provide NinjaScript tutorials like in NinjaTrader 7, we do provide in-depth help documentation on developing NinjaScripts for NinjaTrader 8. We also provide samples and a complete reference of the language. More in depth educational resources can be found elsewhere throughout the internet.

          You can find the educational resources here: http://ninjatrader.com/support/helpG..._resources.htm

          Once you have a basic understanding of C#, I suggest following the documented Code Breaking changes between NinjaTrader 7 and NinjaTrader 8. This page also gives an overview for NinjaScripts in NinjaTrader 8.

          You can find the Code Breaking changes here: http://ninjatrader.com/support/helpG...ng_changes.htm

          Other users have wrote in about this information in our support forums here: https://ninjatrader.com/support/foru...d.php?p=488807

          Also available are webinars on the NinjaScript editor and the Strategy Builder. The Strategy Builder can be used to generate NinjaScript syntax for NinjaScript strategies. You may wish to create a strategy and clicking View Code after each piece of logic created in the Builder to observe the generated syntax.

          Strategy Builder 301: https://www.youtube.com/watch?v=HCyt90GAs9k

          NinjaScript Editor 401: https://www.youtube.com/watch?v=K8v_2ONBbqI

          You can register for live webinars here: https://ninjatrader.com/PlatformTraining

          Our documentation will be your best friend while developing, and the complete supported NinjaScript interface can be referenced here: http://ninjatrader.com/support/helpGuides/nt8/en-us/

          The information above is publicly available.

          Finally, we also have a vast EcoSystem of NinjaScript Consultants that would be happy to write or modify any NinjaScript at your request. If those services interest you, we can have a representative of our EcoSystem reach out with more information.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Thank you so much for all the information! I appreciate it!

            Comment


              #7
              Good Morning PaulH, I tried making the indicator and I wasn't able to get the signal onto the chart but it will compile with no errors, can I send over an email and have you take a look? Also, I would like to have the Consultants contact me. Thanks

              Comment


                #8
                Hello JustinaM,

                Thanks for your reply.

                While a script can compile without errors the compiler cannot test run-time conditions. When you apply the indicator to a chart, please check the "Log" tab of the NinjaTrader control center for any related error messages. Do you see any errors?

                I will ask our vendor support team to post a message here for you.

                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Hello,

                  Thank you for your post.

                  You can search our list of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:
                  You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

                  The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem, LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                  Let me know if I may be of further assistance.
                  Thomas C.NinjaTrader Customer Service

                  Comment


                    #10
                    Good morning PaulH I checked the Log and there are no related errors being shown. I was under the impression that you all actually do coding services yourselves. But I took a look at the list and thank you.

                    Comment


                      #11
                      Hello JustinaM,

                      Thanks for your reply.

                      We do not provide coding or debugging services. We are glad to help with any specific Ninjscript question.

                      I received your e-mail and will be replying to it shortly.

                      Paul H.NinjaTrader Customer Service

                      Comment


                        #12
                        ok thank you so much.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by gravdigaz6, Today, 11:40 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post gravdigaz6  
                        Started by MarianApalaghiei, Today, 10:49 PM
                        3 responses
                        9 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by XXtrader, Today, 11:30 PM
                        0 responses
                        3 views
                        0 likes
                        Last Post XXtrader  
                        Started by love2code2trade, Yesterday, 01:45 PM
                        4 responses
                        28 views
                        0 likes
                        Last Post love2code2trade  
                        Started by funk10101, Today, 09:43 PM
                        0 responses
                        9 views
                        0 likes
                        Last Post funk10101  
                        Working...
                        X