Announcement

Collapse
No announcement yet.

non builtinstudies

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

  • non builtinstudies

    The manual to the formula wizard clearly states that you can use the output from one builtin study as the source of input to another builtin study. Can I use the output from a non builtin study as the source of input to a builtin study? If so, what is the syntax for assigning a variable name to a non builtin study and what would be the "dataseriesID" of the non builtin study?

    Any help will be greatly appreciated.

  • #2
    At this time you can't use the output from an EFS study as an input to a builtin.

    You can use the output of one EFS as input to another EFS though.

    G
    Garth

    Comment


    • #3
      Not the answer I wanted but thanks. Next question. Is it possible to return the output from a non-builtin study (i.e. my own custom weighted moving average/envelope) in an offset manner? If so, what is the syntax?

      Your help once again would be greatly appreciated.

      Comment


      • #4
        It is possible...but you have to do the work.

        Keep the values as an array and display the ones from the number of bars back you want. It would look something like this (no promises that this is exact, but should point the way):

        PHP Code:
        var myMA = new Array();

        main(){

        var 
        offset 5// 5 bar offset
        if (getCurrentBarIndex() - getOldestBarIndex() > 3) { // assume 3 bars in the WMA

           
        if (getBarState() == BARSTATE_NEWBAR){
               
        myMA.unshift(0); // Shift array and set first element to 0
               
        myMA.pop(); // Pop the oldest element of the array
           
        }

           
            
        MyMA[0] = (4*Close(0) + 3*Close(-1) + 2*Close(-2) + Close(-3))/10;

            return(
        MyMA[-offset]);

        Garth

        Comment

        Working...
        X