can somebody please explain me in english, In This Code(mentioned below) what conditions writer is using to make entry and exit, please help on what conditions writer has designed to make entry and exit.
_SECTION_BEGIN("Price");
SetBarsRequired(100000,0);
GraphXSpace = 15;
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("bkcolor",ColorRGB(0,0, 0)));
GfxSetBkMode(0);
GfxSetOverlayMode(1);
//SetTradeDelays(1,1,1,1);
SetPositionSize(100,spsShares);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
_SECTION_END();
NHours=Param("Number of Hours",30,1,50,1);
HoursC=TimeFrameGetPrice("O",inHourly,0);
NHoursDHLAvg=0;
for(i=1;i<=NHours;i++)
{
HourH=TimeFrameGetPrice("H",inHourly,-i);
HourL=TimeFrameGetPrice("L",inHourly,-i);
NHoursDHLAvg=NHoursDHLAvg+(HourH-HourL);
}
NHoursDHLAvg=NHoursDHLAvg/NHours;
TenDHLAvg= NHoursDHLAvg;
Buy= C>((HoursC)+((0.618)*(TenDHLAvg)));
Sell= C<((HoursC)-((0.618)*(TenDHLAvg)));
Cover= C>((HoursC)+((0.382)*(TenDHLAvg)));
Short= C<((HoursC)-((0.382)*(TenDHLAvg)));
Buy=ExRem(Buy,Short);
Short=ExRem(Short,Buy);
Sell=ExRem(Sell,Cover);
Cover=ExRem(Cover,Sell);
BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorDarkRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-40);
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-50);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
SetPositionSize(300,spsShares);
ApplyStop(0,1,10,1);
//-----------end--------------
Long=Flip(Buy,Short);
Shrt=Flip(Sell,Cover);
Edc=(
WriteIf (Buy , " BUY at "+C+" ","")+
WriteIf (Sell, " SEll at "+C+" ","")+
WriteIf (Cover , " Sell Stop at "+C+" ","")+
WriteIf (Short , " Buy Stop at "+C+" ","")
);
_SECTION_END();
BarColors =
IIf(BarsSince(Buy) < BarsSince(Short)
AND BarsSince(Buy)!=0, colorGreen,
IIf(BarsSince(Sell) < BarsSince(Cover)
AND BarsSince(Sell)!=0, colorRed, colorWhite));
//Plot the Candlestick charts
Plot(C, "Close", BarColors, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ) ;
for( i = 0; i < BarCount; i++ )
{
//if( Buy ) PlotText( "BUY@" + C[ i ], i, C[ i ], colorWhite, colorBlue );
//if( Sell ) PlotText( "SELL@" + C[ i ], i, C[ i ], colorWhite, colorViolet );
// if( Cover ) PlotText( "Sell Stop@" + C[ i ]+ "\nSell Profit= " + ((SellPrice-CoverPrice)), i, L[ i ]-3, colorLightGrey, colorBlack );
//if( Short ) PlotText( "BuyStop@" + C[ i ]+ "\nBuy Profit= " + ((ShortPrice-BuyPrice)), i, H[ i ]+3, colorLightGrey, colorBlack );
}
_SECTION_BEGIN("Background text");
C11=ParamColor("up panel",colorBlack );
C12=ParamColor("dn panel",colorBlack );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",12,1,20,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSetOverlayMode(1);
GfxGradientRect(0,0,pxwidth, pxheight, C11, C12 );
GfxSelectFont("Tahoma", Status("pxheight")/C13 );
GfxSetTextColor(colorBrown);
GfxSetTextAlign( 6 );
//GfxTextOut( "LTP "+WriteVal(C,1.2), Status("pxwidth")/C14, Status("pxheight")/C15);
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxSetTextColor(colorBrown);
GfxSelectFont("Tahoma", 20, 800, False, False, 0);
GfxSetTextColor(colorYellow);
GfxTextOut(""+edc+"", Status("pxwidth")/1.15, Status("pxheight")/C15*0.3 );
please help........
just explain entry and exit conditions in english , request
_SECTION_BEGIN("Price");
SetBarsRequired(100000,0);
GraphXSpace = 15;
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("bkcolor",ColorRGB(0,0, 0)));
GfxSetBkMode(0);
GfxSetOverlayMode(1);
//SetTradeDelays(1,1,1,1);
SetPositionSize(100,spsShares);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
_SECTION_END();
NHours=Param("Number of Hours",30,1,50,1);
HoursC=TimeFrameGetPrice("O",inHourly,0);
NHoursDHLAvg=0;
for(i=1;i<=NHours;i++)
{
HourH=TimeFrameGetPrice("H",inHourly,-i);
HourL=TimeFrameGetPrice("L",inHourly,-i);
NHoursDHLAvg=NHoursDHLAvg+(HourH-HourL);
}
NHoursDHLAvg=NHoursDHLAvg/NHours;
TenDHLAvg= NHoursDHLAvg;
Buy= C>((HoursC)+((0.618)*(TenDHLAvg)));
Sell= C<((HoursC)-((0.618)*(TenDHLAvg)));
Cover= C>((HoursC)+((0.382)*(TenDHLAvg)));
Short= C<((HoursC)-((0.382)*(TenDHLAvg)));
Buy=ExRem(Buy,Short);
Short=ExRem(Short,Buy);
Sell=ExRem(Sell,Cover);
Cover=ExRem(Cover,Sell);
BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorDarkRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-40);
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-50);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
SetPositionSize(300,spsShares);
ApplyStop(0,1,10,1);
//-----------end--------------
Long=Flip(Buy,Short);
Shrt=Flip(Sell,Cover);
Edc=(
WriteIf (Buy , " BUY at "+C+" ","")+
WriteIf (Sell, " SEll at "+C+" ","")+
WriteIf (Cover , " Sell Stop at "+C+" ","")+
WriteIf (Short , " Buy Stop at "+C+" ","")
);
_SECTION_END();
BarColors =
IIf(BarsSince(Buy) < BarsSince(Short)
AND BarsSince(Buy)!=0, colorGreen,
IIf(BarsSince(Sell) < BarsSince(Cover)
AND BarsSince(Sell)!=0, colorRed, colorWhite));
//Plot the Candlestick charts
Plot(C, "Close", BarColors, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ) ;
for( i = 0; i < BarCount; i++ )
{
//if( Buy ) PlotText( "BUY@" + C[ i ], i, C[ i ], colorWhite, colorBlue );
//if( Sell ) PlotText( "SELL@" + C[ i ], i, C[ i ], colorWhite, colorViolet );
// if( Cover ) PlotText( "Sell Stop@" + C[ i ]+ "\nSell Profit= " + ((SellPrice-CoverPrice)), i, L[ i ]-3, colorLightGrey, colorBlack );
//if( Short ) PlotText( "BuyStop@" + C[ i ]+ "\nBuy Profit= " + ((ShortPrice-BuyPrice)), i, H[ i ]+3, colorLightGrey, colorBlack );
}
_SECTION_BEGIN("Background text");
C11=ParamColor("up panel",colorBlack );
C12=ParamColor("dn panel",colorBlack );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",12,1,20,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSetOverlayMode(1);
GfxGradientRect(0,0,pxwidth, pxheight, C11, C12 );
GfxSelectFont("Tahoma", Status("pxheight")/C13 );
GfxSetTextColor(colorBrown);
GfxSetTextAlign( 6 );
//GfxTextOut( "LTP "+WriteVal(C,1.2), Status("pxwidth")/C14, Status("pxheight")/C15);
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxSetTextColor(colorBrown);
GfxSelectFont("Tahoma", 20, 800, False, False, 0);
GfxSetTextColor(colorYellow);
GfxTextOut(""+edc+"", Status("pxwidth")/1.15, Status("pxheight")/C15*0.3 );
please help........
just explain entry and exit conditions in english , request
It will buy when
Close price is above the (Hourly Open price + 0.618 * (simple average of (last 30 hourly high - last 30 hourly low))).
It will exit from buy when
Close price is below the (Hourly Open price - 0.618 * (simple average of (last 30 hourly high - last 30 hourly low))).