Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plot width and plot scaling

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

    plot width and plot scaling

    Hello

    please can you explain how I could get the horizontal hash plot with a thickness of 2. I have tried various combinations with no success. Maybe you could add an example on the help (image attached)

    With regard to plotting the indicator over the price chart there is an issue with scaling that I can't solve:
    if I set in the script scale justification as “overlay” all the 7 lines of the indicator are shown within the scale requested by the price, but with values that do not combine with the scale of the price;
    If I put indicator scale justification right, same as price, tha scale of the indicator is the same to that for price, but since the range of the indicator lines is 6 STD price chart is compresses in a very narrow section of the right hand scale.
    How can I tell the indicator script to leave the scale of the price unchanged and to plot on the chart only those horizontal lines that fall within the current optimal scaling determined by price?

    Thank you.
    gt
    Attached Files

    #2
    Hello guidoisot,

    Thanks for your post.

    The help guide shows that the parameter "width" is of the numerical type "float". Float is a C# numerical value type, here is an external link for clarity: https://docs.microsoft.com/en-us/dot...-numeric-types All you need to do, with reference to your code, is to remove the word float and leave the numeric value 2 (or any value you wish that fits within the range of a float type). Example: AddPlot(new Stroke(Brushes.DeepPink, 4), PlotStyle.Hash, "HashPlot");

    The scale justification Overlay in general should not be used unless you wish to have a display that does not relate to the charts price scale but is adjusted to fit within indicators plots within the charts current view (regardless of the indicators plots price). Overlay is helpful when you have an indicator that you want to see in the same panel as something else that does not relate price wise. So it is best to consider using overlay as a visual representation only.

    The issue you face is similar to what the "pivots" indicator experiences if it is was set to "autoscale". Because the pivots indicator may have plots that are well outside of the current price, the indicator by default has autoscale turned off. This means that the chart does not include the values of the all the pivots in determining how to scale the chart. I recommend that you set your indicators Autoscale to false so that it does not compress the price bars to display all of the lines. You can set the indicators Autoscale to default to false by changing it in your State.SetDefaults. Please see: https://ninjatrader.com/support/help...sautoscale.htm

    Comment


      #3
      Thank you Paul.
      Now i remember: fixed point decimal vs floating point decimal ....
      that was the meaning of "float"

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X