Announcement

Collapse
No announcement yet.

offset caused by function?

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

  • offset caused by function?

    If I use an SMA of an function-series, I get an offset. Is there another way as "offsetSeries(sma(14, series),-1);" in order to prevent this problem?

    PHP Code:
    function preMain()
    {
        
    setPriceStudy(false);
        
    setDefaultBarFgColor(Color.black,0);
        
    setDefaultBarFgColor(Color.red,1);
    }


     
    function 
    main()
    {
        
    series efsInternal("test");

        return new Array ( 
    sma(10sma(10)), sma(10series) );
    }


    function 
    test() {return sma(10);} 
    Attached Files
    Franz

  • #2
    Franz
    I am not sure as to what the problem you are describing is. I just ran your script and I don't see the plot being offset (see enclosed image).
    Alex

    Comment


    • #3
      Strangely!

      With EOD ("D") it works ok, but with intraday (e.g. 5 minutes)...
      Franz

      Comment


      • #4
        Franz
        Even using an intraday interval (I have tried several) it still does not plot any offset return
        In the enclosed image I am also using the same symbol as in your chart
        Alex

        Comment


        • #5
          Hi Alex,

          I found the problem.

          At Formula Engine Settings I have checked "Make all formulas compute on close (rather than tick-by-tick)".

          If I using setComputeOnClose() in preMain you should have the problem too!
          Last edited by franzmey; 01-08-2006, 06:40 AM.
          Franz

          Comment


          • #6
            Franz
            As far as I know setComputeOnClose() [as well as the global compute on close option you mention] is not compatible with either efsInternal() or efsExternal()
            Alex

            Comment

            Working...
            X