Announcement

Collapse
No announcement yet.

Study Values

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

  • Study Values

    I would like to write some program logic that compares the values of particular studies. How do I reference the values of a particular study that is on a chart?

    Do i have to put the study on programatically so I have an object reference to it ?

    Example:

    Say I pull up a new chart, and manually add Bollinger Bands and a Moving average to the chart. How do I then in an EFS script reference thos studies and extract thier data values???

    Thanks,
    Gavin Stevens

  • #2
    Gavin
    Yes you need to load the studies as efs to be able to refernce them
    Alex

    Comment


    • #3
      Programatic Studies

      Ok, that makes sense...

      If that is the case, will my script add the study and look at the values on every price change? Is a study completely recalculated on the whole chart everytime the EFS scipt is fired?

      In one of eSignal's samples:
      var study1 = new MAStudy(10, 0, "Close", MAStudy.Simple);

      function preMain() {
      setPriceStudy(true);
      }

      var BarCntr = 0;
      function main() {
      var vMA1 = study1.getValue(MAStudy.MA);

      }

      here they used getValue(MAStudy.MA)
      Is there a reference to the constants I can pass into the getValue function?

      Thanks
      Gavin

      Comment


      • #4
        Gavin

        If that is the case, will my script add the study and look at the values on every price change?

        Yes unless you instruct the efs to compute only at the close of a bar by using setComputeOnClose(); in the preMain section of the efs.

        Is a study completely recalculated on the whole chart everytime the EFS scipt is fired?

        If by fired you mean first loaded then yes it is run through all the data loaded in the chart.

        Alex

        Comment


        • #5
          Thanks for the reply

          My unanswered question...

          In one of eSignal's samples:
          var study1 = new MAStudy(10, 0, "Close", MAStudy.Simple);

          function preMain() {
          setPriceStudy(true);
          }

          var BarCntr = 0;
          function main() {
          var vMA1 = study1.getValue(MAStudy.MA);

          }

          here they used getValue(MAStudy.MA)

          Is there a reference to the constants I can pass into the getValue function? ie MAStudy.MA.... what are the contants for Bollingers, MACD's, etc....

          Comment


          • #6
            Gavin
            You can find all the relevant information regarding EFS functions in the EFS Help Center & Library under EFS Function reference.
            If you also want to have a local copy of the same you can find it here in both Windows Help or HTML formats
            Alex

            Comment


            • #7
              Must be in wrong section

              I have looked through that reference here is the info for getValue:

              There is no mention of using this for a study, and no mention of the MAStudy.MA value... is it in some other section and I'm just missing it....

              Dont mean to sound stupid...
              Thanks

              getValue( barType [, nOffset] [, nNumBars] [,Symbol] )

              Returns a data series value or values RELATIVE to the bar currently being built.

              barType: "Open", "High", "Low", "Close", "Time", "rawtime", "Volume", "oi", "year", "month", "day", "hour", "minute", "second"
              nOffset: Offset from the "relative" bar. The relative bar is maintained by the formula engine. It is the index of the bar currently being computed.
              nNumBars: Number of bars to return
              Symbol: The symbol for which to return data. Symbol may have an Interval suffix (e.g., "IBM,5")

              var vValue = getValue( "Open" ); //returns a the current bar's open value

              var vValue = getValue( "Open", 0, 1 ); //ditto

              var aValues = getValue( "Close", 0, -10 ) //fills array aValues with the 10 most recent closes.

              Comment


              • #8
                Gavin
                Look at +EFS Function Reference->Built-In Study Functions then click the link for Built-In Study Operations. It will list all the built-in studies and relative syntax
                Alex

                Comment

                Working...
                X