Getting previous signals in Interpretation window

Romeo1998

Well-Known Member
#1
Dear friends,
I have this code which plots the intraday low and high along with its intraday bar number. I am trying to find out whether the intraday low was first or the intraday high, and then display the same in interpretation window; but in interpretation window I am getting previous day's signals too, which I do not want.

Following is the code :-
Code:
_SECTION_BEGIN( "Price" );
SetChartOptions( 0, chartShowArrows | chartShowDates, 0 );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", colorDefault, styleCandle );
_SECTION_END();


DL = TimeFrameGetPrice( "L", inDaily, 0 );
DH = TimeFrameGetPrice( "H", inDaily, 0 );
bi = BarIndex();
dn = DateNum();
newday = dn != Ref( dn, -1 );
BarsOfDay = BarsSince( newday );


SetBarsRequired( 1500, 1500 );
LowCond = L == DL;
HighCond = H == DH;
fvb = FirstVisibleValue( bi );
lvb = LastVisibleValue( bi );

barnumberoflow=ValueWhen (LowCond, barsofday,1);
barnumberofhigh=ValueWhen (highcond, barsofday,1);

for( i = fvb; i <= lvb; i++ )
{
    if( LowCond[i] )
    {
        PlotText( "DL " + barsofday[i], i, L[ i ], colorBrightGreen, -1, -15 );
    }

    if( HighCond[i] )
    {
        PlotText( "HL " + barsofday[i], i, H[ i ], colorRed, -1, 15 );
    }
 
    if( newday[i] )
    {
        if( barnumberoflow[i] < barnumberofhigh[i] )
        {
            Printf( "low was first in intraday\n" );
            printf( "low is on bar number %g\n\n", barnumberoflow );
        }
     
        if( barnumberofhigh[i] < barnumberoflow[i] )
        {  
     
            Printf( "high was first in intraday\n" );
            printf( "high is on bar number %g\n\n", barnumberofhigh );
        }
    }
}

Please kindly guide me. Awaiting your replies.
Thank you.
 
Last edited:

Similar threads