Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar's range in text above or below the bar?

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

    Bar's range in text above or below the bar?

    How can I plot text of the bar's range on the chart? I would like the range to be plotted under the low on upticks and above the high on downticks.

    #2
    something like that. u might have to round "barrange" up or down or convert it into a real number depending on what instrument your looking at, bc with some you might get alot of zeros like 0.000300000001 for example. but for now, that should do the trick.

    double barrange=Math.Abs(High[0]-Low[0]);
    if(Close[0]>=Open[0])
    DrawText("range"+CurrentBar, barrange.ToString(),0 , Low[0], Color.Black);
    if(Close[0]<Open[0])
    DrawText("range"+CurrentBar, barrange.ToString(),0 , High[0], Color.Black);

    Comment


      #3
      Originally posted by BigRo View Post
      something like that. u might have to round "barrange" up or down or convert it into a real number depending on what instrument your looking at, bc with some you might get alot of zeros like 0.000300000001 for example. but for now, that should do the trick.
      Yes I figured out the first part. Had to convert to String. How do I round it?

      Comment


        #4
        Nevermind figured that out as well. C# isn't really that different than Java.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X