Announcement

Collapse
No announcement yet.

MACD Drop lines

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

  • MACD Drop lines

    Hello everybody

    In the basic MACD study there is an option to add drop lines, but you can not add extra horizontal lines above and below the zero line.

    I can create a new MACD study or edit one of the other studies to add lines above and below the zero line with the following lines added into the code

    addBand(0, PS_DASH, 3, Color.black);
    addBand(0.0015, PS_SOLID, 1, Color.black);
    addBand(0.0030, PS_SOLID, 1, Color.black);
    addBand(0.0045, PS_SOLID, 1, Color.black);
    addBand(-0.0015, PS_SOLID, 1, Color.black);
    addBand(-0.0030, PS_SOLID, 1, Color.black);
    addBand(-0.0045, PS_SOLID, 1, Color.black);

    My problem is that I do not know what command to add to get the Drop Lines to display in a new or edited study.

    Can somebody help me out please?

    Your help will be appreciated.

    Regards

  • #2
    Hello Kobus,

    The trick to creating drop lines is to return the series twice in the return statement. Set the plot type for the second instance in preMain() to PLOTTYPE_HISTOGRAM. The MACDColorHist.efs formula example from our library uses this method if you need a working code example.
    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


    • #3
      Jason

      Thank you very much.

      I tried to use the efs as is but it seems that it is set for Monthly intervals. I do not understand this since I do not see anthing in the efs that indicate that the interval is set to M

      I attach an image to illustrate.
      Attached Files

      Comment


      • #4
        Jason

        I solved the problem: In lines 177 - 183 I changed the
        toFixed(2)*1;
        to
        toFixed(4)*1;

        Now it is displaying correctly.

        Thank you again.

        Regards

        Comment


        • #5
          You're most welcome.
          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

          Working...
          X