Announcement

Collapse
No announcement yet.

EFS different from Basic Study

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

  • EFS different from Basic Study

    Someone please explain why the EFS study of MA plots different from the Basic Study. IT seems to me that they should overlay.

    var sEMA = new MAStudy(13, 1, "HLC/3", MAStudy.EXPONENTIAL);
    main() {
    var nBasis = sEMA.getValue(MAStudy.MA);
    return nBasis;
    }
    Attached Files

  • #2
    Re: Reply to post 'EFS different from Basic Study'

    Is that

    function main()

    or just

    main()

    Should be function main(), right?

    Also, the Formula Wizard suggests

    var vEMA10 = new MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL);

    Probably that 1 in your formula is the issue.

    Comment


    • #3
      I want an offset of 1. The basic study accepts an offset of 1. These should plot the same.

      The Help file says:
      MAStudy(Length, Offset, PriceSource, [StudyType], MovingAverageType)

      Comment


      • #4
        Gavishti
        As far as I can see the plots of the efs and the Basic Studies match exactly. The only difference is that the Basic Study will plot also past the last bar whereas the efs will not.
        Alex

        Comment


        • #5
          This is how it plots on my machine. The green solid line is the Basic Study. The brown solid line is the EFS.
          Attached Files

          Comment


          • #6
            I found the problem. I copied code from an indicator with setStudyMax() and setStudyMin(). Droping those lines fixed the problem.

            Lesson learned: Don't included setStudyMax() and setStudyMin() with built-in functions. It may distort the results.

            Comment

            Working...
            X