Announcement

Collapse
No announcement yet.

EFS Script Painfully Slow - Can Anyone Suggest a Better Way?

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

  • EFS Script Painfully Slow - Can Anyone Suggest a Better Way?

    This EFS puts a red 7 above WR7 bars and a green 7 above NR7 bars.

    NR7 = bar that is the narrowest of the last 7 bars.

    WR7 = bar that is the widest of the last 7 bars.

    It's painfully slow, though and locks up eSignal. Can anyone suggest a more efficient way?
    Attached Files

  • #2
    davemabe
    Try commenting out or removing all the debugPrintln() statements in the script as those will take up resources.
    Having said that your efs does not appear to be locking up eSignal even with the debug statements.
    Alex

    Comment


    • #3
      davemabe
      In running the script it seems to me that it is identifying some narrow and wide range bars incorrectly.
      For example in the following screenshot bar 1 should be marked as NR7 as it has the narrowest range in the group of seven bars.



      In the following image instead bar 1 should not be tagged as a WR7 since the range of bar 7 is wider (an NR7 is also missing in the same group of 7 bars)



      To correct this replace the following section of your code

      PHP Code:
      for (var 8>= 1i--) {
          var 
      width_of_bar high(-i) - low(-i);
          if (
      width_of_bar narrowest_width) {
              
      narrowest_width width_of_bar;
              
      narrowest_bar_index i;
          } else if (
      width_of_bar widest_width) {
              
      widest_width width_of_bar;
              
      widest_bar_index i;
          }

      with the following

      PHP Code:
      for (var 7>= 1i--) {
          var 
      width_of_bar high(-i) - low(-i);
          if (
      width_of_bar narrowest_width) {
              
      narrowest_width width_of_bar;
              
      narrowest_bar_index i;
          } 
          if (
      width_of_bar widest_width) {
              
      widest_width width_of_bar;
              
      widest_bar_index i;
          }

      The results of this modification are shown below
      That said there may be other issues as well
      Alex



      Comment

      Working...
      X