Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Big plot value makes it to disappear

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

    Big plot value makes it to disappear

    I made indicator that can mark some bars.

    It looks like this:

    Code:
            
            protected override void Initialize()
            {
                Add(new Plot(Color.FromKnownColor(KnownColor.RoyalBlue), PlotStyle.Bar, "Plot0"));
                Overlay                = true;
                AutoScale           = false;
            }
    
    
            protected override void OnBarUpdate()
            {
                if( CurrentBar < 1 ) return;          
                if( Time[1].Hour != Time[0].Hour ) Plot0.Set( 1000000 );
            }
    When indicator work on 8 range chart - it work normally.
    But when I put it on 1 range chart it also work ok until I scroll chart - after scrolling indicator disappeared.

    If i write Plot0.Set( 10000 ), it begin to work normally.

    What value I have to set to see vertical bar on all instruments and all charts?
    May be Close*2 ?
    Attached Files
    Last edited by fx.practic; 08-01-2015, 09:01 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Code:
    Plot0.Set( Close*2 )
    worked good until I put
    Code:
    Plots[0].DashStyle = DashStyle.Dot;
    into OnStartUp(). After that, vertical lines disappeared again.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    Comment


      #3
      Are you getting any errors in your log tab on the control center?

      Comment


        #4
        Oh, thank You! Ofcourse, how can I forget to look there!

        There was errors - screenshot attached.

        So, what are the biggest and smallest valid plot values?
        Attached Files
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          Believe they are double.MaxValue and MinValue

          Comment


            #6
            This is logical. But, 1 000 000 produce error.
            And approximate range of double ±5.0 × 10−324 to ±1.7 × 10+308

            By the way, I found out that Plot0.Set( Close[0]*2 ) slows scroll significantly whem plots are visible.

            And Plot0.Set( Close[0] ) don't slows chart scrolling.
            fx.practic
            NinjaTrader Ecosystem Vendor - fx.practic

            Comment


              #7
              Close[0] +150* TickSize, for example, don't slow 1 range, but it looks strange on 16 range (screenshot).

              So the question: how to determine number of ticks that enough to hide upper edge of bar
              beyond upper chart edge (for different timeframes, scaling, instruments) ?


              (I know that it can be done by DrawVerticalLine() but big quantity of chart objects significantly slows operating with chart.)

              P.S.I use Close[0] +1000* TickSize for all CL charts now, but I don't like this solution at all.
              Attached Files
              Last edited by fx.practic; 08-01-2015, 02:18 PM.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                Hello fx.practic,

                You could run something like MAX(), but then again you are concerned on performance and this will likely slow performance if you had MAX(High, CurrentBar-1)[0] as the plot.

                So you have a few choices, I would recommend experimenting until you find something that works best for your specific cases.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sjsj2732, 03-23-2026, 04:31 AM
                0 responses
                49 views
                0 likes
                Last Post sjsj2732  
                Started by NullPointStrategies, 03-13-2026, 05:17 AM
                0 responses
                300 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                294 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                139 views
                1 like
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                98 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Working...
                X