Announcement

Collapse
No announcement yet.

Floating Vertical Line

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

  • #16
    Hello Steve,

    Just take one element at a time used in the if statement and pass it to the the debugPrintln() function like below. You could also build a string and do them all at once if you want.

    debugPrintln(retArray1[3]);

    or

    debugPrintln(retArray1[3] + " " + retArray1[2]);

    This should be before the if statement. If you put this inside the if statement, it will not get called in the same manner that your alerts aren't getting called. You could put it after the end of the if statement, but it's a good habit to put it before to ensure that it comes first in the order of process.

    One other thing I like to do with debugPrintln() is to add the current bar index so when I'm looking at the results in the formula output window I'll know what results are occurring on each bar. That sometimes help points out the problems.

    debugPrintln(getCurrentBarIndex() + " " + retArray1[3]);
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #17
      HA-Alerts

      Jason, I used debug as you suggested and as the chart shows I'm now getting alerts. Now I need to tweak the alert conditions as I've coded the conditions incorrectly. My current code calls for a high alert if the prior candle's close is <= it's open, and the current close is >= it's open, and vice versa for a low alert. That's the only way I know to establish a red or green candlestick.
      I want to change this so that for a high alert the prior candle is red and the current is green REGARDLESS of where the prior one opened/closed. Vice versa for a low alert. How can I code this?

      Examp: on the attached chart plz see my vertical yellow lines: at 8:06 the prior candle was green but it's close was lower than it's open so no low alert as shown on the triggered list (would have liked an alert here). At 8:11 I got a low alert because the prior candle was green and it closed higher. And of course the opposite is true: if a prior red candle closes higher than it's open and the next candle is green, no alert.

      Thanks again for all your help.

      Steve
      Attached Files

      Comment


      • #18
        Hello Steve,

        In this formula, the retArray and retArray1 store the HA open, high, low and close for the current bar and prior bar, respectively. A HA bar will be green when the HA close is greater than the open. It will be red if the close is less than open. If the close is equal to the open, it will be black. These are the only conditions that determines the bar's color.

        [u]Current Bar HA OHLC[u]
        retArray[0] = high
        retArray[1] = low
        retArray[2] = open
        retArray[3] = close

        [u]Prior Bar HA OHLC[u]
        retArray1[0] = high
        retArray1[1] = low
        retArray1[2] = open
        retArray1[3] = close

        I want to change this so that for a high alert the prior candle is red and the current is green REGARDLESS of where the prior one opened/closed.
        This appears to be a conflict in logic to me. If the prior bar must be red, then it's close must be below it's open. In this case it matters where the prior bar opened and closed. If the prior bar has to be red and the current green, then the condition would look like this,

        PHP Code:
        if ( (retArray1[3] < retArray1[2]) && (retArray[3] > retArray[2]) ) {
           
        // alert


        Note that this does not cover the scenario where a close value is equal to it's open. I think that might be the case on your 8:06 bar where you were expecting an alert. The condition evaluates to false in this case. If you want the condition to accept this scenario then change the test for the prior bar to be <= (less than or equal to).


        PHP Code:
        if ( (retArray1[3] <= retArray1[2]) && (retArray[3] > retArray[2]) ) {
           
        // alert

        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #19
          HA ALERTS

          Jason, thanks for clarifying the only conditions which create a red or green candle and this makes sense to me. Several questions:

          *Is this code reading the HA candles or the chart bars?
          *What makes a bar/candle green/red if open is same as close? *Why are many alerts completely missed or showing opposite? (see attached).
          *Why do I sometimes get audible alerts but no symbol in triggered list?


          Examp: EBAY 6:53:05 alerted red, should be green. 6:55:31 alerted green, should be red. Also, during this period many others should have triggered either red or green but no alerts at all.

          I really like using HA as a trading tool especially when I can catch it at the color change. The alerts are important because it allows me to monitor several stocks. So I intend to use it a great deal and I appreciate any suggestions you can make.

          Steve
          Attached Files

          Comment


          • #20
            Hello Steve,

            Please post the current version of your formula and I'll try to answer your questions.
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment


            • #21
              HA ALERT PROBLEMS

              Jason, here's the formula I'm using. Plz disregard the question about a bar's green/red color if it's close is same as open since you've already answered that for me. All other questions are still in play. What I'm trying to accomplish is to get alerts whenever there's a change in the HA candle color which is not happening now (see chart from last thread).

              I realize you've got tons of questions and issues to deal with every day so I really appreciate the help and patience you've extended to me.

              Thanks again,

              Steve
              Attached Files

              Comment


              • #22
                HA SNAPSHOT

                Jason, here's a current example of what's happening. Plz see the triggered alert list and my vertical yellow marks on the candles. The red alerts at 6:56:06 & 6:55:22 are wrong because the prior candles to each of those was not green. However, at 6:56:32 there's a correct green alert because the prior candle was red. Hope this helps.

                Steve
                Attached Files

                Comment


                • #23
                  HA Status??

                  Jason, will you be able to help me with this study? Plz let me know if you received my threads since your request for info on 1/21. Thanks.

                  Steve

                  Comment


                  • #24
                    Hello Steve,

                    *Is this code reading the HA candles or the chart bars?
                    The High and Low Alert conditions that you have added are reading the HA candles.

                    *Why are many alerts completely missed or showing opposite?
                    *Why do I sometimes get audible alerts but no symbol in triggered list?
                    There were some logic errors in the formula. I've changed the logic to store the color values for the most current 3 HA bars and use those to test your conditions instead of the arrays. The reason I'm storing 3 is because at NEWBAR you need to look at the -1 and -2 bars to test your alert conditions. Because of the way you're using the vFlag variables, the formula would alert you the first time the condition was true during the bar, but the condition may have been false again by the time the bar closed. This was allowing the formula to give false signals. Try the attached and see if this works better for you.
                    Attached Files
                    Jason K.
                    Project Manager
                    eSignal - an Interactive Data company

                    EFS KnowledgeBase
                    JavaScript for EFS Video Series
                    EFS Beginner Tutorial Series
                    EFS Glossary
                    Custom EFS Development Policy

                    New User Orientation

                    Comment


                    • #25
                      HA Alerts

                      Jason, you did it again as your revised code works great! I ran about a dozen stocks on separate charts all day and here's the results: I don't think it missed any high/low alerts, and the triggered alert list showed almost the exact same time as the chart's cursor window! That's amazing considering I use 15second intervals. Thank you so much for hangin in there as this formula is very important to me.

                      About chart stability: since I began using the HA study I've noticed chart "****ing" when I try a vertical/horizontal mouse drag. I'm using 5 other studies which did not cause this prior to adding HA. Perhaps it's code is so extensive that when combined with the other studies my computer is maxed out. I run dual monitors with a 256mb video card (128 for ea monitor), AMD Athlon 2800 (2.8ghz), 1gb RAM, and HD has 50gb of free space. My internet connection is hi-speed wireless at 2mbit/sec.

                      I'd like to remedy this if possible. Could you plz give me some ideas on this or if this isn't your area could you refer me to someone else at eSignal.

                      Thanks again for all your help.

                      Steve

                      Comment


                      • #26
                        Hello Steve,

                        Good to hear the new version is working out for you.

                        The delayed response when dragging the chart around is caused by the collection of drawn images created by the study. This is a known problem with EFS drawn objects and development is aware of it. One solution is to recycle a collection of tag names to reduce the total number of objects in the chart. You'll notice towards the top of your formula a global counter (iCntr) that gets reset to 0 once it exceeds 200. This 200 is the max limit for the collection. You can reduce that number and see some improvement to the chart performance when you drag it around. The downside is that you lose some of the visual history in the study.
                        Jason K.
                        Project Manager
                        eSignal - an Interactive Data company

                        EFS KnowledgeBase
                        JavaScript for EFS Video Series
                        EFS Beginner Tutorial Series
                        EFS Glossary
                        Custom EFS Development Policy

                        New User Orientation

                        Comment


                        • #27
                          CHART ****ING

                          Jason, I lowered the iCntr but no change so leaving it at 200. What about formula engine settings for Heap/Stack size, would that have any effect?

                          Thanks,

                          Steve

                          Comment


                          • #28
                            Hello Steve,

                            I'm not an expert on optimizing Heap and Stack, but I would think this wouldn't have an affect. If you are receiving stack space or out of memory errors then the Heap and Stack settings might come into play.

                            What number did you reduce the limit to? What happens if you lower the limit for iCntr to something like 20? Do you see any improvement with lower numbers?
                            Jason K.
                            Project Manager
                            eSignal - an Interactive Data company

                            EFS KnowledgeBase
                            JavaScript for EFS Video Series
                            EFS Beginner Tutorial Series
                            EFS Glossary
                            Custom EFS Development Policy

                            New User Orientation

                            Comment


                            • #29
                              Jason, great suggestion! I ended up using iCntr 40 which gives me enough history yet smooths out the chart dragging. Thank you so much. You da man.

                              Steve

                              Comment


                              • #30
                                INTRADAY HIGH LOWS

                                Hi Jason, I'm using the enclosed study which plots new intraday high/lows with horizontal lines. Is it possible to show the number of times a high/low has been hit that day? For examp, let's say I'm looking at a horizontal line representing a new daily high and it's the third new high that day. Could there be a number "3" placed near the line or in the right margin identifying this? If possible to code this I would need the "counts" to accumulate separately for the highs and lows.

                                FYI, the heikinashi study you customized for me works absolutely great! Thanks again for all your help.

                                Steve
                                Attached Files

                                Comment

                                Working...
                                X