Announcement

Collapse
No announcement yet.

What is Wrong?

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

  • What is Wrong?

    Why does the 2nd line below work in my efs but the first does not? ( I rem it out)

    // EMAValue = ema(2,o(sym(CHARTiSymbol + "," + iIntervalEMA)));
    EMAValue = ema(2,ohlc4(sym(CHARTiSymbol + "," + iIntervalEMA)));

  • #2
    alexmihh
    It is not working because o() is not a valid source
    Alex

    Comment


    • #3
      Strange-- Well, how can I make this to be based on "open"?

      Every chart has "open" as a source, so why would it not work in efs? This is not logical. Even if the "open" source is designated a different way, this too is not obvious since all I did was remove the "hlc4" portion.
      Last edited by alexmihh; 02-15-2007, 12:07 PM.

      Comment


      • #4
        alexmihh
        See this article in the EFS KnowledgeBase for the syntax
        Alex

        Comment


        • #5
          Is that article clear? I mean, if I wanted to find out the syntax for source ohlc/4 of

          EMAValue = ema(2,ohlc4(sym(CHARTiSymbol + "," + iIntervalEMA)));

          how could I get that from the article you suggested?

          All I am saying is a very simple thing. if "ema(2,ohlc4(..." works in efs, one would expect "ema(2,o(..." to work for "open."

          Even after reading the article I still don't know how to get "open" as a source in the efs expression that works so nicely for ohlc/4. Can you give it to me?

          Just so you know, this is an efs that is attached to a chart to grab values from a different chart and even a different time interval. So the data coming into the chart is not the data I am using in the efs
          Last edited by alexmihh; 02-16-2007, 06:57 AM.

          Comment


          • #6
            alexmihh
            As I indicated in a previous reply o() is not a valid function. If you want to base your expression on the Open then replace ohlc4(...) with open(...)
            Alex

            Comment


            • #7
              OK, I get it now. (got a question below)

              This is confusing though because in other places of efs you suppose to use "O" etc.

              Here is some code I used in other efs and has been engrained in me

              // nPriceSource = "O"; // nPriceSource == "C" || nPriceSource == "O" || nPriceSource == "H" || nPriceSource == "L")
              // nType = "MAStudy.EXPONENTIAL"; // nType == "MAStudy.EXPONENTIAL" || nType == "MAStudy.SIMPLE" || nType == "MAStudy.WEIGHTED" || nType == "MAStudy.VOLUMEWEIGHTED"
              // EMAstudy = new MAStudy(16, 0, nPriceSource, eval(nType));
              //
              // vMainEMA = EMAstudy.getValue(MAStudy.MA);

              Now I am trying something new. Instead of grabbing the EMA value, I want to grab the open of the previous bar (of a symbol and time interval NOT of the current chart)

              I am trying this but getting nowhere

              vOPENPREVBAR = open(2,(sym(CHARTiSymbol + "," + iIntervalEMA)));

              I know this is not the previous bar open either, but just this is getting me NULL

              How would I get this for the previous open/close?
              Last edited by alexmihh; 02-16-2007, 09:45 AM.

              Comment


              • #8
                I figured it out

                vOPENPREVBAR = open(2,(sym(CHARTiSymbol + "," + iIntervalEMA)));

                did not make sense -- looking 2 bars into to future

                vOPENPREVBAR = open(-1,(sym(CHARTiSymbol + "," + iIntervalEMA)));

                is correct

                Comment


                • #9
                  alexmihh

                  This is confusing though because in other places of efs you suppose to use "O" etc.

                  Here is some code I used in other efs and has been engrained in me

                  // nPriceSource = "O"; // nPriceSource == "C" || nPriceSource == "O" || nPriceSource == "H" || nPriceSource == "L")
                  // nType = "MAStudy.EXPONENTIAL"; // nType == "MAStudy.EXPONENTIAL" || nType == "MAStudy.SIMPLE" || nType == "MAStudy.WEIGHTED" || nType == "MAStudy.VOLUMEWEIGHTED"
                  // EMAstudy = new MAStudy(16, 0, nPriceSource, eval(nType));
                  //
                  // vMainEMA = EMAstudy.getValue(MAStudy.MA);
                  The price sources you are referring to ie "O", "C", etc are not series functions [such as open(), high(), close(), ohlc4(), etc] which are required by the efs2 functions like ema() but strings for use with the older (but still available) efs1 functions.
                  One way to differentiate an efs1 built-in study function from its efs2 equivalent is to look for the new keyword eg
                  // EMAstudy = new MAStudy(16, 0, nPriceSource, eval(nType));
                  Hope this helps
                  Alex

                  Comment

                  Working...
                  X