Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close[] High[] Low[] returning same value

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

    Close[] High[] Low[] returning same value

    Hi,

    I am working with a very very simple indicator, but High[0] Close[0] Low[0] seem to return the same value, Close[0]. I am sure that the data is not the problem because the candles are drawn correctly with different High and Low values.

    Did I do something wrong? I have attached a picture to show the point.

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "High"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Purple), PlotStyle.Line, "Close"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Low"));
    Overlay= false;
    }

    protected override void OnBarUpdate()
    {
    High.Set(High[0]+300);
    Close.Set(Close[0]+200);
    Low.Set(Low[0]+100);
    }
    Attached Files
    Last edited by usuallywin; 02-02-2013, 07:40 PM.

    #2
    It is even stranger with:

    High.Set(High[10]+300);
    Close.Set(Close[10]+200);
    Low.Set(Low[10]+100);
    Attached Files

    Comment


      #3
      Originally posted by usuallywin View Post
      Hi,

      I am working with a very very simple indicator, but High[0] Close[0] Low[0] seem to return the same value, Close[0]. I am sure that the data is not the problem because the candles are drawn correctly with different High and Low values.

      Did I do something wrong? I have attached a picture to show the point.

      protected override void Initialize()
      {
      Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "High"));
      Add(new Plot(Color.FromKnownColor(KnownColor.Purple), PlotStyle.Line, "Close"));
      Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Low"));
      Overlay= false;
      }

      protected override void OnBarUpdate()
      {
      High.Set(High[0]+300);
      Close.Set(Close[0]+200);
      Low.Set(Low[0]+100);
      }
      I am surprised that you got an output rather than throwing an exception and crashing. Your code is assigning values to the input DataSeries!

      IOW, the first thing that you need to do is change the name of your Plots, so that you are not assigning values to the input DataSeries. If you still have issues after that, another look might be warranted.

      Comment


        #4
        Thanks so much. Silly me.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        336 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 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
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X