Announcement

Collapse
No announcement yet.

Drawing line from close to close?

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

  • Drawing line from close to close?

    Hi,

    I want to drow a line, for example, from close of the 1630GMT bar to the close of the 2130GMT.

    I'm new to EFS and esignal, and with the wizard I have managed to draw from close to close but it goes through ALL the closes of all the candles in the chart.

    Could anyone point me in the right direction, or maybe a tutorial on how to do this?

    Thanks.

  • #2
    Hello ekaram,

    Unfortunately the formula wizard is somewhat limited in it's functionality. This particular EFS can only be done through the regular EFS editor.

    To begin learning how to program with EFS, please start with our Help Guides and Tutorials.

    We don't have a specific tutorial to cover all possible combinations of what can be done in EFS, but here's the basic code snippet that will help get you going. Basically, what it does is return a null value unless the formula is processing a bar with the specified time stamps. The hour(), minute() and second() functions refer to the start time of a bar. The close will only be returned, or plotted, on the chart for the bars with the specified time stamps. The line plot will then connect the dots, so to speak, to give you the line you want. To hide the connection lines that are in between sessions you can color the line with the same color as the background of your chart.

    PHP Code:
    var vColor Color.white;

    function 
    main() {
        var 
    null;
        
        if (
    hour(0) == 16 && minute(0) == 30) {
            
    vColor Color.red;
            
    close(0);
        }

        if (
    hour(0) == 21 && minute(0) == 30) {
            
    close(0);
        }
        
        if (
    hour(0) == 21 && minute(0) > 30) {
            
    vColor Color.white;
        }
        
        
    setBarFgColor(vColor);
        
        return 
    c;

    It will look something like this,

    Attached Files
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X