Announcement

Collapse
No announcement yet.

EFS not opening

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

  • EFS not opening

    I am also trying to ID NR7 bars, I tried changing the code below but for some reason it isn't opening, please see attached, do I need to make any further changes to get this to work?
    I'm very grateful for any help.
    Attached Files

  • #2
    On NR7, the following lines are suspect, I think 1 should be -1:
    PHP Code:
    var this_hour getHour(1);
    var 
    this_minute getMinute(1); 
    Regarding performance, ALL old bars are being tested 7 times when the study is first loaded, chart resized/refreshed, or symbol/interval changed. There are ways to reduce this, but it would make the code a lot more complicated.

    I would make sure text is cleared out, as you might be taking a performance hit if it isn't (redrawing text multiple times). Add the following somewhere at the top of main():
    PHP Code:
    if (nState == BARSTATE_ALLBARS) {
        
    clearText();

    Minor performance stuff:

    Initializing a variable as a string that will be used as a number is probably a bad idea, as JavaScript may try treating it as a string first elsewhere in the code. I'd change the following to 0, -1, or null:
    PHP Code:
    var widest_bar_index "";
    var 
    narrowest_bar_index ""
    I'd try to get the symbol only once. There are several way to do this, one way is:
    PHP Code:
    var symbol null;
    ...
    function 
    main() {
        var 
    nState getBarState();
        if (
    nState == BARSTATE_ALLBARS) {
            
    symbol getSymbol();
        }
        else if (
    nState == ... 
    Once getHour(1) is changed to getHour(-1), you could just get it once, rather than inside 2 if statements.
    Last edited by shortandlong; 01-14-2010, 09:51 AM.

    Comment

    Working...
    X