Announcement

Collapse
No announcement yet.

Different type of oscillator

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

  • Different type of oscillator

    Can anyone write an EFS for to have one of the variables being an exponential moving average and one being a simple moving average.

  • #2
    ryanlangdon
    You can easily do that using basicMAx2.efs which is available here
    Set the study to plot as an indicator rather than in the price window and change the return statment to compute the subtraction between the two averages ie. in place of return new Array(vMA1..., vMA2...) you would write return (vMA1... - vMA2...)
    The resulting plot will be an oscillator. At that point set the parameters of the averages to whatever you need.
    Alex

    Comment


    • #3
      thanks alex
      Last edited by ryanlangdon; 03-23-2005, 09:19 PM.

      Comment


      • #4
        nevermind alex, I got it thanks. is it easy to plot the data as a histogram?

        Comment


        • #5
          ryanlangdon
          In preMain replace the existing plot type with PLOTTYPE_HISTOGRAM
          Alex

          Comment


          • #6
            thanks, Alex

            Comment


            • #7
              alex, do you have any code to backtest this study?

              Comment


              • #8
                ryanlangdon
                Not off hand. Run a search for average* AND alert* and you should find some efs(s) written using the same basicMAx2 that will trigger alerts and may even generate strategy signals.
                Regardless you should be able to easily create a strategy with the Formula Wizard based on the crossovers of two moving averages
                Alex

                Comment

                Working...
                X