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 Hollow Candlesticks

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

    Drawing Hollow Candlesticks

    I would like to create an indicator whose sole function is to draw hollow candlesticks that are outlined with green for up-bars, and outlined with red for down-bars. This seems so simple, yet I can’t seem to get it to work, for the bar colors set by the Data Series don’t get changed. Can you help me get on track?

    #2
    Hello DenMan,
    Thanks for writing in and I am happy to assist you.
    Please try the following code
    Code:
    if (Close[0] >= Open[0])
    	CandleOutlineColorSeries[0] = Color.Green;
    else CandleOutlineColorSeries[0] = Color.Red;
    				
    BarColorSeries[0] = Color.Transparent;



    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Your solution worked great. Thanks for the simple solution!

      Comment


        #4
        Hello DenMan,
        Glad it worked for you.
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Color Bars Indicator

          One further question. When I include this indicator in my workspace, it puts it in a new panel. Is there code to always include this in the Data Series panel, or do I have to manually change that when the indicator is included?

          Comment


            #6
            Originally posted by DenMan View Post
            One further question. When I include this indicator in my workspace, it puts it in a new panel. Is there code to always include this in the Data Series panel, or do I have to manually change that when the indicator is included?
            Overlay = true;

            ref: http://www.ninjatrader.com/support/h...ml?overlay.htm

            Comment


              #7
              Hello,
              Thanks koganam for the code snippet.

              DenMan you can use the code as suggested by koganam.

              Please let me know if I can assist you any further.
              JoydeepNinjaTrader Customer Service

              Comment


                #8
                Hollow bar of plotstyle

                Is anyone here knows how to make the plotstyle bar solid to plotstyel bar hollow?

                Comment


                  #9
                  Hello,
                  NinjaTrader_JoyDeep's example would accomplish this within by creating an indicator that uses the example:
                  Code:
                  if (Close[0] >= Open[0])
                  	CandleOutlineColorSeries[0] = Color.Green;
                  else CandleOutlineColorSeries[0] = Color.Red;
                  				
                  BarColorSeries[0] = Color.Transparent;
                  Cody B.NinjaTrader Customer Service

                  Comment


                    #10
                    That is not what I mean to make a hollow. I know already how to make the price bars to hollow bars. What I want is the plot style of a plot series. For example I have a dataseries name VOL so to plot the values of it is VOL.set(1023.50); and I have set the plotstyle to be a solid bar . I want to make the plotstyle of VOL to a hollow bars instead of a solid bars.

                    Comment


                      #11
                      One way would be to make a custom volume indicator with two bar plots and set the first one to match the chart background color and a slightly smaller size than the second. The problem with this is that the top of the bar will have no outline.
                      eDanny
                      NinjaTrader Ecosystem Vendor - Integrity Traders

                      Comment


                        #12
                        I think that's good idea to try out. Thanks eDanny.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Irukandji, Today, 09:34 AM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Started by RubenCazorla, Today, 09:07 AM
                        1 response
                        5 views
                        0 likes
                        Last Post RubenCazorla  
                        Started by TraderBCL, Today, 04:38 AM
                        3 responses
                        25 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by WeyldFalcon, 08-07-2020, 06:13 AM
                        11 responses
                        1,423 views
                        0 likes
                        Last Post jculp
                        by jculp
                         
                        Started by BarzTrading, Today, 07:25 AM
                        2 responses
                        29 views
                        1 like
                        Last Post BarzTrading  
                        Working...
                        X