Announcement

Collapse
No announcement yet.

question for Alex

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #91
    Larry
    As far as I know that cannot be done. You will have to break it into two separate drawTextRelative functions
    Alex

    Comment


    • #92
      Question

      I wrote a formula for over sold CCI after a MACD crosses zero (hist) to alarm only once after each cross. If I leave the chart open it only shows one event...if I reboot the program it shows all the events (which is what I want). So after a cross how do I get the program to reset for the next event??? MK

      Comment


      • #93
        Mark
        It could depend on how you set the conditions. You may want to post the efs so someone can take a look at it
        Alex

        Comment


        • #94
          Alex
          (1) File attached ( I hope)
          (2) Only this file is attached to all 21 stocks on a PAGE
          (3) When I load the page the numbers are wrong.
          (4) The program determines the number of days since
          the last touch of the Upper BB and Lower BB
          (5) Key = Then I reload each chart separately I get the
          RIGHT answer.
          Attached Files
          Larry Dudash
          HAL at
          http://share.esignal.com/groupconten...r=&groupid=549

          Comment


          • #95
            Larry
            I think the attached revision of the script does what you asked.
            As far as I have seen in my tests it works both on historical and in real time.
            Alex
            Attached Files

            Comment


            • #96
              Alex
              The attacked file worked fine.

              Question?
              (1) Were your modifications do to your understanding how
              the "study.getValue(BollingerStudy.UPPER" works ?
              (2) Or is it how Java Programming works in general ?
              (3) Or did you just try and guess a solution?
              Larry Dudash
              HAL at
              http://share.esignal.com/groupconten...r=&groupid=549

              Comment


              • #97
                Larry
                The revision has more to do with the construct than with specific syntax.
                The way the efs now works is the following. At the beginning of every new bar it checks if the prior high/low were higher/lower than the corresponding Upper/Lower BB. If they were it starts the count from 1. It will maintain this number (even if the current bar takes out the Upper/Lower BB) until it checks again at the open of the following bar and then repeats the process either starting the count again at 1 or adding to the count.
                Alex

                Comment


                • #98
                  Alex
                  (1) First I want to thank you for your help in learning this
                  new language. Have programmed since 1969, but every new
                  language has it's walls. And you have helped me get over those
                  walls.
                  (2) Now back to bb.efs
                  (3) I plotted LASTBBBOT and noted that the counting worked fine
                  until the last bar. Today I changed the margin from 5 to 3 and
                  sure enough the counting worked fine until it added 3 at the last
                  bar.
                  (4) Then I added "setComputeOnClose()"
                  (5) That fixed every thing.
                  (6) see new efs attached.

                  Again thanks for you help !
                  Attached Files
                  Larry Dudash
                  HAL at
                  http://share.esignal.com/groupconten...r=&groupid=549

                  Comment


                  • #99
                    21 charts with BB.EFS

                    Here are 21 charts with BB.EFS
                    This shows how looking at the days from last touch of BB Upper
                    and BB Lower lines, one can tell the direction of the market.IMHO.

                    Examples on how EFS files are used in actual looking at the market seem to be missing from these boards. IMHO.


                    http://www.geocities.com/larrydudash2005/index.html

                    PS: This file was too large to be included as an attachment.
                    Larry Dudash
                    HAL at
                    http://share.esignal.com/groupconten...r=&groupid=549

                    Comment


                    • Larry
                      Using setComputeOnClose() is essentially the same as using getBarState() ie it waits for a new bar to verify the conditions.
                      The main difference is that with setComputeOnClose the whole efs is computed on a new bar hence the BB in this case plots one bar behind (ie not in real time).
                      With getBarState() instead you can isolate the section(s) that you want computed on a new bar leaving everything else to function in real time.
                      With regards to the count, in your efs you will have the first bar after high/low above/below the BB bands numbered as 0 even if its high/low has not taken out the BB bands whereas with mine it will behave as explained in my prior message.
                      Alex

                      Comment


                      • Need last BarCntr

                        Alex
                        (1)Is there code that will give the "total bars" on the chart
                        at the beginning of MAIN?
                        (2)I would then use "If Statement" to do
                        y = mx+b only at the last bar

                        If(BarCntr = LastBar){
                        y1=m1*X1+b1;
                        etc;
                        }

                        Thanks again for your help in the past.
                        Larry Dudash
                        HAL at
                        http://share.esignal.com/groupconten...r=&groupid=549

                        Comment


                        • Larry
                          getNumBars() will return the number of bars loaded in a chart.
                          Alex

                          Comment


                          • Alex
                            Is there a way to place this VERY LONG LINE OF CODE on say two lines ?

                            example line of code
                            drawTextRelative(-2,low(-2),"lows="+countlows+" x2= "+x2+" y2= "+y2+" x1= "+x1+" y1= "+y1+" m1="+rnd4(m1)+" BarCntr= "+BarCntr+" diff="+x3,Color.black,Color.white,Text.FRAME|Text. TOP|Text.BOLD,null,9,BarCntr);

                            NOTE: the above copy used 5 lines, but is there a "continuation symbol " needed ???

                            Thanks
                            Larry Dudash
                            HAL at
                            http://share.esignal.com/groupconten...r=&groupid=549

                            Comment


                            • Larry
                              Just hit carriage return where you want to carry it over to the next line
                              Alex

                              Comment


                              • Stochastic Bands

                                Dear Alex,

                                I'm sure there is a simple way round this but I've been wrestling with it but can't seem to solve it...

                                I am trying to create a band along bottom of chart that signals the following: Lower Band shows blue when Stochastic (10,3,1) is moving UP and red when same stochastic is moving DOWN. On the band just above this I want similar thing but for a Stochastic(30,10,1)

                                The problem I am having is that I want it to do this in real time - not setComputeOnClose. But what happens is that when the bar changes, the color on each band is not always accurate and I have to reload, which defeats the purpose of the thing.

                                The other problem is that I need it to only look back 100 bars, because if it does longer than this it really slows my system down.

                                Any ideas? Thanks

                                Veda
                                Last edited by vedaball; 02-25-2004, 09:42 AM.

                                Comment

                                Working...
                                X