Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Out of the last x bars mark bars with the same high/low

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

    #31
    Originally posted by ninZa View Post
    @Outsource I don't know what you mean. I don't see any redirect to drawarrowdown. Perhaps there is a browser issue on your end.

    @skiguy Your project is not a straightforward one, if you want to code it yourself.
    I agree. Hence my comments that I updated.

    It is far from str fwd but it is not a big job for a pro by any means.

    If I don't get a solution here or at Big Mike's I will give it to a freelancer from one of the freelance sites to code.

    My Excel VBA developer does not know C# otherwise I wld give it to him but if it was in Excel I wld say he wld provide code that was 100% tested in 1 hour..
    Last edited by skiguy; 04-05-2015, 10:49 PM.

    Comment


      #32
      Originally posted by skiguy View Post
      NP.

      Outsource can you take up your query in another thread or via PM to ninZa please.
      Thanks to outsource's question, I know your project
      I will provide you with some codes for your project tomorrow.

      Cheers.
      Pi
      ninZa
      NinjaTrader Ecosystem Vendor - ninZa.co

      Comment


        #33
        Thanks Pi.

        That would be great.

        Comment


          #34
          skiguy, I have just made a sample code for the Highs.

          You can make some copies and edits to produce the codes for the Lows.
          You may want to add your own tweaks to differentiate the Highs by letter, such as 2a 2a, 2b 2b, 2c 2c.

          Please read the codes and feel free to ask me any questions if you are not clear.
          It uses C# Dictionary, if you are not familiar with it, please google to learn.

          The speed has not been optimized, so you can work on it yourself.
          If you put the codes in override Plot() rather than OnBarUpdate, the loading speed will be much improved but this is advanced programming.

          Pi

          using System.Collections.Generic;

          int LookBack = 10;
          Dictionary<double, List<int>> d = new Dictionary<double, List<int>>();

          protected override void OnBarUpdate() {
          if (CurrentBar < LookBack) return;
          if (!FirstTickOfBar) return;

          RemoveDrawObjects();
          d.Clear();

          for (int i = 0; i < LookBack; i++) {
          if (!d.ContainsKey(High[i])) d.Add(High[i], new List<int>());

          d[High[i]].Add(CurrentBar - i);
          }

          foreach (KeyValuePair<double, List<int>> pair in d) {
          if (pair.Value.Count < 2) continue;
          foreach (int barIndex in pair.Value) {
          DrawText("high" + barIndex, AutoScale, pair.Value.Count.ToString(), CurrentBar - barIndex, High[CurrentBar - barIndex], 10, Color.Blue, ChartControl.Font, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
          }
          }
          }
          ninZa
          NinjaTrader Ecosystem Vendor - ninZa.co

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          563 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          329 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          547 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X