Higher Time 15min BUY And Sell zone

_SECTION_BEGIN("FRG1");
Ticker = ParamStr("Foreign Ticker", "BANKNIFTY" );
SetForeign(Ticker);
TimeFrameSet( 15*in1Minute ); // switch now to 9min 

ED=Param("ED",21,0,200,1);
DH=MA(H,ED);
DL= MA(L,ED);
//Plot(DH, "", IIf(DH > Ref(DH,-1) , colorYellow, colorBlack),styleThick|styleDots);
//Plot(DL, "", IIf(DL > Ref(DL,-1) , colorYellow, colorBlack),styleThick|styleDots);

FU = iif(C>DH,i=1,0);
FD = iif(C<DL,i=2,0);

//FU=ExRem(FU,FD);
//FU=Flip( FU,FD);

B1=BuyZONE= FU; /* Once Close over DH and it will continue till once close is below DL level and from ther onwards Sell zone start*/
S1=SellZone = FD ;/* Once Close below DL and it will continue till once close is abobe DH level and from ther onwards Buy zone start*/


B1=ExRem(B1,S1);
S1=ExRem(S1,B1);
 
Long=Flip(B1,S1); 

/*If the prices are between the Higher and lower line their last zone should be flashed until its  close above or below the DH or DL lines*/

TimeFrameRestore(); // restore time frame to original 

// expanding FSAR3m to align it to selected interval
B1 = TimeFrameExpand(B1, 15*in1Minute);
S1 = TimeFrameExpand(S1, 15*in1Minute);

RestorePriceArrays();	 
_SECTION_END();



_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_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", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

PlotShapes( IIf( B1, shapeUpArrow, shapeNone ), colorBlue, 0, L, -15 );
PlotShapes( IIf( S1, shapeDownArrow, shapeNone ), colorblack, 0, H, -15 );



Condition = B1; // data to plot the ribbon
Plot( 2, /* defines the height of the ribbon in percent of pane width */
 "Ribbon",
 IIf( Condition , colorGreen, colorRed ), /* choose color */
 styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
 
CChange = Condition != Ref( Condition, -1 );

bi = BarIndex();

fvb = Max( 0, FirstVisibleValue( bi ) );
lvb = Min( BarCount - 1, LastVisibleValue( bi ) );

GfxSetCoordsMode( 3 );

y = Status("pxchartbottom") - 3;

GfxSetTextAlign( 8 );
GfxSelectFont( "Arial", 8 );
GfxSetTextColor( colorWhite );
GfxSetBkMode( 1 );

for( i = fvb; i <= lvb; i++ )
{
	if( CChange[ i ] )
	{
		if( Condition[ i ] ) 
			text = "Up";
		else
			text = "Down";

		GfxTextOut( text, i, y );
	}
}


_SECTION_END();

HI, I would be very thankful if anyone could please help me out in setting a Buy zone and sell zone signal .

First i want to use 21 Min High and 21 min Low Moving Average to get two line.
Second part If close is above 21 High MA then its a buy zone until and unless price once closes below 21 min Low MA and from there onwards sell zone start.
Third part these signal to be percolated down to lower time frame Chart in form of ribbon.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.