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

Plotting Position

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

    Plotting Position

    Hello,


    I have a problem with Drawing Objects. I tried different possibilities from help guide.
    The problem still is that eg the DrawDot is not in a certain distance always from High or Low. I have in the code eg if()

    {DrawDot("ba1" + CurrentBar, true, 1, High[1] + 3*TickSize, Color.LightCoral);}

    DrawDot("ba2" + CurrentBar, true, 1, High[1] + 3*TickSize, Color.Gray);}

    and as you can see in the attached screenshot the distance from the high is not the same. It also occurs frequently that the dot is plotted at the high and one can not read the numbers at high.
    When I add more x*TickSize then its often far away from the High.


    Isnt it possible to have always the same distance as coded?


    Thank you!
    Tony
    Attached Files

    #2
    Hello tonynt,

    In this case, I would expect this if the scales are at all different. The dot will be positioned 3 ticks above the high which will be a variable distance depending on the scale you currently have set.

    If you scale in, the distance will become farther away from the bar and if you scale out, you may see the dot on top/behind the bar.

    If you are trying to keep a constant distance you would need to use the Plot override and render a dot instead of using the object. This would be similar to the grid that is being drawn in your image. Drawing objects by nature account for the scaling of the chart when you use them.

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

    Comment


      #3
      Tony,
      I may be wrong but it appears you are trying to access the High of a non-primary data series i.e. [1]. If that's the case, then what I learned is that you must use Highs[1] or Lows[1], i.e. the plural.

      Alternatively, if you did mean to address the primary data series, you may want to change the [1] to a [0] so as to refer to the current bar.

      sandman
      Last edited by sandman; 10-01-2018, 08:39 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CortexZenUSA, Today, 12:53 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Started by CortexZenUSA, Today, 12:46 AM
      0 responses
      0 views
      0 likes
      Last Post CortexZenUSA  
      Started by usazencortex, Today, 12:43 AM
      0 responses
      2 views
      0 likes
      Last Post usazencortex  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      168 responses
      2,262 views
      0 likes
      Last Post sidlercom80  
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X