Announcement

Collapse
No announcement yet.

Study of a diferent Symbol

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

  • Study of a diferent Symbol

    I am trying to refer in my code to the MA of diferent symbol, but I get syntax error.
    Can anybody tell me what I am doing wrong, or if this is possible?

    Here is code generated by the Wizard (I changed manually the name of the variable):

    //{{EFSWizard_Declarations

    var vEMA10_of_SMH = new MAStudy(10, 0, "Close(0,1,"SMH")", MAStudy.EXPONENTIAL);
    var vEMA10 = new MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL);
    var vLastAlert = -1;

    //}}EFSWizard_Declarations 20816

    And this is the message I get when I check the code:

    ... missing ) after argument list ....

    Thanks.
    Mihai Buta

  • #2


    discusses

    var v10EMA = new MAStudy(10, 0, "close", MAStudy.EXPONENTIAL);
    var v20of10 = new MAStudy(20, 0, v10EMA, MAStudy.MA, MAStudy.EXPONENTIAL);
    var v30of20 = new MAStudy(30, 0, v20of10, MAStudy.MA, MAStudy.EXPONENTIAL);

    Perhaps you could do

    var CloseSMH=close(0, 1, "smh");
    var CloseSMHma= new MAStudy(20, 0, CloseSMH, MAStudy.MA, MAStudy.EXPONENTIAL);

    Comment


    • #3
      Actually, there's no easy way of doing this right now (without building the MA manually). We are currently working on a BarData class which will allow you to pull in data from different symbols and multiple timeframes for use in the Study on Study constructs. Hopefully this will be available in v7.3.

      Comment


      • #4
        Thanks David, but it does not work.
        Declaring in the premain is not accepted.

        Using the below code I get no syntax error, but no plot either.
        Am I doing something worng?
        I just copied the same code I use for other Ma plots.
        Thanks.


        //{{EFSWizard_Declarations
        var vSMH;
        var vEMA10_of_SMH;
        var vLastAlert = -1;

        //}}EFSWizard_Declarations 10757


        function preMain() {

        //{{EFSWizard_PreMain
        setPriceStudy(true);
        setStudyTitle("SMH_MA");
        //}}EFSWizard_PreMain 5650

        }

        function main() {
        var nBarState = getBarState()
        if (nBarState == BARSTATE_ALLBARS) { // this will only occur once
        vSMH = close(0,1, "SMH");
        vEMA10_of_SMH = new MAStudy(10, 0, vSMH, MAStudy.SIMPLE);
        }


        //{{EFSWizard_Return
        if (vEMA10_of_SMH == null) {return;}
        return vEMA10_of_SMH;
        //}}EFSWizard_Return 2256

        }
        Last edited by mbuta; 02-08-2003, 09:14 PM.
        Mihai Buta

        Comment


        • #5
          dloomis, mbuta, the code as you have specified will not work. The study on study parameter only takes in another study object as its parameter, and can not work on retrieving values from other data series.

          As mentioned, Matt and I are currently working on a new BarData class which will be able to do what you need (as well as referencing data from different time periods, so you can build your 5min ADX in the 1min EFS that you were looking for in the other forum). We hope to have this ready by v7.3, but that depends on how fast other items on the TODO list get accomplished =).

          Thanks for your patience.

          Comment


          • #6
            Re: Reply to post 'Study of a diferent Symbol'

            This is great news... for the future.
            Please sign me up for Beta testing!

            Thanks.

            ----- Original Message -----
            From: <[email protected]>
            To: <[email protected]>
            Sent: Sunday, February 09, 2003 12:39 PM
            Subject: Reply to post 'Study of a diferent Symbol'


            > Hello mbuta,
            >
            > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            >
            Mihai Buta

            Comment


            • #7
              but that depends on how fast other items on the TODO list get accomplished =).
              I would hope as far as new features for efs goes, that this is one of the highest priorities, if not the highest. I understand this requires a lot of effort, but right now it is either VERY hard, complex and CPU extensive to code these type of indicators in EFS, or flat out impossible.

              I'm not saying that this is more important than bug fixes to the current features, but I can't think of a single new feature that is more important than this, as I can work around almost everything else.
              Garth

              Comment

              Working...
              X