Announcement

Collapse
No announcement yet.

Dinapoli Detrended Oscillator (to plot 2)

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

  • Dinapoli Detrended Oscillator (to plot 2)

    I was hoping someone could modify the Dinapoli Detrended Oscillator to plot 2 lines. One 14-period and one 7-period. Also ideally change the plot from using just the "Close" value to using the "HLC/3" instead.

    Would be grateful if someone could help out with this as I have no idea how to start.


    Many thanks!

  • #2
    It comes with eSignal by default but I'll attach it here anyway.
    Attached Files

    Comment


    • #3
      Hi Anson,

      I'm sure there is a more effective way to do this, but I added a second DiNapoli EFS to my advanced chart window. By changing the values and colors of the indicator though the EDIT STUDIES feature, I was able to get the crossover effect. I didn't change the HLC/3 to calculate on the close. Once this is done, I simply used the SHIFT and drag method to overlay the studies. Again, there is probably a cleaner way to do this, but this may be a good starting point. Anyone with additional comments, please feel free to chime in.

      Comment


      • #4
        Hello Anson,

        The easiest way to accomplish this is to write a new formula and call \DiNapoli\Detrended Oscillator.efs with the call() function twice. Try the following.

        2DetrendOsc.efs

        PHP Code:
        function preMain() {
            
        setStudyTitle("2 DiNapoli Detrended Oscillators ");
            
        setCursorLabelName("D1"0);
            
        setCursorLabelName("D2"1);
            
        setDefaultBarFgColor(Color.blue0);
            
        setDefaultBarFgColor(Color.red1);
            
        addBand(0PS_SOLID1Color.black"zero");
        }

        var 
        bEdit true;

        function 
        main(Length1Length2) {
            if (
        Length1 == nullLength1 7;
            if (
        Length2 == nullLength2 14;
            
            if (
        bEdit == true) {
                
        setCursorLabelName("Detrend Osc " Length10);
                
        setCursorLabelName("Detrend Osc " Length21);
                
        bEdit false;
            }
            
            var 
        D1 call("/DiNapoli/Detrended Oscillator.efs"Length1);
            var 
        D2 call("/DiNapoli/Detrended Oscillator.efs"Length2);
            if (
        D1 == null || D2 == null) return;
            
            return new Array(
        D1D2);

        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


        • #5
          Originally posted by JasonK
          Hello Anson,

          The easiest way to accomplish this is to write a new formula and call \DiNapoli\Detrended Oscillator.efs with the call() function twice. Try the following.
          JasonK and DuaneG,

          Thanks alot for the help! That was a great solution, Jason.

          I actually like the Detrended Oscillators alot for several reasons but probably the main reason would be that they are not normalized like many other indicators and are sensitive. However, a quickly expanding number of people prefer the "HLC/3" plot over the "Close" plot these days.

          I don't mean to trouble you guys again but could I trouble you guys to modify the original script attached in first post and make it use "HLC/3" value instead of the "Close"? Maybe under a new efs name? I tried it but failed miserably. I'm a real efs failure.

          Then anyone who would like to plot the oscillators the same way can use these newly modified HLC/3 Detrended Oscillators and have the other script Jason has created, call them twice!

          Comment


          • #6
            Hello Anson,

            Here's the HLC/3 version, Detrended Oscillator2.efs. Save the formula above to \Formulas\DiNapoli\. To use this version with the 2DetrendOsc.efs, add the "2" to the file name in the call() functions.
            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


            • #7
              Many thanks, Jason!
              Just what I needed.

              Comment

              Working...
              X