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

DrawDot and Plot line mysteries

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

    DrawDot and Plot line mysteries

    Dear NT programmers,

    1. I am developing my own indicator on NT 6.5 and using both Plot and DrawDot methods. I get visual results and indicator is very usable. However what amazes me is the fact, that Dots I draw can be easily removed via context menu on graph itself by selecting Drawing Tools-> Remove Drawing Objects. And this is REAL problem. Also they are selectable and I can move these around graph easily with mouse... What I am missing? How to make them permanently sticked on graph ? I draw dots with:

    Code:
    DrawDot("MRising"  + CurrentBar, true, 0, GraphValue[0], mRisingColor);
    2. Next interesting thing is that plotted line somehow lacks of sharpness. Looks like it is antialiased or smth... Are there any settings to increase "sharpness" of plotted object? I plot line with this:

    Code:
    Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "ZeroLine"));
    Plots[0].Pen.DashStyle = DashStyle.Solid;
    Plots[0].Pen.Width = 4;
    3. And last thing - I needed to draw big dot and tried to draw these with DrawText using simple dot symbol, as many people on forum talk about. I was successful, however I had to gues start Y position to line center of dot to my zero line. However strange thing was that despite the fact that dots was written constant 0.005 Y coordinate - sometimes they were up more than constant. This was especialy visible scrooling graph several days ago. Is this somehow related to Auto Scale or what? Again how to fix texted dot possition so it remains rock stable at constant Y coordinate?

    Code:
    mFont = new Font("Symbol", 38);
    DrawText("m"+ CurrentBar, true, "·", 0, 0.005, ydBullishColor, mFont, 
                StringAlignment.Center, Color.Transparent, Color.Transparent,0);
    P.S. Why we should use Color.FromKnownColor declarations? What is difference compared to simple Color."ColorName" ?

    Thank you very much for suggestions.
    -Andrius.
    Last edited by andrius; 12-04-2010, 11:47 PM.

    #2
    andrius,

    1) With NT7, you can "lock" drawing objects so they cannot be moved. Unfortunately this option is not present in NT6.5.

    2) You can create a "sharper" line by plotting it with a smaller width.

    3) Can you please describe this a bit more? I have a feeling this is simply the auto-scaling feature kicking it because the dot is a fixed distance from your Y location, but all of the rest of the chart is scaled automatically.

    4) I will have someone get back to you with the color question, but it doesn't really make much of a difference. You can use Color.[Color] or the Color.FromKnownColor() method.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Andrius,

      For our intents and purposes there really is no big difference between how you create your colors. If you want to just go Color.Blue for instance you can definitely do that.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NM_eFe, Today, 10:13 AM
      0 responses
      1 view
      0 likes
      Last Post NM_eFe
      by NM_eFe
       
      Started by hdge4u, Yesterday, 12:23 PM
      1 response
      10 views
      0 likes
      Last Post hdge4u
      by hdge4u
       
      Started by 1001111, Today, 09:45 AM
      0 responses
      4 views
      0 likes
      Last Post 1001111
      by 1001111
       
      Started by DTSSTS, 01-28-2024, 12:07 PM
      11 responses
      557 views
      0 likes
      Last Post bmo111
      by bmo111
       
      Started by Torontobluejays, Today, 08:43 AM
      0 responses
      1 view
      0 likes
      Last Post Torontobluejays  
      Working...
      X