Announcement

Collapse
No announcement yet.

Chart/EFS Tweak

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

  • Chart/EFS Tweak

    Hi all,

    I have had the attached efs tweaked almost to perfection by numerous helpers on this site. I wonder if I could ask someone to assist me further and tweak the efs to show me when the indicator is descending in red and ascending in blue. At the moment its always shown in blue, whether its going up or down.

    I have attached an image (see circled area) to illustrate what I mean. I will submit the efs after.

    Thanks again for all your help.

    Cheers

    Carlton
    Attached Files

  • #2
    Hi again,

    As I mentioned, here is the efs.

    Cheers

    Carlton
    Attached Files

    Comment


    • #3
      ;

      Comment


      • #4
        Pls ignore the last post...

        You need to save DMI from bar to bar at the top of the main() section

        if(getBarState()==BARSTATE_NEWBAR)
        DMIold=DMI

        Then the other lines

        if(DMI<DMIold)setBarFgColor(Color.red, 0);
        if(DMI>DMIold)setBarFgColor(Color.green, 0);

        can be used just before the final return.

        Hope this helps.

        Comment


        • #5
          Hi David,

          Thanks for helping me out mate. I included the code as suggested, however its sometimes show red when ascending and green when descending(see attached image). Have I done something wrong?

          Cheers

          Carlton
          Attached Files

          Comment


          • #6
            Carlton,

            It may be a good idea to include the updated code in your post so that others can see how the amendment was implemented. Raw code is usually much easier to evaluate than the output from the Advanced Chart window.

            Comment


            • #7
              Duane,

              Good point.

              Cheers
              Attached Files

              Comment


              • #8
                Hi dloomis,

                Just so you know I would ideally like indicator to show up in red when descending and blue when ascending, at the moment it shows up as blue whether ascending or descending (as shown in the attached image). Basically, if it could appear exactly as the price bars show red and green, at the the edge of the chart when descending and ascending.

                However, the way you did it is still good, though.

                Cheers

                Carlton

                Comment


                • #9
                  David,

                  I thought I figured it out by changing a piece of the code from

                  if(getBarState()==BARSTATE_NEWBAR)

                  to


                  if(getBarState()==BARSTATE_CURRENTBAR)

                  However, I now get the following syntax error message:

                  'DMIold is not defined'. Any suggestions?

                  Cheers

                  Carlton

                  Comment


                  • #10
                    Hi,

                    I fixed the syntax error but the efs still is behaving I would ideally like....

                    Carlton

                    Comment


                    • #11
                      Hi,

                      I now understand the piece of code which states:

                      if(getBarState()==BARSTATE_NEWBAR)

                      However, i would like to see the results during the course of the day and not when the bar has closed.

                      I saw something like:

                      setPlotType(PLOTTYPE_INSTANTCOLORLINE,4)

                      But I'm not sure if this will work.

                      Any help greatly appreciated.

                      Cheers

                      Carlton

                      Comment


                      • #12
                        Looks to me like it is working in realtime, not sure why its not for you ?

                        Fibbgann
                        Excellent book on JavaScript for beginners

                        Comment


                        • #13
                          Hi Fibbgann,

                          This was taken in real-time for HET (please see image) Notice how the line bar is green even though its descending.

                          Cheers

                          Carlton
                          Attached Files

                          Comment


                          • #14
                            Dave,

                            Its working fine. I wasn't really paying attention - just been a little tired lately.

                            Cheers mate.

                            Carlton

                            Thanks Fibbgann, Duane for your input

                            Comment


                            • #15
                              Hi guys,

                              Just one more favour on this efs. I have added the following code to also alert me when the indicator turns red:

                              if(DMI<DMIold)setBarFgColor(Color.red, 0);
                              Alert.playSound("Autoplay.wav");Alert.addToList(ge tSymbol),"Demand Index

                              However, its continually alerting me upon every change in price as well.

                              Can you help?

                              Cheers

                              Carlton

                              I have attached the amended efs.
                              Attached Files

                              Comment

                              Working...
                              X