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

Bar colour paint

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

    Bar colour paint

    Hi,

    I have a ninjascript which colours a bar red or lime, when a certain condition is met. The bars are painting fine in real time, no problem, working fine.

    If I reload the ninjascript, then the past bars which were previously painted by the script, reset to their default colours, then only newly formed bars paint with the script colour....

    Is there a way to have all previous bars paint in the colour, if the condition at the time was met?

    #2
    ScottieDog, some data (some kinds of volume) is not stored historically and cannot be found when a chart is reset. I sounds like your indicator is for real time only because it uses such data.

    Dan
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Ahh, I see.

      Yes, it is a GOM Cumulative volume tool. It uses the GOM recorder. Strangely though, the GOM indicator at the bottom of the chart retains the paint colour, but that is not sent to the chart candles.... is there a reason for this?

      Comment


        #4
        I'm not at all familiar with it but if it is not hooked into the Gom system it will not be able to use the recorded data.

        Dan
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          Thanks for the assist here eDanny, would agree on those observations.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            As the paint bar for the indicator is retaining, I think I am more than half way there, I am thinking there must be a way to send the historical indicator paint colours to the chart candles?

            Is there a (simple: lol) way to hook the paint bar of the indicator to the paint bar of the chart?

            Comment


              #7
              Hi ScottieDog,

              If you print this value on every bar, does the value change?

              If so, then you can use a custom data series to store these values so you have them historically.

              Below is a link to a reference sample that uses a custom data series.
              http://www.ninjatrader.com/support/f...ead.php?t=7299
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                I dont understand what you mean by "If you print this value on every bar, does the value change?"

                How do I check this?

                Comment


                  #9
                  Hi ScottieDog,

                  If you were to call the indicator you are trying to use and then print the value that you are calling to the output window does each new bar have a different value?

                  I ask because you can collect this and make your own history for this indicator.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    total newbie here. how do i call the indicator and print the output ?

                    Comment


                      #11
                      Hi ScottieDog,

                      I miss-understood, I thought you were trying to call this from a custom indicator.

                      Instead you are applying this indicator to a chart and it is not coloring the bars historically, is this correct?
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        That's right, it's an indicator applied to panel 2 of a chart. It plots bar paint historically inside panel 2 but does not on the candles in panel 1

                        Comment


                          #13
                          Hi ScottieDog,

                          Do you have two instances of the indicator added one for each panel?

                          May I have a screenshot of your chart?
                          To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

                          For detailed instructions please visit the following link
                          http://take-a-screenshot.org/
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi,

                            I only have one instance of the indicator on the chart, on panel 2.

                            I have attached a screenshot. As you can see, on the indicator there are various painted bars which are holding the paint from historical, the candles however are not painting with historical. In realtime the candles paint along with the indicator fine, its only when refreshing a chart the candle bar paint goes.

                            The barpaint is coded with the following....... I assume the part in bold makes the bar paint? I´m not too sure as I have little experience with code.

                            Code:
                            if (direction == 1 && (Open[CurrentBar - index] > Close[CurrentBar - index]))
                            
                                                    {                                
                            
                                                            drawPen.Color = Color.Red ;
                            
                                                            [B]BarColor = Color.Red;[/B]
                            
                                                            myTag += 1 ;                       
                                                    }
                            Attached Files

                            Comment


                              #15
                              Hello ScottieDog,

                              Thank you for your response.

                              Can you provide the full .cs file so I may test the code on my end?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by RookieTrader, Today, 09:37 AM
                              3 responses
                              14 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by kulwinder73, Today, 10:31 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post kulwinder73  
                              Started by terofs, Yesterday, 04:18 PM
                              1 response
                              23 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by CommonWhale, Today, 09:55 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by Gerik, Today, 09:40 AM
                              2 responses
                              7 views
                              0 likes
                              Last Post Gerik
                              by Gerik
                               
                              Working...
                              X