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

Please provide support for the development of a paint bar indicator.

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

    Please provide support for the development of a paint bar indicator.

    Hello, I would like to develop an indicator that would paint the candles with different colours when certain conditions are met. I would like to develop my skills in programming but unfortunately I am a complete novice in this regard.

    Is it possible to use strategy builder to build a paint bar indicator for certain conditions (e.g., current bar's high is above past bar or past two bars)? the strategy builder would allow me to set the conditions using mouse and click but that is only for strategy and not for indicator. I don't want to automate trading and I just want to create an indicator that shows the paint bar.

    Can someone provide me with a template for the ninja indicator script? or can someone provide certain document that i can follow?

    Many thanks

    #2
    Actually, I would like to create a number of paint bar indicators. I would also want to paint inside bars, bars with much bigger range than others, outside bars etc. I greatly appreciate helps that would help me start building those indicators. Many thanks.

    Comment


      #3
      Hello Realiori9999,

      Thanks for your post.

      The C# programming language is used for developing NinjaScript indicators and strategies.

      To create a NinjaScript indicator, open a New > NinjaScript Editor window, select the '+' tab at the bottom of the Editor window, select 'New Indicator'. Then, you could set up as much of the indicator as possible in the Indicator Builder. This will create the framework of the indicator.

      Once you finish setting up as much as possible in the Indicator Builder, you must manually program the rest of the indicator.

      Below is a link to a forum post with helpful information about getting started with NinjaScript.
      https://ninjatrader.com/support/foru...040#post786040

      I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
      https://ninjatrader.com/support/help..._resources.htm

      If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
      https://ninjatrader.com/support/help...g_concepts.htm

      And the MSDN (Microsft Developers Network) C# Language Reference.
      https://ninjatrader.com/support/help...erence_wip.htm​​

      The BarBrush property could be used to change the color of a bar when a certain condition occurs.

      To change the color of a bar when the current High price is greater than the previous bar's High price and the High price two bars ago, you could create a NinjaScript indicator that checks if the current High price (High[0]) is greater than the previous bar's High price (High[1]) and checks if the current bar's High price (High[0]) is greater than the High price two bars ago (High[2]). Then, set the BarBrush property within that condition.

      Note that we reference the current bar High by passing in a barsAgo of 0. The previous bar's High price is accessed by passing in a barsAgo of 1. The High price two bars ago is accessed by passing in a barsAgo of 2, and so on.

      For example:

      if (High[0] > High[1] && High[0] > High[2])
      {
      BarBrush = Brushes.Blue;
      }


      See the help guide documentation below for more information.

      BarBrush: https://ninjatrader.com/support/help...8/barbrush.htm
      High PriceSeries: https://ninjatrader.com/support/helpGuides/nt8/high.htm
      PriceSeries: https://ninjatrader.com/support/help...riceseries.htm

      I have also attached a simple indicator script demonstrating the use of BarBrush that you could view.
      Attached Files
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Brandon, you are awesome! with your template, I am able to make ChatGPT to explain the logics behind it, and I have successfully created one of the paint bar indicator that I want! Thank you so much! i would start to work on this. I may have some specific questions, please allow me to ask again later! Thanks!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by PeakTry, Today, 10:49 AM
        0 responses
        2 views
        0 likes
        Last Post PeakTry
        by PeakTry
         
        Started by llanqui, Today, 10:32 AM
        0 responses
        4 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by StockTrader88, 03-06-2021, 08:58 AM
        45 responses
        3,992 views
        3 likes
        Last Post johntraderuser2  
        Started by TAJTrades, Today, 09:46 AM
        0 responses
        8 views
        0 likes
        Last Post TAJTrades  
        Started by rhyminkevin, Yesterday, 04:58 PM
        5 responses
        62 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Working...
        X