Announcement

Collapse
No announcement yet.

not show historical plot

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

  • not show historical plot

    Hi,

    Is there a way to not display, or not plot the historical data on a High-Low efs? Suppose I like to see high-low for current week only. I'm referring the High-Low efs made by the admirable Mr. Alex.

    -Rupe

  • #2
    rupe
    Here is one way of doing what you are trying to accomplish. This needs to be tested [in particular on a Saturday and Sunday] to see if it is working as intended.
    As a first step create a global variable [ie outside of preMain() and main()] called for example firstBI and set it initially to null
    PHP Code:
    var firstBI null;
     
    function 
    main(){
        ... 
    Then at the beginning of main() insert the following section of code (before the rest of your code)
    PHP Code:
    function main(){
        if(
    getBarState()==BARSTATE_ALLBARS){
            var 
    sysDate = new Date();
            if(
    sysDate.getDay()==0){
                var 
    DOWdiff 6;
            }else{
                var 
    DOWdiff sysDate.getDay()-1;
            }
            var 
    firstDOW parseInt((sysDate.getTime()/1000)-(DOWdiff*86400));
            
    firstBI getFirstBarIndexOfDay(firstDOW);
        }
        if(
    getCurrentBarIndex()<firstBI) return;
     
        
    //rest of your code here 
    Once you implement this change you should get the plots to display only from the beginning of the current week only.
    As an example here is the result of the PivotPoint.efs modified using this logic.
    Alex

    Comment


    • #3
      Following up on the previous message here is a screenshot of the same chart taken on the next day with the plot still starting on the first day of the current week
      Alex

      Comment


      • #4
        After further testing on Saturday and Sunday the logic appears to be working correctly as shown in the first two screenshots enclosed below. The third screenshot taken today shows the plot now starting from the first bar of the new week.
        Alex





        Comment

        Working...
        X