Announcement

Collapse
No announcement yet.

Argh!!

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

  • Argh!!

    Hello ladies and germs,

    I have but two hairs left on my head, the majority of which have fallen out the past four days.

    I am attempting to read a CSV file with multiple support levels per day (please see attached) and wish to chart these support area on an advanced chart. These levels vary by date and for backtesting purposes wish to chart them on history. These support levels are unique by date as indicated below.

    I have successfully read a file (comma separated value file) and can more than likely plot a line based on values in the file.

    My PRIMARY issue is determining the date of the BAR currently being loaded. Here's an example:

    Today is March 10, 2004... I have support and resistance levels in a CSV file dated back to Feb. 1, 2004 (unique by date). I wish to chart these support and resistance levels on a 15 minute chart - with data loaded from Feb 1.

    The code that I have copied from various EFS files is close to working except for determining the date.

    If someone on this forum has the patience and knowledge to review the attached - would you have an idea of how i can accomplish my task?

    If my explanation is unclear, please let me know... I will attempt to clarify.

    Here is a sample of the CSV file being read:

    1,3/5/2004,1149,1152
    2,3/5/2004,1147,1148
    1,3/8/2004,1140.75,1142.25
    2,3/8/2004,1137.5,1139
    1,3/9/2004,1130.25,1134
    2,3/9/2004,1139,1141.75
    1,3/10/2004,1130,1133
    2,3/10/2004,1120,1124


    All i need to do is to draw a line (support/resistance) on the chart by date, so that I can vissually determine the validity of these support & resitance levels.

    Your input sure is welcomed - I can't get the dates right - thx in advance.

    Kim
    Attached Files

  • #2
    well, are you trying to plot the previous days support resistance on the next days chart? If so there is an easier way and the efs's are out there.

    Otherwise, are you trying to plot a specific date's support resistance on todays date? I am confused.

    This is a link to a thread where there are some efs to get previous days OHLC values which may be helpful

    http://forum.esignalcentral.com/show...revious+day%2A

    Comment


    • #3
      Steve,

      Thanks for your reply - I understand your scratching your head after reading my plea for assistance... I was unclear in my explanation.

      I am looking to plot Sup/Res for previous days and current day, based on the date indicated in my CSV file.

      I will take a peak at the information you pointed me towards.

      Thanks again,
      Kim

      Comment


      • #4
        havmann,
        This sounds interesting and should be possible...in fact, I'll have to deal with a similar problem in the very near future for something I'm working on.
        I'll be happy to look at it further, but it will have to wait until this weekend.

        Bob

        Comment


        • #5
          Bob,

          Assuming I make some headway today & tomorrow, I'll post my discoveries on this thread for your review.

          Thanks for your interest,
          Kim

          Comment


          • #6
            The reading of the file is working fine.
            The splitting of the record works fine

            I am trying to draw the sup/res lines from the start of the trading day (loaded from csv file) to the end of the trading day. I had to pass a date parameter, so the only lines drawn are the sup/res lines that match the "hard coded" date - yuk.

            Is there anybody out there that can decipher my request and point me in the right direction of loading the date dynamically and drawing unique lines by trading date.

            As an example: on a 5min chart (spanning 2 trading days), I will have 4 support and resistance levels for each day. These support and resistance levels are read from a CSV file:

            Seq#, Date, Support Resistance
            1 , 3/5/2004, 1149, 1152
            2, 3/5/2004, 1147, 1148
            3, 3/5/2004, 1140.75, 1142.25
            4, 3/5/2004, 1137.5, 1139
            1, 3/6/2004, 1130.25, 1134
            2, 3/6/2004, 1139, 1141.75
            3, 3/6/2004, 1130, 1133
            4, 3/6/2004, 1120, 1124

            ultimately i will have eight lines per day (4 sup and 4 res) each starting from the first bar the day and ending on the last bar of the day (determined by the date in the above CSV file). So with the data above, I will have 16 lines drawn on a chart. Does that make sense????

            The attached EFS will draw the lines but only for the date specified in the parameter.

            If you have any suggestions, I am eager to hear them.

            Thanks in advance,
            Kim
            Attached Files

            Comment


            • #7
              havmann,
              I am sorry it took so long to get back to this.

              If you still need the code to read and plot your lines dynamically, let me know here. I have two solutions that work well, depending on your needs.

              Bob

              Comment


              • #8
                YAHOOO!!!!!!

                Bob, I AM still working on this dynamic date issue and would love some guidance. If you a couple of examples and are willing to throw it my may... I thank you. If you require my my e-mail address it is [email protected].

                Thanks again,
                Kim

                Comment


                • #9
                  havmann,
                  Ok, this study is pretty basic, but I think it will address your needs. Basically, it will read and print the file you posted as an example. You can go into preMain() and increase the number of lines you want to return. The study should allow you to have any number of lines per day.

                  I commented it pretty well, so it should be self explanatory. Let me know if there are any problems.

                  Bob
                  Attached Files

                  Comment


                  • #10
                    I've done this before...

                    I ran into the same problem for another client.
                    Brad Matheny
                    eSignal Solution Provider since 2000

                    Comment


                    • #11
                      Dang - hit the wrong key...

                      OK, back to my assistance...

                      Here is what I did to determing the drawing/file load information.

                      first, we only need to check the file with each NEW DAY. so I used the following code to handle that...

                      // Global Variables
                      var BarCount = 0;
                      var nLastBarTime = 0;
                      var vlastDay = 0;
                      var dayStartBar = 0;

                      //---------------------------------------------------
                      // Get Time Variables
                      vTime = getValue("Time", 0);
                      vHour = vTime.getHours();
                      vMin = vTime.getMinutes();
                      vSec = vTime.getSeconds();
                      vDay = vTime.getDate();
                      vMonth = vTime.getMonth() +1;
                      vYear = vTime.getYear();
                      // end added BLM

                      if (lastrawtime != getValue("rawtime", 0)) {
                      BarCount += 1;
                      nLastBarTime = getValue("rawtime", 0);
                      }

                      Now, we need to check the current vlastDay compared to the once from our TIME variables.

                      if (vDay != vlastDay) {
                      // read from the file
                      // record the new BAR #
                      DayStartBar = BarCount;
                      // reset vlastDay counter
                      vlastDay = vDay;
                      }

                      Now, when you want to draw your support/resistance lines, the calculations for it are simple. The DAY START will always be...

                      (DayStartBar - BarCount)

                      so you would draw from (DayStartBar - BarCount) to 0 (or +# ??)

                      I hope this helps. This is how I would do it.

                      B
                      Brad Matheny
                      eSignal Solution Provider since 2000

                      Comment


                      • #12
                        thanks gents for your assitance... I am grinding through your code and doing my best to learn from it.

                        Thanks for your time & guidance,
                        Kim

                        Comment

                        Working...
                        X