• 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

Green and Red bars counter

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

    Green and Red bars counter

    hello,
    is there an indicator that counts number of green and red bars starting from a specefic time ?
    it wil plot on a corner the number of green candles and the number of red candles, and it should be updated automatically on each bare close.
    for example i want to know how many green candles and red candles exist starting from for example 10 am .
    it will plots for me :
    green candles : 700 for example
    red candles : 600
    thanks

    #2
    Hello elkhatabi,

    Thanks for your post and welcome to the NinjaTrader forums!

    I am not aware of such an indicator.

    If you would like to create this indicator yourself we can provide you with references to get you started with Ninjascript which is based on C# .Net

    Alternatively, if you would like it created for you, we can provide you with references to 3rd party programmers who would be happy to provide this service.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello Paul,
      thank you very much!
      yes, a would be glad to create it with your help!
      the base algorithm for the indicator is represented in the picture below. but unfortunately i don't know how to implement it in ninja trader
      thanks alot
      Attached Files

      Comment


        #4
        Hello elkhatabi,

        Thanks for your reply.

        Based on your goals, I would suggest using Bars.ISFirstBarOfSession as a true/false property that you can reset your two colored bar counters. You would create Int type variables to use as counters. For the time element, you can compare the bar close time Time[0] to a time you specify to begin counting (example provided below). If the Close[0] > Open[0] then you have a green bar. If the Close[0] < Open[0] then you have a Red bar (I do not know if you wish to consider a doji bar where Close[0] = Open[0] but that is also there). To present the data on the chart, I recommend using Draw.TextFixed() to display the counts (and perhaps the start time for reference) in any of the 4 corners of the chart. I'll attach help guide links to assist with the different methods:
        https://ninjatrader.com/support/help...rofsession.htm
        https://ninjatrader.com/support/help...ice_series.htm
        This is an example of a time filter (strategy but can use same code in indicator): https://ninjatrader.com/support/help...to_limit_t.htm
        https://ninjatrader.com/support/help..._textfixed.htm

        Just to be clear, as we are a small team, we do not provide code writing or debugging services. You will need to go through the reference materials to get started.

        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 written 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


          #5
          Hello!
          i have another question,please
          let's say i created an indicator and i want to sell it to traders, how can i assure that the indicator will work only for the person i sold to.
          in other words, how to let the indicator work for one ip adress, if the person i sold it to gave to another trader, it won't work for him.
          thanks in advance

          Comment


            #6
            Hello elkhatabi,

            Thank you for your continued interest in NinjaTrader!

            There are various methods of licensing your products that you have created for NinjaTrader and controlling who has access to them.

            Please send an email to [email protected] with this post referenced so our team can further discuss how you can move forward in this area.
            Ryan L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bauerjj10, Today, 12:24 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Newtrader101, Today, 06:01 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by Steve L, Today, 03:50 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by kherzfeldt6953, Today, 06:11 PM
            0 responses
            1 view
            0 likes
            Last Post kherzfeldt6953  
            Started by Newtrader101, Today, 05:32 PM
            0 responses
            4 views
            0 likes
            Last Post Newtrader101  
            Working...
            X