Vous êtes sur la page 1sur 7

SetBarsRequired( 800, 0 );

GraphXSpace = 7;
SetChartOptions( 0, chartShowArrows | chartShowDates );
Cg = Foreign(".NESI", "C");
accel = Param("Acceleration", 0.02, 0, 1, 0.001);
mx = Param("Max. acceleration", 0.2, 0, 1, 0.001);
rt=PTA_Pos();
SellPrice = ValueWhen( Sell, C, 1 );
BuyPrice = ValueWhen( Buy, C, 1 );
Long = Flip( Buy, Sell );
Shrt = Flip( Sell, Buy );
state = IIf( BarsSince( a ) < BarsSince( b ), 1, 0 );
Longs = state == 1;
shorts = state == 0;
Colorbar = IIf( Longs, colorGreen, IIf( Shorts, colorRed, colorGrey40 ) );
Plot( C, "Close", colorbar, styleCandle = 64 | styleNoTitle );
PlotShapes( IIf( aHPivs == 1, shapeDownArrow, shapeNone ), colorOrange, 0, High,
Offset = -30 );
PlotShapes( IIf( aLPivs == 1, shapeUpArrow , shapeNone ), colorLime, 0, Low, Off
set = -30 );
PlotShapes( IIf(Buy, shapeSmallCircle, shapeNone),colorBrightGreen, 0, BuyPrice,
Offset = -15 );
PlotShapes( IIf(Sell, shapeSmallCircle, shapeNone),colorWhite, 0 ,SellPrice, Of
fset = 50 );
FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status("LastVisibleBar");
for( b = Firstvisiblebar; b <= Lastvisiblebar AND b < BarCount; b++)
{
if( Buy[b] ) PlotText("\n\n\n\n Buy\n "+NumToStr(BuyPrice[b],1.2),b,BuyPrice[b],
colorBrightGreen);
else if( Sell[b] ) PlotText("Sell "+NumToStr(SellPrice[b], 1.2),b,SellPrice[b],
colorWhite);
}
Plot( EMAC13, "" , colorSkyblue + styleLine + styleNoRescale );
Change1 = StrFormat("%1.2f% ",xChange1);
barche1= xChange1>=0;
Comche1= xChange1<0;
xperchange1 = xChange1/100;
perchange1 = StrFormat("%1.2f% ",xperchange1);
positivechange1 = xperchange1>0;
negativechange1 = xperchange1<0;
_SECTION_BEGIN( "Title" );
printf( "Open : " + O );

if ( Status( "action" ) == actionIndicator )


(
Title = EncodeColor( colorGold ) + "Profit trading academy 8122222305" +
EncodeColor( ColorRGB( 111, 208, 255 ) ) + " (" + Name() + ") " + EncodeColor
( colorGold ) + Interval( 2 ) +
" " + Date() + " " + " Open " + O + " " + "Hi " + H + " " +
"Lo " + L + " " + EncodeColor( ColorRGB( 111, 208, 255 ) ) +
"Close " + C + " ( " + WriteVal( ( C - Ref( C, -1 ) ) * 100 / Re
f( C, -1 ), 1.1 ) + " %)" + EncodeColor( colorGold ) + " Vol= " + WriteVal( V,
1.0 )
+ " " + WriteIf( V > Vp2, EncodeColor( colorBrightGreen ) + "(Ve
ry High)", WriteIf( V > Vp1, EncodeColor( colorLime ) + "(High)", WriteIf( V > V
rg, EncodeColor( colorLime ) + "(Above Average)",
WriteIf( V<Vrg AND V>Vn1, EncodeColor( ColorRGB
( 255, 0, 128 ) ) + "(Less than Average)", WriteIf( V < Vn1, "(Low)", "" ) ) ) )
) + EncodeColor( colorGold ) + " "
+ EncodeColor( colorGold ) + "EMA(Close,13) = " +EncodeColor( co
lorBrightGreen ) + WriteVal( EMA( C, 13 ), 1.2 )

);

pxwidth = Status( "pxwidth" );


pxheight = Status( "pxheight" );
GfxSetOverlayMode( 1 );
GfxSetBkMode( 0 ); // transparent
GfxSelectFont( "Amienne", Status( "pxheight" ) / 15 );
_SECTION_END();
_SECTION_BEGIN( "Keltner Bands" );
P = ParamField( "Price field", -1 );
Periods = Param( "Periods", 15, 2, 300, 1 );
Width = Param( "Width", 2, 0, 10, 0.05 );
Color = ParamColor( "Color", colorBlue );
Style = ParamStyle( "Style" );
CenterLine = MA( P, Periods );
KTop

= CenterLine + Width * ATR( Periods );

KBot = CenterLine - Width * ATR( Periods );


Plot( KTop, "KBTop" + _PARAM_VALUES(), Color, Style );
Plot( KBot, "KBBot" + _PARAM_VALUES(), Color, Style );

colordots = IIf(F_SAR < L,colorYellow,IIf(F_SAR> H,colorRed,colorWhite));


SetBarsRequired(-2,-2);
SetChartOptions(0, chartShowDates);
_SECTION_END();

_SECTION_BEGIN("Support and Resistance");


LB= Param("Look Back Periods",10,1,30,1);
rt=SR();
Color=IIf(O>C,colorBlack,colorGreen);
Plot (R,"Resz",22,8+16);
Plot (s,"Supp",19,8+16);
Plot (C,"Close",color,64,32);
GraphXSpace=4;
PlotShapes ( IIf(PivotHigh, shapeSmallCircle, shapeNone), colorCustom12,0,H, 5);
PlotShapes( IIf(PivotLow, shapeSmallCircle, shapeNone), colorBlue,0, L, -5);
_SECTION_END();
_SECTION_BEGIN(" Market Price");
FS=Param("Font Size",28,15,300,5);
GfxSelectFont("Arial", FS, 900, italic = False, underline = False, True );
Hor=Param("Horizontal Position",766,4,1200,4);
Ver=Param("Vertical Position",4,4,4,4);
GfxTextOut(""+C,Hor , Ver );
_SECTION_END();

RequestTimedRefresh(0.1,True);
xx=BarIndex();x=xx;Lx=LastValue(x);
nbar=Param("N Pivot Bars",5,2,50,1);
tf=Param("Time Frame (min)",inWeekly/60,1,inWeekly/60,1);tfrm=in1Minute*tf;
CleanPivots=ParamToggle("Use Clean Pivots","Off|On",1);
PivotSymmetry=ParamToggle("Use Symmetric Pivots","Off|On",0);
displayMode=ParamToggle("Display Mode","Classic|Alternative",1);
logscale=ParamToggle("Axis type","Linear|Logarithmic",0);
SetChartOptions(0,chartShowDates);
if(logscale) SetChartOptions(2,chartLogarithmic,chartGridMiddle|chartGridMargins
);
else SetChartOptions(3,chartLogarithmic,!(chartGridMiddle|chartGridMargins));
TimeFrameSet(tfrm);
rt=TimeFrameProc();
pkhn=IIf(pk,H,Null);
trln=IIf(tr,L,Null);
TimeFrameRestore();
fact=Nz(Max(tfrm/60,Interval()/60)/(Interval()/60));

if(fact==0)fact=1;
Lkbk=Nz(tfrm/Interval());
if(Lkbk>1)
{
pk=TimeFrameExpand(pk,tfrm,expandFirst);
pkhn=TimeFrameExpand(pkhn,tfrm,expandFirst);
pkhs=IIf(!IsEmpty(pkhn),1,0);pkhs=pkhs-Ref(pkhs,-1);
pk=pk AND H==pkhn;
cond1=Sum(pk,BarsSince(pkhs==1)+1)==1 AND pk;
pk=pk AND cond1;
tr=TimeFrameExpand(tr,tfrm,expandFirst);
trln=TimeFrameExpand(trln,tfrm,expandFirst);
trls=IIf(!IsEmpty(trln),1,0);trls=trls-Ref(trls,-1);
tr=tr AND L==trln;
cond1=Sum(tr,BarsSince(trls==1)+1)==1 AND tr;
tr=tr AND cond1;
rt=PxTx();
}
pkhn=IIf(pkh,pkh,Null);
trln=IIf(trln,trln,Null);
for(i=0;i<BarCount;i++){xkk[i]=pk[i];}
for(i=0;i<BarCount;i++){trkk[i]=tr[i];}
SetBarFillColor(IIf(C>O,colorGreen,IIf(C<=O,colorRed,colorLightGrey)));
Plot(C,"Price",IIf(C>O,colorDarkGreen,IIf(C<=O,colorDarkRed,colorLightGrey)),64,
0,0,0,0);
Plot(pkhn,"",colorRed,styleThick,0,0,0,-1);
Plot(trln,"",colorBrightGreen,styleThick,0,0,0,-1);
PlotShapes(shapeSmallCircle*trkk,IIf(Lx-ValueWhen(tr,x)>nbar*fact,ColorRGB(0,100
,0),colorWhite),0,L,-10);
PlotShapes(shapeSmallCircle*xkk,IIf(Lx-ValueWhen(xkk,x)>nbar*fact,ColorRGB(255,0
,0),colorWhite),0,H,10);
qq=Interval()/60;
if(qq < 60){tf=" min";tt=qq;}
else if(qq >= 60 AND qq < 1440){tf=" hrs";tt=qq/60;}
else if(qq >= 1440){tf=" days";tt=(qq/60)/24;}
qq=Max(tfrm/60,Interval()/60);
if(qq < 60){tfa=" min";tta=qq;}
else if(qq >= 60 AND qq < 1440){tfa=" hrs";tta=qq/60;}
else if(qq >= 1440){tfa=" days";tta=(qq/60)/24;}
function GetVisibleBarCount()
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
return Min(lvb-fvb,BarCount-fvb);
}
function GfxConvertBarToPixelX(bar)
{
lvb=Status("lastvisiblebar");
fvb=Status("firstvisiblebar");
pxchartleft=Status("pxchartleft");
pxchartwidth=Status("pxchartwidth");
return Nz(pxchartleft+bar*pxchartwidth/(lvb-fvb+1));
}

function GfxConvertValueToPixelY(value,logscale)
{
local Miny,Maxy,pxchartbottom,pxchartheight;
Miny=Status("axisminy");
Maxy=Status("axismaxy");
pxchartbottom=Status("pxchartbottom");
pxchartheight=Status("pxchartheight");
delta=log(maxy)-log(Miny);
if(logscale) rv=Nz(pxchartbottom-floor(0.5+(log(Value)-log(Miny))*pxcharthei
ght/(delta)));
else rv=Nz(pxchartbottom-floor(0.5+(Value-Miny)*pxchartheight/(Maxy-Miny)));
return rv;
}
AllVisibleBars=GetVisibleBarCount();
fvb=Status("firstvisiblebar");
for(i=0;i<AllVisibleBars;i++)
{
DisplayRes=1;
DisplaySup=1;
lvix=i+fvb;
if(pk[lvix])
{
if(displayMode)
{
hval=H[lvix];
for(j=i;j<AllVisibleBars;j++)
{
lvjx=j+fvb;
if(H[lvjx]>hval)
{
DisplayRes=0;
break;
}
}
}
if(DisplayRes)
{
GfxSelectPen(ColorRGB(100,0,0),3,0);
GfxMoveTo(GfxConvertBarToPixelX(i),GfxConvertValueToPixelY(H[lvix],l
ogscale));
GfxLineTo(GfxConvertBarToPixelX(AllVisibleBars-1),GfxConvertValueToP
ixelY(H[lvix],logscale));
GfxSelectFont("Tahoma",8,650);GfxSetBkColor(ColorRGB(200,0,0));GfxSe
tTextColor(colorWhite);
GfxTextOut(""+H[lvix],GfxConvertBarToPixelX(AllVisibleBars+1),GfxCon
vertValueToPixelY(H[lvix],logscale));
}
}
if(tr[lvix])
{
if(displayMode)
{
lval=L[lvix];
for(j=i;j<AllVisibleBars;j++)
{
lvjx=j+fvb;
if(L[lvjx]<lval)
{
DisplaySup=0;

break;
}
}
}
if(DisplaySup)
{
GfxSelectPen(ColorRGB(0,0,100),3,0);
GfxMoveTo(GfxConvertBarToPixelX(i),GfxConvertValueToPixelY(L[lvix],l
ogscale));
GfxLineTo(GfxConvertBarToPixelX(AllVisibleBars-1),GfxConvertValueToP
ixelY(L[lvix],logscale));
GfxSelectFont("Tahoma",8,650);GfxSetBkColor(ColorRGB(0,0,200));GfxSe
tTextColor(colorWhite);
GfxTextOut(""+L[lvix],GfxConvertBarToPixelX(AllVisibleBars+1),GfxCon
vertValueToPixelY(L[lvix],logscale));
}
}
}

_SECTION_BEGIN("BUY SELL ARROW");


nBars = Param("Number of bars", 12, 5, 40);
bTrace = Param("Include trace output", 1, 0, 1);
nNoPivsInSetup = Param("No. Pivs in Setup", 4, 3, 4, 1);
bShowTCZ = Param("Show TCZ", 1, 0, 1);
nMinBarsBtwPivs = Param("Min. number of bars btw. pivots", 1, 1, 10, 1);
nMinPctBtwPivs = Param("Min. percent diff. btw. pivots", .05, .04, .2, .01);
bLastBarCanBePiv = Param("Last bar can be a pivot", 1, 0, 1);
retrcTolerance = .01;
tczTolerance = .005;
nNumBarsToScan = 120;
nExploreBarIdx = 0;
nExploreDate = 0;
nCurDateNum = 0;
DN = DateNum();
DT = DateTime();
bTCZLong = False;
bTCZShort = False;
nAnchorPivIdx = 0;
if(Status("action")==1) {
bDraw = True;
bUseLastVis = Param("Use last visible bar", 1, 0, 1);
} else {
bDraw = False;
bUseLastVis = False;
bTrace = False;
nExploreDate = Status("rangetodate");
for (i=LastValue(BarIndex());i>=0;i--) {
nCurDateNum = DN[i];
if (nCurDateNum == nExploreDate) {
nExploreBarIdx = i;

}
}
}
GraphXSpace=7;
nLastVisBar = LastValue(
Highest(IIf(Status("barvisible"), BarIndex(), 0)));
rt=HLPivs();
if (bDraw) {
PlotShapes(
IIf(aHPivs==1, shapeDownArrow, shapeNone),
colorRed, 0,
High, Offset=-15);
PlotShapes(
IIf(aAddedHPivs==1, shapeDownArrow, shapeNone),
colorCustom12, 0, High, Offset=-15);
PlotShapes(
IIf(aLPivs==1, shapeUpArrow , shapeNone),
5, 0, Low, Offset=-15);
PlotShapes(
IIf(aAddedLPivs==1, shapeUpArrow , shapeNone),
colorWhite, 0, Low, Offset=-15);

_SECTION_END();

Vous aimerez peut-être aussi