Announcement

Collapse
No announcement yet.

Multiple Time Frames on 1 Chart

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

  • #16
    Alexis:

    I tested this and you're correct

    PHP Code:

    tStochK 
    stochK(14,1,3sym(iSymbol), inv(iInterval)  ) ;
    tStochD stochD(14,1,3sym(iSymbol), inv(iInterval)  ) ; 
    Does NOT return the correct values!

    The editor does not return a syntax error!

    So there must be a bug!!

    If this syntax is not proper then either the syntax checker should catch it or it should cause an error upon execution.

    I guess this is just another "GOTCHA" then I have discovered.

    I appreciate you informing me of this.

    Thanks!!

    Comment


    • #17
      Hello Avery,

      Originally posted by buzzhorton
      Alexis:

      I tested this and you're correct

      PHP Code:

      tStochK 
      stochK(14,1,3sym(iSymbol), inv(iInterval)  ) ;
      tStochD stochD(14,1,3sym(iSymbol), inv(iInterval)  ) ; 
      Does NOT return the correct values!

      The editor does not return a syntax error!

      So there must be a bug!!

      If this syntax is not proper then either the syntax checker should catch it or it should cause an error upon execution.

      I guess this is just another "GOTCHA" then I have discovered.

      I appreciate you informing me of this.

      Thanks!!
      Actually, it's not a bug. The stochK() built-in accepts up to 5 parameters. The 5th one is the bar index to retrieve a value for. Passing a function to get a bar index would be acceptable syntax, which is why the syntax checker does not report a syntax error message when passing in inv(). We would need to modify all built-in study functions and add some additional error checking logic to produce a custom runtime error message. I will send a suggestion to our developers, but you may do so also if you like ([email protected]).
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #18
        JasonK:

        That's for the reply.

        I can see the reason why you say it is not a bug.

        But, once again, this is where coding is NOT intuitive.

        The parse rountine should look for and process inv(), or sym() or both!

        sym( symbol, interval ) is handy, however, if you are writing a statement builder ( like I have been working on in my TRO studies) then you need a way to build statements for one, the other or both, if you want to make it user friendly.

        I have figured out the internal functions via eval. Thanks again.

        I still need some help with efsInternal and efsExternal. And of course SERIES.

        THANKING YOU IN ADVANCE.

        Comment


        • #19
          It Works

          I made these minor changes to code: use AB #F, used 6,6,2 and StochD only, and then loaded this on a 1-min chart. I had StochD 6,6,2 running on a 10 min chart and then compared the 2 charts. I did get the same results, even going back in time
          PHP Code:
          function preMain() {

              
          setPriceStudy(false);
              
          setStudyTitle("TRO_TEST"); 

              
          setDefaultBarFgColor(Color.red,0);
              
          setDefaultBarFgColor(Color.blue,1);

              
          setDefaultBarThickness(2,0); 
              
          setDefaultBarThickness(2,1);    
              
              var 
          iSymbol = new FunctionParameter("iSymbol"FunctionParameter.STRING);
              
          iSymbol.setDefault"AB #F" ); 


              var 
          iInterval = new FunctionParameter("iInterval"FunctionParameter.NUMBER);
              
          iInterval.setDefault10 ); 

              
          askForInput();
          }
            

          function 
          main(iSymboliInterval ){

          //    return new Array ( stochK(6,6,2,sym(iSymbol+","+iInterval)), stochD(6,6,2,sym(iSymbol+","+iInterval)) );

              
          return ( stochD(6,6,2,sym(iSymbol+","+iInterval)) );


          This is exactly what I was after. I can now use the 10 min value in my 1 min EFS to further refine signal generation in 1 min charts.

          Comment

          Working...
          X