Professional Documents
Culture Documents
F4 = 0;
if ( D2 <= F1 )
F4 = F1;
else
if ( D2 <= F2 )
F4 = F2;
else
F4 = F3;
S_P = ( O1 - F4 );
B_P = ( O1 + F4 );
BP = ( L1 + F2 );
BPSTPLS = ( BP - ( BP * .0085 ) );
SP = ( C1 - D1 );
SPTGT = ( C1 - ( H1 - L1 ) );
SPSTPLS = ( SP + ( SP * .0085 ) );
p = ( H1 + L1 + C1 ) / 3;
s1 = ( H1 );
r1 = ( L1 );
r2 = SelectedValue( L2 );
s2 = SelectedValue( H2 );
//CONDITION
S = ( C > p );
SS = ( C < P );
//Plot
Plot ( BPTGT, "BUY & SELL @", 40, 4 );PlotText( "Sell-LongSell" , BarCount-25,
BPTGT+0, 40 );
Plot ( BPSTPLS, "BUY STPLS @", 32, 4 );PlotText( "STP-LS LongSell" , BarCount-25,
BPSTPLS+0, 32 );
Plot ( SPTGT, "SEL & BUY @", 35, 4 );PlotText( "Buy-ShortCover" , BarCount-25,
SPTGT+0, 40 );
Plot ( SPSTPLS, "SELL STPLS @", 32, 4 );PlotText( "STP-LS ShortCover" , BarCount-
25, SPSTPLS+0, 32 );
GfxSetBkColor( colorRed );
GfxSetTextColor( 41 );
GfxSetBkColor( colorLightGrey );
GfxSetTextColor( 16 );
GfxTextOut("* "+ ( WriteVal( H1 ) + "--" + WriteVal( L1 ) + "=PreDay=" +
WriteVal( D1 ) ), 32, 100 );
Filter = S OR SS;
AddColumn( IIf( SS, 83, 1 ), "Sell", formatChar, 1, bkcolor = IIf( SS, 25, 32 ) );
Buy = Cross ( ( C ), ( BP ) );
Sell = Cross ( ( C ), ( SP ) );
_SECTION_END();
_SECTION_BEGIN("HH-HL-LH");
Q = Param( "% Change", 2, 0.1, 10, 0.1 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) >
Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) <
Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 )
> Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 )
< Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );
if ( LH[i] )
PlotText( "LH", i, H[ i ] + dist[i], colorYellow );
if ( HL[i] )
PlotText( "HL", i, L[ i ] - dist[i], colorBrown );
if ( LL[i] )
PlotText( "LL", i, L[ i ] - dist[i], colorBrown );
}
_SECTION_END();
n=Param("Values back",20,1,200,1);
p=Param("zig %",5,1,100,1);
dist = 0.8*ATR(15);
_SECTION_END();
_SECTION_BEGIN("Price1");
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", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();