Announcement

Collapse
No announcement yet.

Renko Alerts

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

  • Renko Alerts

    Hello,

    I am trying to get an Alert Event when a Renko box Changes Direction/Color

    Below is my EFS but it is not working can someone point me in the right direction?

    PHP Code:
    //{{EFSWizard_Description
    //
    //    This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description 7532


    //{{EFSWizard_Declarations

    var vLastAlert = -1;

    //}}EFSWizard_Declarations 2482


    function preMain() {
       
    /**
        *  This function is called only once, before any of the bars are loaded.
        *  Place any study or EFS configuration commands here.
        */
    //{{EFSWizard_PreMain
        
    setPriceStudy(true);
        
    setStudyTitle("Renko Alerts");
    //}}EFSWizard_PreMain 7269

    }

    function 
    main() {
       
    /**
        *  The main() function is called once per bar on all previous bars, once per
        *  each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
        *  in your preMain(), it is also called on every tick.
        */

    //{{EFSWizard_Expressions
        //{{EFSWizard_Expression_1
            
    if (
                
    close() > close(1) &&
                
    close(1) < close(2)
            ) 
    onAction1()
        
    //}}EFSWizard_Expression_1 9837
        
        //{{EFSWizard_Expression_2
            
    else if (
                
    close() < close(1) &&
                
    close(1) > close(2)
            ) 
    onAction2();
        
    //}}EFSWizard_Expression_2 12820
        
    //}}EFSWizard_Expressions 44040


    //{{EFSWizard_Return
        
    return null;
    //}}EFSWizard_Return 2256

    }

    function 
    postMain() {
       
    /**
        *  The postMain() function is called only once, when the EFS is no longer used for
        *  the current symbol (ie, symbol change, chart closing, or application shutdown).
        */
    }

    //{{EFSWizard_Actions
        //{{EFSWizard_Action_1
        
    function onAction1() {
            
    Alert.email("""Renko Change");
            
    Alert.playSound("I:\\Program Files\\eSignal\\Sounds\\Hey Boy Sound.wav");
            
    Alert.addToList(getSymbol(), ""Color.RGB(0,0,0), Color.RGB(195,0,0));
            
    vLastAlert 1;
        }
        
    //}}EFSWizard_Action_1 29866
        
        //{{EFSWizard_Action_2
        
    function onAction2() {
            
    Alert.playSound("I:\\Program Files\\eSignal\\Sounds\\Hey Boy Sound.wav");
            
    Alert.email("""Renko Change");
            
    Alert.addToList(getSymbol(), ""Color.RGB(0,0,0), Color.RGB(195,0,0));
            
    vLastAlert 2;
        }
        
    //}}EFSWizard_Action_2 29914
        
    //}}EFSWizard_Actions 79752 
    Thanks for the Help
    EK

  • #2
    EK
    The reason the efs is not working is because in the conditions you are using a positive offset which references the next bar(s) instead of a negative offset which references the prior bar(s).
    Enclosed below is the corrected version of the efs.
    Alex

    PHP Code:
    //{{EFSWizard_Description
    //
    //    This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description 7532


    //{{EFSWizard_Declarations

    var vLastAlert = -1;

    //}}EFSWizard_Declarations 2482


    function preMain() {
       
    /**
        *  This function is called only once, before any of the bars are loaded.
        *  Place any study or EFS configuration commands here.
        */
    //{{EFSWizard_PreMain
        
    setPriceStudy(true);
        
    setStudyTitle("Renko Alerts");
    //}}EFSWizard_PreMain 7269

    }

    function 
    main() {
       
    /**
        *  The main() function is called once per bar on all previous bars, once per
        *  each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
        *  in your preMain(), it is also called on every tick.
        */

    //{{EFSWizard_Expressions
        //{{EFSWizard_Expression_1
            
    if (
                
    close() > close(-1) &&
                
    close(-1) < close(-2)
            ) 
    onAction1()
        
    //}}EFSWizard_Expression_1 10557
        
        //{{EFSWizard_Expression_2
            
    else if (
                
    close() < close(-1) &&
                
    close(-1) > close(-2)
            ) 
    onAction2();
        
    //}}EFSWizard_Expression_2 12604
        
    //}}EFSWizard_Expressions 46511


    //{{EFSWizard_Return
        
    return null;
    //}}EFSWizard_Return 2256

    }

    function 
    postMain() {
       
    /**
        *  The postMain() function is called only once, when the EFS is no longer used for
        *  the current symbol (ie, symbol change, chart closing, or application shutdown).
        */
    }

    //{{EFSWizard_Actions
        //{{EFSWizard_Action_1
        
    function onAction1() {
            
    Alert.email("""Renko Change");
            
    Alert.playSound("I:\Program Files\eSignal\Sounds\Hey Boy Sound.wav");
            
    Alert.addToList(getSymbol(), ""Color.RGB(0,0,0), Color.RGB(195,0,0));
            
    vLastAlert 1;
        }
        
    //}}EFSWizard_Action_1 30181
        
        //{{EFSWizard_Action_2
        
    function onAction2() {
            
    Alert.playSound("I:\Program Files\eSignal\Sounds\Hey Boy Sound.wav");
            
    Alert.email("""Renko Change");
            
    Alert.addToList(getSymbol(), ""Color.RGB(0,0,0), Color.RGB(195,0,0));
            
    vLastAlert 2;
        }
        
    //}}EFSWizard_Action_2 28095
        
    //}}EFSWizard_Actions 79732 

    Comment


    • #3
      Thanks Alex!

      Thanks Alex,

      I need to spend more time with EFS I am coming from a TS background.

      Thanks
      EK

      Comment


      • #4
        This is useful function.
        BUT
        How do you reset the alert? Say, alert has fired and I dismissed this condition. I do not want to be alerted about THIS turn anymore, but would like to be alerted on next one.
        Please share.

        Comment


        • #5
          dimitryg1
          Using the Formula Wizard you can easily modify the formula to do what you want.
          Move the commands to be executed from the "... then the following will happen everytime:" section to the "... while the following will happen only the first time:" section as shown in the enclosed screenshot. Then apply the same change also to Set2.
          Once you have done this the alerts will be triggered one time only (instead of the multiple alerts it is currently triggering) at every reversal.
          If you are unfamiliar with how to use the Formula Wizard see the Formula Wizard Guide which is available in the EFS KnowledgeBase
          Alex

          Comment

          Working...
          X