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

Plots and PlotBrushes...Difference

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

    Plots and PlotBrushes...Difference

    hi,

    what is the difference ?

    if i want to change color in Plot line..
    i use :
    PlotBrushes[3][0]=color

    or

    Plots[3]=color

    and if i want change width i can't to use PlotBrushes..is correct?

    I need to change color, PlotStyle and Width during trading session

    thanks
    Last edited by turbofib; 02-08-2017, 04:59 AM.

    #2
    Hello turbofib,

    Thank you for the question.

    You could be correct, you can not change width with a Brush, a Brush is simply the color that would be used but does not specify any other style information.

    You can set the width of a plot using the following syntax:

    Code:
    Plots[0].Width = 12;
    and the PlotStyle:

    Code:
    Plots[0].PlotStyle = PlotStyle.Bar;
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      hi,
      i write a stupid indicator (prova3.zip)

      i try to change plotstyle in OnBarUpdate but i did not get the desired result

      can you test it and find the error..thanks
      Attached Files

      Comment


        #4
        Hello turbofib,

        I see this working as I would expect, the PlotStyle controls the entire plot, there would not be a way to control this Per bar like the BarBrush.

        I see that if I control the number of bars loading on the chart, I can see the various PlotStyles being used. Additionally if I wait for i to be reset I can see this cycling through the various plot styles.

        Can you tell me, what is the outcome you are seeing versus what you were expecting?

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello turbofib,

          I see this working as I would expect, the PlotStyle controls the entire plot, there would not be a way to control this Per bar like the BarBrush.

          I see that if I control the number of bars loading on the chart, I can see the various PlotStyles being used. Additionally if I wait for i to be reset I can see this cycling through the various plot styles.

          Can you tell me, what is the outcome you are seeing versus what you were expecting?

          I look forward to being of further assistance.
          excuse from your speech I did not understand much ...

          i'd like to change plotstyle in OnBarUpdate..but if i use Plot[0].PlotStyle=PlotStyle.Dot
          (is an example) ...i can't do it..


          you said :

          and the PlotStyle:

          Code:
          Plots[0].PlotStyle = PlotStyle.Bar;
          but I couldn't do it

          Comment


            #6
            Hello turbofib,

            I am not certain I understand your reply.

            I previously said that I can see this example working, are you seeing an error or what is the outcome you are seeing that is not expected? The sample you provided compiles and runs, if you are not seeing the expected result I would suggest to try a more simple example that does not include the i++;

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              See pictures....

              i want to change plotstyle ...
              i can't to do it..

              do you understand?
              Attached Files
              Last edited by turbofib; 02-08-2017, 12:31 PM.

              Comment


                #8
                Hello turbofib,

                Yes I mentioned this is not possible previously:
                The PlotStyle controls the entire plot, there would not be a way to control this Per bar like the BarBrush.
                The property PlotStyle controls the whole plot, you can not have multiple PlotStyles applied at the same time.

                You would need to add plots for each of the styles you want to use and only set values to those plots on the bars needed. If there is no plot needed on a bar you could use the Reset:


                Reset() method allows you to effectively ignore the value of the current bar for plotting purposes.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Hi turbofib,
                  this is quite simple but it requires a little work. Just don't call base.Render() (or similar method in Render method of indicator - I don't remember right from my head and don't have a NT in front of me) and the plots won't be rendered automatically. After then, you need to implement your plot render method where you can just decide how you will draw each of the ticks for visible range of values.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by sidlercom80, 10-28-2023, 08:49 AM
                  167 responses
                  2,260 views
                  0 likes
                  Last Post jeronymite  
                  Started by warreng86, 11-10-2020, 02:04 PM
                  7 responses
                  1,361 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by Perr0Grande, Today, 08:16 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post Perr0Grande  
                  Started by elderan, Today, 08:03 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post elderan
                  by elderan
                   
                  Started by algospoke, Today, 06:40 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post algospoke  
                  Working...
                  X