Announcement

Collapse
No announcement yet.

Use of Studies not on FW Builtin Studies List

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

  • Use of Studies not on FW Builtin Studies List

    On the advanced chart list of Basic Studies, the study "Price Oscillator" is listed. In the Formula Wizard Builtin Studies, that study is not listed.

    What editing needs to be done to a FW formula in order to use studies that are not listed on the FW Builtin Studies list?

    Using the Price Oscillator study as an example; the PO formula is calculated FastMovingAverage - SlowMovingAverage. For any FW formula using both builtin studies and a non-builtin study (not on the FW Builtin list), what code needs to be added to a FW formula and where, to make it work?

  • #2
    Re: Reply to post 'Use of Studies not on FW Builtin Studies List'

    Lancer
    It is listed in FW under OscStudy
    Alex

    Comment


    • #3
      It's not the same thing. I checked it out already. Thanks though.

      Comment


      • #4
        Lancer
        Are you sure? Looks identical to me
        The black plot in the attached image was done using FW
        Alex
        Attached Files

        Comment


        • #5
          Attached is the efs done with FW
          Same default settings as in the Price Oscillator
          Alex
          Attached Files

          Comment


          • #6
            Alexis, my question was not focused on the Price Oscillator, but how non-FW studies can be used in an FW formula. I was using the Price Oscillator as an example of a non-FW study. Don't want to get too sidetracked here.

            For reference though, here's the difference between the Osc study and a Price Oscillator (Moving Average Oscillator) study:

            Formula Wizard OscStudy:
            var study = new OscStudy(5, 10, "Close", false);

            Price Oscillator (Moving Average Oscillator):
            var slowstudy = new MAStudy(10, 0, "Close", MAStudy.SIMPLE);
            var faststudy = new MAStudy(5, 0, "Close", MAStudy.SIMPLE);

            Then, PO = faststudy - slowstudy, with all variables of both moving averages configurable separately.

            On a daily chart, with all variables of OscStudy and PO formulas the same, the output might look the same. On a much shorter time-frame chart, with PO variables tweaked separately, the output is definitely different.

            In edit:
            Checked after hours: In Basic Studies, eSignal's version of a Price Oscillator does not present configuration options for both moving averages, so it is the same as the FW OscStudy. I was just going by the name on the list, thinking it was a proper Price Oscillator.

            From Technical Analysis from A to Z:
            "The Price Oscillator is almost identical to the MACD, except that the Price Oscillator can use any two user-specified moving averages."

            Someone needs to add this item to fix in 7.3; add configuration options for both moving averages in the Basic Studies Price Oscillator.

            Anyone have an answer to my initial question:

            What editing needs to be done to a FW formula in order to use studies that are not listed on the FW Builtin Studies list?

            Using the Price Oscillator study as an example; the PO formula is calculated FastMovingAverage - SlowMovingAverage. For any FW formula using both builtin studies and a non-builtin study (not on the FW Builtin list), what code needs to be added to a FW formula and where, to make it work?
            Last edited by Lancer; 02-12-2003, 01:29 PM.

            Comment


            • #7
              Anyone have an answer to my initial question:

              What editing needs to be done to a FW formula in order to use studies that are not listed on the FW Builtin Studies list?

              Here is what I do...

              Typically I will write part if not all of the efs in FW. Then I save it. Then I open up Tools, Editor and open the saved file.

              Now I can add or subtract from the FW to my hearts content - using the 'old way' - looking up the proper formats, editing, saving, reloading and debugging til I get what I want.

              Comment


              • #8
                Thanks David. Any idea on the second part of the question:

                "Using the Price Oscillator study as an example; the PO formula is calculated FastMovingAverage - SlowMovingAverage. For any FW formula using both builtin studies and a non-builtin study (not on the FW Builtin list), what code needs to be added to a FW formula and where, to make it work?"

                Here are the parts of the Price Oscillator:
                var slowstudy = new MAStudy(10, 0, "Close", MAStudy.SIMPLE);
                var faststudy = new MAStudy(5, 0, "Close", MAStudy.SIMPLE);

                and, say I want to identify "PO" as:
                var PO = faststudy - slowstudy

                and use "PO" in the FW Set1, Set2, etc. as a variable, for example:
                (Set1)
                (Non-builtin study) PO > 0; AND
                (Builtin study) Price > Moving Average 5

                What code needs to be added (var, etc.), and where (premain, main, etc.)?

                Can "PO" even be used as a variable in the "If these conditions are all true:" part of the FW configuration menu?

                Comment


                • #9
                  In this case to create PO>0 using the FW I would write something like this in the FW

                  PS I may have the < sign mixed up, but that's the idea
                  Attached Files

                  Comment


                  • #10
                    or sumpin like this

                    function main() {
                    /**
                    * The main() function is called once per bar on all previous bars, once per
                    * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
                    * in your preMain(), it is also called on every tick.
                    */

                    //{{EFSWizard_Expressions
                    //{{EFSWizard_Expression_1
                    var PO = vSMA10.getValue(MAStudy.MA)-vSMA5.getValue(MAStudy.MA);
                    if (
                    PO>0 &&
                    close() > vSMA5.getValue(MAStudy.MA)
                    ) onAction1();
                    //}}EFSWizard_Expression_1 16440

                    //}}EFSWizard_Expressions 30743


                    //{{EFSWizard_Return
                    return null;
                    //}}EFSWizard_Return 2256

                    }

                    Comment


                    • #11
                      From the replies, this is what I'm getting out of this so far:

                      1. The FW is not user-friendly when it comes to non-builtin studies.

                      2. Non-builtin studies/variables cannot be used in the FW formula configuration screen. For example, "custom" variables like "PO" can't be defined via manual edit of the formula, and then used in the FW formula configuration screen. (e.g. PO > 0)

                      3. David, I don't understand why you have the first line in the formula wizard image. (vSMA10 < vSMA5) How does that create the condition of PO > 0? How then is a PO < 0 condition created? Also, how is the condition of PO > or < relative to some other builtin study created in this way?

                      4. When manually editing a formula to use a non-builtin study, you don't have to do anyting in the initial declarations (var) section, nor in the premain section. The only edit is needed in the main section, within each FW expression where the non-builtin study is used. This is where the non-builtin study is defined (var PO =), and is inserted in the formula calculation (PO > 0).

                      5. It's highly unlikely that if I try to do this, it will work. lol

                      Let me know if any of this is incorrect.
                      Last edited by Lancer; 02-12-2003, 03:30 PM.

                      Comment


                      • #12
                        I'll tackle number 3 in case someone else was wondering what that was all about...

                        you defined PO as sma10 - sma5 or

                        PO=sma10-sma5

                        if you want PO to be gt 0 this implies

                        sma10-sma5 > 0 or by adding sma5 to both sides,

                        which doesnt change the comparasion - I think thats called the additive rule

                        sma10 > sma5 is functionally the same test without using the var PO;

                        the only thing I know is 5 ir true.

                        and 4, javascipt is a little trickier than this, but you will quickly realize when you dont use var in the right place, every thing is munged up right away.

                        Comment


                        • #13
                          Note for Dion

                          Dion
                          This is a practical example of what I was referring to in this thread and specifically in the last message of mine.
                          Alex

                          Comment


                          • #14
                            Just to clarify, PO = MA5(faststudy) - MA10(slowstudy).

                            I'll try your algebraic logic; maybe it will accomplish the workaround. That won't work with a lot of non-builtin studies though. I just used a simple PO for my non-builtin example because it was easy and used an existing builtin study for its calculation.

                            I hope future versions of Formula Wizard will make writing formulas with non-builtin studies a lot easier than this. For now though, it seems like I should be able to just manually edit the formula with the right code in the right place instead of thinking up algebraic workarounds.

                            Comment


                            • #15
                              alexis: yep, definitely a good candidate for giving people a chance to specify their own variables.

                              Lancer, you can also write the PO in a separate EFS (using the FW if you wish), then use a 2nd EFS to get values from the PO EFS using the call() function.

                              Comment

                              Working...
                              X