Hi,

I am new to AFL programming. Please help on this code.

I have created data set for complete 15 min rsi value but don't know how to filter complete day if RSI value goes above 70 or below 30 for complete day.

period = Param( "RSI period", 14, 2, 30, 1 );

TimeFrameSet( in15Minute ); // switch to 15 minute frame

SetChartOptions( 0, 0, ChartGrid30 | ChartGrid70 );

r = RSI( period );

//rHHV = RSI( period );

//rLLV = RSI( period );

Below70 = r < 70;

Above30 = r > 30;

grid_day = Day()!=Ref(Day(),-1);

Plot(grid_day,"",colorLightBlue,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);

// Explore //

Filter = 1 ;

AddColumn( r , "RSI( " + period + ")" );

// Chart //

Plot( RSI( period ), "RSI( " + period + ") ", colorWhite );

Plot(30,"",colorLightGrey,styleDashed);

Plot(70,"",colorLightGrey,styleDashed);

Plot(100,"",colorBlack,styleDashed);

Plot(0,"",colorBlack,styleDashed);

PlotOHLC( r, r, 50, r, "", IIf( r > 50, colorRed, colorGreen ), styleCloud | styleClipMinMax, 30, 70 );

TimeFrameRestore();

/*

_SECTION_BEGIN("RSI between 70 and 30");

AddColumn( r, "RSI( " + period + ") " );

Buy = (RSI(14) > 68) AND Session;

Sell = (RSI(14) < 30 ) AND Session;

Buy = ExRem(Buy,Sell);

Sell = ExRem(Sell,Buy);

_SECTION_END();*/

Data Set :