Announcement

Collapse
No announcement yet.

Pivots - outputting their values to another study?

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

  • Pivots - outputting their values to another study?

    Hi, is it possible to output the values of a pivot point study to another study which can then pick up their values and use them as a variable to use in its own rules?

    If so, can anyone share some example code for how it works?

    Thanks

  • #2
    yes, it is possible. The easiest solution is to add globalvalues for the pivot data.

    For example:

    Lets assume you have 6 pivot levels. You would need to create an array with an object of data, then post that to the global memory.

    PHP Code:

      
    var PivotArray = new Array();
       var 
    PVObj = new Object;
       
    PVObj.PV1 PivotValue1;
       
    PVObj.PV2 PivotValue2;
       
    PVObj.PV3 PivotValue3;
       
    PVObj.PV4 PivotValue4;
       
    PVObj.PV5 PivotValue5;
       
    PVObj.PV6 PivotValue6;
       
    PivotArray.push(PVObj):

       
    setGlobalValue(getSymbol()+"PIVOTGLOBAL"PivotArray); 
    You only need to call this code when new pivot data is calculated in your pivot efs. If you continue to make calls to this function(every tick) , it may slow down esignal.

    Now, in your graphics EFS (another efs that draws your pivot levels or where you can create your own system logic for trading, you would simply GET the global value and plot it.

    PHP Code:

    function main() {
      var 
    PVArray null;
       
    PVArray getGlobalValue(getSymbol()+"PIVOTGLOBAL");
       if (
    PVArray.PV1 != null) {
         
    //  retrived global value data and assumed valid, now draw or do whatever.

     /*  Available pivot data is.
        PVArray.PV1
        PVArray.PV2
        PVArray.PV3
        PVArray.PV4
        PVArray.PV5
        PVArray.PV6
    */
       
    }


    Hope this helps?
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment

    Working...
    X