• 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

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 ;
                            
                                                            BarColor = Color.Red;
                            
                                                            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?
                              Patrick H.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Abilene, Today, 01:27 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post Abilene
                              by Abilene
                               
                              Started by simjs, Yesterday, 08:11 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post simjs
                              by simjs
                               
                              Started by mrlucky1x, Yesterday, 06:01 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post mrlucky1x  
                              Started by dedouglas, Yesterday, 03:17 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by Jugado, Yesterday, 02:22 PM
                              2 responses
                              30 views
                              0 likes
                              Last Post Jugado
                              by Jugado
                               
                              Working...
                              X