Announcement

Collapse
No announcement yet.

Daily Pivot Alert

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

  • Daily Pivot Alert

    Is there any way I can be alerted as to when a stock crosses up thru or down thru its daily pivot line? I use a 5 min. chart with the pivot line drawn on it. I follow about 100 stocks and would like to be alerted when the price crosses the daily pivot liner.
    Thanks.

  • #2
    This should do the trick:

    PHP Code:

    /******************************************************************************************
    Copyright © eSignal, a division of Interactive Data Corporation. 2005. All rights reserved.
    This sample eSignal Formula Script (EFS) may be modified and saved under a new filename;   
    however, eSignal is no longer responsible for the functionality once modified.             
    eSignal reserves the right to modify and overwrite this EFS file with each new release.    
    @version 3.0 by Alexis Montenegro for eSignal                                              
    *******************************************************************************************/

    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Pivot Points");
        
    setCursorLabelName("PP-R2"0);
        
    setCursorLabelName("PP-R1"1);
        
    setCursorLabelName("PP"2);
        
    setCursorLabelName("PP-S1"3);
        
    setCursorLabelName("PP-S2"4);
        
    // R2
        
    setDefaultBarStyle(PS_DASH0);
        
    setDefaultBarFgColor(Color.RGB(255,0,0), 0);
        
    setDefaultBarThickness(20);
        
    // R1
        
    setDefaultBarStyle(PS_DOT1);
        
    setDefaultBarFgColor(Color.RGB(0,0,255), 1);
        
    setDefaultBarThickness(11);   
        
    // Pivot  Point
        
    setDefaultBarStyle(PS_SOLID2);
        
    setDefaultBarFgColor(Color.RGB(0,0,0), 2);
        
    setDefaultBarThickness(12);
        
    // S1
        
    setDefaultBarStyle(PS_DOT3);
        
    setDefaultBarFgColor(Color.RGB(0,0,255), 3);
        
    setDefaultBarThickness(13);
        
    // S2
        
    setDefaultBarStyle(PS_DASH4);
        
    setDefaultBarFgColor(Color.RGB(255,0,0), 4);
        
    setDefaultBarThickness(24);
    }

    var 
    bInit false;
    var 
    xHigh  null;
    var 
    xLow   null;
    var 
    xClose null
    var 
    vPP null;
    var 
    vR1 null;
    var 
    vS1 null;
    var 
    vR2 null;
    var 
    vS2 null;  

    function 
    main() {

        if(
    isMonthly() || isWeekly())
        return;
        
        if(
    bInit == false){
            
    xHigh  high(inv("D"));
            
    xLow   low(inv("D"));
            
    xClose close(inv("D")); 
            
    bInit true;
        }
        
        var 
    vHigh  xHigh.getValue(-1);
        var 
    vLow   xLow.getValue(-1);
        var 
    vClose xClose.getValue(-1); 
        if(
    vHigh == null || vLow == null || vClose == null)
        return;
        
        
    vPP = (vHigh+vLow+vClose)/3;
        
    vR1 2*vPP-vLow;
        
    vS1 2*vPP-vHigh;
        
    vR2 = (vPP-vS1)+vR1;
        
    vS2 vPP-(vR1-vS1);  
        

    xPP formatPriceNumbervPP ) *1   ;

    if( 
    xPP == close(0) ) {
            
    Alert.addToList(getSymbol(), xPP +" PP"Color.blackColor.magenta);
            
    Alert.playSound("chime.wav");
            }

    xR1 formatPriceNumbervR1 ) *1   ;

    if( 
    xR1 == close(0) ) {
            
    Alert.addToList(getSymbol(), xR1 +" R1"Color.blackColor.magenta);
            
    Alert.playSound("chime.wav");
            }

    xR2 formatPriceNumbervR2 ) *1   ;

    if( 
    xR2 == close(0) ) {
            
    Alert.addToList(getSymbol(), xR2 +" R2"Color.blackColor.magenta);
            
    Alert.playSound("chime.wav");
            }

    xS1 formatPriceNumbervS1 ) *1   ;

    if( 
    xS1 == close(0) ) {
            
    Alert.addToList(getSymbol(), xS1 +" S1"Color.blackColor.magenta);
            
    Alert.playSound("chime.wav");
            }

    xS2 formatPriceNumbervS2 ) *1   ;

    if( 
    xS2 == close(0) ) {
            
    Alert.addToList(getSymbol(), xS2 +" S2"Color.blackColor.magenta);
            
    Alert.playSound("chime.wav");
            }

        return new Array(
    vR2vR1vPPvS1vS2);

    MAY ALL YOUR FILLS BE COMPLETE.
    Last edited by buzzhorton; 07-23-2006, 01:10 PM.

    Comment


    • #3
      sorry to bother you again, but can you tell me how to convert the php code into efs format?
      i called the help desk at esignal and they do not help with this issue.

      Comment


      • #4
        dunveganroad
        Just copy the code that is contained inside the PHP box and paste it in the Formula Editor window (to open the Formula Editor window select Tools-> EFS-> Editor... from the main menu of eSignal). Then save the script in Formulas (or one of its subfolders) assigning it a name of your choice
        Alex

        Comment


        • #5
          The code inside the PHP box is efs code, simply copy it into the efs editor and save it. Then add it to the chart.

          Comment


          • #6
            Thanks, folks.

            Comment

            Working...
            X