Академический Документы
Профессиональный Документы
Культура Документы
_SECTION_END();
// -- what will be our lookback range for the hh and ll?
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;
ADX8 = ADX(8);
GraphXSpace=7;
nHPivs = 0;
nLPivs = 0;
lastHPIdx = 0;
lastLPIdx = 0;
lastHPH = 0;
lastLPL = 0;
curPivBarIdx = 0;
/* *************************
Finding missed pivot(s)
************************* */
lastLPIdx = aLPivIdxs[0];
lastLPL = aLPivLows[0];
lastHPIdx = aHPivIdxs[0];
lastHPH = aHPivHighs[0];
/*
Note - I'm only interested in adding pivots if I'm in
a higher-highs or lower-lows scenario
*/
// -- OK, let's start where the last high pivot occurs after the
// last Low pivot
if (lastHPIdx > lastLPIdx) {
/* ****************************************************************
Still finding missed pivot(s). Here, the last piv is a low piv.
**************************************************************** */
} else {
// -- First case, lower highs
if (aHPivHighs[0] < aHPivHighs[1]) {
}
// -- If there are at least two of each
}
/* ****************************************
// -- Done with finding pivots
***************************************** */
if (bDraw) {
/* ****************************************
// -- Done with discovering and plotting pivots
***************************************** */
minRtrc = 0;
maxRtrc = 0;
minLine = 0;
maxLine = 0;
triggerLine = 0;
firstProfitLine = 0;
triggerInc = 0;
triggerPrc = 0;
firstProfitPrc = 0;
retrcPrc = 0;
retrcBar = 0;
retrcBarIdx = 0;
retrcRng = 0;
aRetrcPrc = H-H;
aRetrcPrcBars = H-H;
aRetrcClose = C;
retrcClose = 0;
tcz500 =
(aHPivHighs[0] -
(.5 * (aHPivHighs[0] - aLPivLows[1])));
tcz618 =
(aHPivHighs[0] -
(.618 * (aHPivHighs[0] - aLPivLows[1])));
tcz786 =
(aHPivHighs[0] -
(.786 * (aHPivHighs[0] - aLPivLows[0])));
// -- bTCZLong setup?
bTCZLong = (
tcz500 =
(aHPivHighs[1] -
(.5 * (aHPivHighs[1] - aLPivLows[0])));
tcz618 =
(aHPivHighs[0] -
(.618 * (aHPivHighs[1] - aLPivLows[0])));
tcz786 =
(aHPivHighs[0] -
(.786 * (aHPivHighs[0] - aLPivLows[0])));
bTCZShort = (
// -- Are retracement levels arranged in
// tcz order?
// **************************
// END EXPLORATION CODE
// **************************
// **************************
// BEGIN INDICATOR CODE
// **************************
ADX8 = ADX(8);
GraphXSpace=7;
nHPivs = 0;
nLPivs = 0;
lastHPIdx = 0;
lastLPIdx = 0;
lastHPH = 0;
lastLPL = 0;
curPivBarIdx = 0;
curTrend = "";
if (aLLVBars[curBar] < aHHVBars[curBar])
curTrend = "D";
else
curTrend = "U";
/* *************************
Finding missed pivot(s)
************************* */
lastLPIdx = aLPivIdxs[0];
lastLPL = aLPivLows[0];
lastHPIdx = aHPivIdxs[0];
lastHPH = aHPivHighs[0];
/*
Note - I'm only interested in adding pivots if I'm in
a higher-highs or lower-lows scenario
*/
// -- OK, let's start where the last high pivot occurs after the
// last Low pivot
if (lastHPIdx > lastLPIdx) {
/* ****************************************************************
Still finding missed pivot(s). Here, the last piv is a low piv.
**************************************************************** */
} else {
/* ****************************************
// -- Done with finding pivots
***************************************** */
if (bDraw) {
/* ****************************************
// -- Done with discovering and plotting pivots
***************************************** */
minRtrc = 0;
maxRtrc = 0;
minLine = 0;
maxLine = 0;
triggerLine = 0;
firstProfitLine = 0;
triggerInc = 0;
triggerPrc = 0;
firstProfitPrc = 0;
retrcPrc = 0;
retrcBar = 0;
retrcBarIdx = 0;
retrcRng = 0;
aRetrcPrc = H-H;
aRetrcPrcBars = H-H;
aRetrcClose = C;
retrcClose = 0;
tcz500 =
(aHPivHighs[0] -
(.5 * (aHPivHighs[0] - aLPivLows[1])));
tcz618 =
(aHPivHighs[0] -
(.618 * (aHPivHighs[0] - aLPivLows[1])));
tcz786 =
(aHPivHighs[0] -
(.786 * (aHPivHighs[0] - aLPivLows[0])));
retrcRng = curBar - aHPivIdxs[0];
aRetrcPrc = LLV(L, retrcRng);
aRetrcPrcBars = LLVBars(L, retrcRng);
retrcPrc = aRetrcPrc[curBar];
retrcBarIdx = curBar - aRetrcPrcBars[curBar];
retrcClose = aRetrcClose[retrcBarIdx];
// -- bTCZLong setup?
bTCZLong = (
tcz500 =
(aHPivHighs[1] -
(.5 * (aHPivHighs[1] - aLPivLows[0])));
tcz618 =
(aHPivHighs[0] -
(.618 * (aHPivHighs[1] - aLPivLows[0])));
tcz786 =
(aHPivHighs[0] -
(.786 * (aHPivHighs[0] - aLPivLows[0])));
bTCZShort = (
// -- Are retracement levels arranged in
// tcz order?
/*
if (bShowTCZ) {
Plot(
LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]),
tcz500, curBar, tcz500 , 0),
"tcz500", colorPaleBlue, styleLine);
Plot(
LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]),
tcz618, curBar, tcz618, 0),
"tcz618", colorPaleBlue, styleLine);
Plot(
LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]),
tcz786, curBar, tcz786, 0),
"tcz786", colorTurquoise, styleLine);
}
*/
// -- if (bShowTCZ)
}
if (bDraw) {
Title = Name() + " (" + StrLeft(FullName(), 10) +
") ATR: " + NumToStr(ATR(1), 4.2) + " ( " +
NumToStr((C - Ref(C, -1)), 4.2) + " / " +
NumToStr((((C - Ref(C, -1)) / Ref(C, -1)) * 100), 2.1) + "% ) " +
WriteVal( SelectedValue( DateTime() ), formatDateTime) +
" \nO: " + Open +
", \nH: " + High +
", \nL: " + Low +
", \nC: " + Close + ", \n" +
// "Risk: " + WriteVal(risk, 2.1) + "% \n" +
"Rtrc 0/1 Pts: " + WriteVal(nRtrc0Pts, 2.1) + "/" +
WriteVal(nRtrc1Pts, 2.1) + " \n" +
"Rtrc 0/1 Bars: " + WriteVal(nRtrc0Bars, 2.0) + "/" +
WriteVal(nRtrc1Bars, 2.0);
}
////////////////////////
num = Param("trend",3,1,6,1);
for( b = Firstvisiblebar + num; b <= Lastvisiblebar AND b < BarCount - num; b++)
{
i = num;
ml = 0;
mu = 0;
while( i > 0 )
{
if (L[b] <= L[b-i] && L[b] <= L[b+i] )
{
ml++;
}
if (H[b] >= H[b-i] && H[b] >= H[b+i] )
{
mu++;
}
i--;
}
if ( ml == num )
{
PlotText("***",b,L[b],colorGreen);
}
if ( mu == num )
{
PlotText("***",b,H[b],colorRed);
}
}
_SECTION_END();
SetChartOptions(0,chartShowArrows|chartShowDates);
/*
SetChartBkGradientFill(ParamColor("Top", colorTeal), ParamColor("Bottom",
colorLightGrey), ParamColor("Title", colorDarkOliveGreen));
SetChartBkColor(colorTeal);*/
SetChartOptions(0,chartShowArrows | chartShowDates);
P = ParamField("Price field",-1);
Length = 150;
x = Cum(1);
lastx = LastValue( x ) - shift;
aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) );
bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) );
y = Aa + bb * ( x - (Lastx - DaysBack +1 ) );
LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null );
LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null );
Pi = 3.14159265 * atan(1); // Pi
SlopeAngle = atan(bb)*(180/Pi);
/*
if(LineUp)
{
Plot(LRLine, "Lin. Reg. Line Up", IIf(LineUp, colorBrightGreen, colorWhite),
LRStyle);
}
else
{
Plot(LRLine, "Lin. Reg. Line Down", IIf(LineDn, colorDarkRed, colorWhite),
LRStyle);
}
*/
SDP = Param("Standard Deviation", 1.5, 0, 6, 0.1);
SD = SDP/2;
/*
Plot( SDU , "Upper Lin Reg", colorWhite,SDStyle ); //Inside Regression Lines
Plot( SDL , "Lower Lin Reg", colorWhite,SDStyle ); //Inside Regression Lines
*/
/*
Plot( SDU2 , "Upper Lin Reg", colorWhite,SDStyle2 );
Plot( SDL2 , "Lower Lin Reg", colorWhite,SDStyle2 );
*/
Trend = IIf(LRLine > Ref(LRLine,-1),colorGreen,colorRed);
_SECTION_BEGIN("Haiken");
Prd1=Param("ATR Period",4,1,20,1);
Prd2=Param("Look Back",7,1,20,1);
green = HHV(LLV(L,Prd1)+ATR(Prd1),Prd2);
red = LLV(HHV(H,Prd1)-ATR(Prd1),Prd2);
if(Show_color)
{
ColorHighliter = myColor;
SetBarFillColor( ColorHighliter );
}
//////////
m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
mycolor=IIf(m1<0 AND m1>s1, ColorRGB(230,230,0),IIf(m1>0 AND
m1>s1,ColorRGB(0,0,100),IIf(m1>0 AND m1<s1,colorOrange,colorDarkRed)));
if(Show_color)
{
ColorHighliter = mycolor;
SetBarFillColor( ColorHighliter );
}
/*
if( ParamToggle("Plot Normal Candle", "No,Yes", 1 ) )
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, " " , barcolor, styleCandle |
styleThick );
else
PlotOHLC( Open, High, Low, Close, " " , barcolor2, styleCandle | styleThick );
*/
_SECTION_END();
_SECTION_BEGIN("Line");
a = Param("Average Pds", 5, 1, 10, 1 );
n = Param("Short Pds", 8, 5, 21, 1 );
m = Param("Long Pds", 60, 0, 90, 1 );
Var4 =(Low+High+2*Close)/4;
OP = EMA(Var4,a);
res1 = HHV(OP,n);
res2 =HHV(OP,m);
sup2 =LLV(OP,m);
sup1 =LLV(OP,n);
Linecolor = IIf(Op==sup1,colorCustom12,IIf(Op==res1,10,7));
_SECTION_BEGIN("Rays1");
line=ParamToggle("Line","No|Yes",1);
if(line)
{
Pp1=Param("Ray_Period1",3,1,20,1);
Pp2=Param("ATR_Period1",4,1,20,1);
Cal=HHV(LLV(HaHigh,Pp1)-ATR(Pp2),5);
positive= Cross(HaClose,Cal);
negative=Cross(Cal,HaClose);
_SECTION_END();
_SECTION_BEGIN("OsSetting");
if(Ovos)
{
//PlotShapes (IIf(Oversold, shapeHollowSmallCircle, shapeNone) ,38, layer = 0,
yposition = haLow, offset = -8 );
//PlotShapes (IIf(Overbought, shapeHollowSmallCircle, shapeNone) ,colorBrown, layer
= 0, yposition = haHigh, offset = 7 );
}
_SECTION_END();
_SECTION_BEGIN("TSKPPIVOT");
CHiPr = 0;
CLoPr = 9999999;
blsLong = 0;
PrevCOBar = 0;
NumBars = 0;
PrePP = 0;
PrevLowVal = 9999999;
BuySig = 0;
blsShort = 0;
PrevHiVal = 0;
blsNewCO = 0;
BarDif = 0;
KPA900Val = E_TSKPA900(Close);
KPAutoStopVal = E_TSKPAUTOSTOP(High,Low,Close);
if ( curBar == 0 )
{
CHiPr = haHigh[curBar];
CHiBar = curBar;
CLoPr = haLow[curBar];
CLoBar = curBar;
blsLong = 0;
blsShort = 0;
blsNewCO = 0;
PrePP = 0;
PrevCOBar = 0;
PrevHiVal = haHigh[curBar];
PrevLowVal = haLow[curBar];
BuySig = 0;
SellSig = 0;
blsLL = 0;
}
_SECTION_END();
_SECTION_BEGIN("TSKPMoMo");
blsLong = 0;
KPStopLine = E_TSKPSTOPLINE(High,Low,Close);
// tskp_upsell, tskp_triggerline, tskp_triggerlinevma
sw = E_TSKPUPSELL(Open,High,Low,Close,Volume);
KPTriggerLine = tskp_triggerline;
KPFast3Val = IIf((E_TSKPFAST3(Open,High,Low,Close,Volume)> 0),1, -1);
//tskp_fast2val1, tskp_fast2val2
dummy = E_TSKPFAST2(Open,High,Low,Close,Volume);
KPFast2Val = IIf ((tskp_fast2val1 > 0),1,-1);
Ctmpl = E_TSKPCOLORTMPL(Open,High,Low,Close,Volume);
sctotal = 0;
sctotal = sctotal + IIf(tskp_colortmplcnd0 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd1 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd2 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd3 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd4 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd5 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd6 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd7 > 0, 1, -1);
sctotal = sctotal + IIf(tskp_colortmplcnd8 > 0, 1, -1);
// tskp_mediumma,tskp_mediumup,tskp_mediumdown
dummy = E_TSKPMEDIUM(Close);
KPMediumUP = tskp_mediumup;
KPMediumDwn = tskp_mediumdown;
KPMediumMA = tskp_mediumma;
_SECTION_END();
_SECTION_BEGIN("Pivot");
nBars = Param("Number of bars", 12, 3, 40);
LP=Param("LookBack Period",150,1,500,1);
bShowTCZ = Param("Show TCZ", 0, 0, 1);
nExploreBarIdx = 0;
nExploreDate = 0;
nCurDateNum = 0;
DN = DateNum();
DT = DateTime();
bTCZLong = False;
bTCZShort = False;
nAnchorPivIdx = 0;
ADX8 = ADX(8);
if(Status("action")==1) {
bDraw = True;
bUseLastVis = 1;
} else {
bDraw = False;
bUseLastVis = False;
bTrace = 1;
nExploreDate = Status("rangetodate");
for (i=LastValue(BarIndex());i>=0;i--) {
nCurDateNum = DN[i];
if (nCurDateNum == nExploreDate) {
nExploreBarIdx = i;
}
}
}
if (bDraw) {
}
aHPivs = HaHigh - HaHigh;
aLPivs = HaLow - HaLow;
aHPivHighs = HaHigh - HaHigh;
aLPivLows = HaLow - HaLow;
aHPivIdxs = HaHigh - HaHigh;
aLPivIdxs = HaLow - HaLow;
aAddedHPivs = HaHigh - HaHigh;
aAddedLPivs = HaLow - HaLow;
aLegVol = HaHigh - HaHigh;
aRetrcVol = HaHigh - HaHigh;
nHPivs = 0;
nLPivs = 0;
lastHPIdx = 0;
lastLPIdx = 0;
lastHPH = 0;
lastLPL = 0;
curPivBarIdx = 0;
aHHVBars = HHVBars(HaHigh, nBars);
aLLVBars = LLVBars(HaLow, nBars);
aHHV = HHV(HaHigh, nBars);
aLLV = LLV(HaLow, nBars);
nLastVisBar = LastValue(
Highest(IIf(Status("barvisible"), BarIndex(), 0)));
curBar = IIf(nlastVisBar > 0 AND bUseLastVis, nlastVisBar,
IIf(Status("action")==4 AND nExploreBarIdx > 0, nExploreBarIdx,
LastValue(BarIndex())));
curTrend = "";
if (aLLVBars[curBar] < aHHVBars[curBar])
curTrend = "D";
else
curTrend = "U";
if (curBar >= LP) {
for (i=0; i<LP; i++) {
curBar = IIf(nlastVisBar > 0 AND bUseLastVis,
nlastVisBar-i,
IIf(Status("action")==4 AND nExploreBarIdx > 0,
nExploreBarIdx-i,
LastValue(BarIndex())-i));
if (aLLVBars[curBar] < aHHVBars[curBar]) {
if (curTrend == "U") {
curTrend = "D";
curPivBarIdx = curBar - aLLVBars[curBar];
aLPivs[curPivBarIdx] = 1;
aLPivLows[nLPivs] = HaLow[curPivBarIdx];
aLPivIdxs[nLPivs] = curPivBarIdx;
nLPivs++;
}
} else {
if (curTrend == "D") {
curTrend = "U";
curPivBarIdx = curBar - aHHVBars[curBar];
aHPivs[curPivBarIdx] = 1;
aHPivHighs[nHPivs] = HaHigh[curPivBarIdx];
aHPivIdxs[nHPivs] = curPivBarIdx;
nHPivs++;
}
}
}
}
curBar =
IIf(nlastVisBar > 0 AND bUseLastVis,
nlastVisBar,
IIf(Status("action")==4 AND nExploreBarIdx > 0,
nExploreBarIdx,
LastValue(BarIndex()))
);
if (nHPivs >= 2 AND nLPivs >= 2) {
lastLPIdx = aLPivIdxs[0];
lastLPL = aLPivLows[0];
lastHPIdx = aHPivIdxs[0];
lastHPH = aHPivHighs[0];
nLastHOrLPivIdx = Max(lastLPIdx, lastHPIdx);
nAddPivsRng = curBar - nLastHOrLPivIdx;
aLLVAfterLastPiv = LLV(HaLow, nAddPivsRng);
nLLVAfterLastPiv = aLLVAfterLastPiv[curBar];
aLLVIdxAfterLastPiv = LLVBars(HaLow, nAddPivsRng);
nLLVIdxAfterLastPiv = curBar - aLLVIdxAfterLastPiv[curBar];
aHHVAfterLastPiv = HHV(HaHigh, nAddPivsRng);
nHHVAfterLastPiv = aHHVAfterLastPiv[curBar];
aHHVIdxAfterLastPiv = HHVBars(HaHigh, nAddPivsRng);
nHHVIdxAfterLastPiv = curBar - aHHVIdxAfterLastPiv[curBar];
if (lastHPIdx > lastLPIdx) {
aLPivs[nLLVIdxAfterLastPiv] = 1;
aAddedLPivs[nLLVIdxAfterLastPiv] = 1;
} else {
/* ****************************************************************
Still finding missed pivot(s). Here, the last piv is a low piv.
**************************************************************** */
} else {
aHPivs[nHHVIdxAfterLastPiv] = 1;
aAddedHPivs[nHHVIdxAfterLastPiv] = 1;
} else {
aHPivs[nHHVIdxAfterLastPiv] = 1;
aAddedHPivs[nHHVIdxAfterLastPiv] = 1;
for (j=0; j<nHPivs; j++) {
aHPivHighs[nHPivs-j] = aHPivHighs[nHPivs-(j+1)];
aHPivIdxs[nHPivs-j] = aHPivIdxs[nhPivs-(j+1)];
}
aHPivHighs[0] = nHHVAfterLastPiv;
aHPivIdxs[0] = nHHVIdxAfterLastPiv;
nHPivs++;
/* ****************************************
// -- Done with finding pivots
***************************************** */
if (bDraw) {
risk = 0;
profInc = 0;
nLeg0Pts = 0;
nLeg0Bars = 0;
nLeg0Vol = 0;
nLeg1Pts = 0;
nLeg1Bars = 0;
nLeg1Vol = 0;
nLegBarsDiff = 0;
nRtrc0Pts = 0;
nRtrc0Bars = 0;
nRtrc0Vol = 0;
nRtrc1Pts = 0;
nRtrc1Bars = 0;
nRtrc1Vol = 0;
minRtrc = 0;
maxRtrc = 0;
minLine = 0;
maxLine = 0;
triggerLine = 0;
firstProfitLine = 0;
triggerInc = 0;
triggerPrc = 0;
firstProfitPrc = 0;
retrcPrc = 0;
retrcBar = 0;
retrcBarIdx = 0;
retrcRng = 0;
aRetrcPrc = HaHigh-HaHigh;
aRetrcPrcBars = HaHigh-HaHigh;
aRetrcClose = HaClose;
retrcClose = 0;
tcz500 =
(aHPivHighs[0] -
(.5 * (aHPivHighs[0] - aLPivLows[1])));
tcz618 =
(aHPivHighs[0] -
(.618 * (aHPivHighs[0] - aLPivLows[1])));
tcz786 =
(aHPivHighs[0] -
(.786 * (aHPivHighs[0] - aLPivLows[0])));
retrcPrc = aRetrcPrc[curBar];
retrcBarIdx = curBar - aRetrcPrcBars[curBar];
retrcClose = aRetrcClose[retrcBarIdx];
bTCZLong = (
tcz500 =
(aHPivHighs[1] -
(.5 * (aHPivHighs[1] - aLPivLows[0])));
tcz618 =
(aHPivHighs[0] -
(.618 * (aHPivHighs[1] - aLPivLows[0])));
tcz786 =
(aHPivHighs[0] -
(.786 * (aHPivHighs[0] - aLPivLows[0])));
bTCZShort = (
if (bTCZShort OR bTCZLong) {
if (bTCZShort) {
if (aLPivIdxs[0] > aHPivIdxs[0]) {
if (bShowTCZ) {
Plot(
LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]),
tcz500, curBar, tcz500 , 0),
"tcz500", colorPaleBlue, styleLine);
Plot(
LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]),
tcz618, curBar, tcz618, 0),
"tcz618", colorPaleBlue, styleLine);
Plot(
LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]),
tcz786, curBar, tcz786, 0),
"tcz786", colorTurquoise, styleLine);
}
}
_SECTION_END();
W52_High=WriteVal(HHV(H,260),1.2);
W52_Low=WriteVal(LLV(L,260),1.2);
Cg = Foreign("DSEX", "C");
Cgo= Ref(Cg,-1);
xChange1=Cg - Ref(Cg,-1);
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;
mBull = C >WMA(C,50);
mBear= C <WMA(C,50);
sBull = C >WMA(C,15);
sBear= C <WMA(C,15);
//--------------------------------------------------------
//Long-term Price Trend(LTPT)
rc= C > EMA (C,50) AND C < EMA(C,200) AND EMA(C,50) < EMA(C,200);
ac= C > EMA (C,50) AND C > EMA(C,200) AND EMA(C,50) < EMA(C,200);
bl= C > EMA (C,50) AND C > EMA(C,200) AND EMA(C,50) > EMA(C,200);
wr= C < EMA (C,50) AND C > EMA(C,200) AND EMA(C,50) > EMA(C,200);
ds= C < EMA (C,50) AND C < EMA(C,200) AND EMA(C,50) > EMA(C,200);
br= C < EMA (C,50) AND C < EMA(C,200) AND EMA(C,50) < EMA(C,200);
//------------------------
//Trend Strength
_SECTION_BEGIN("JSB_Pic_DMX_3");
SetBarsRequired(100000, 100000);
JSB_InitLib();
_SECTION_END();
_SECTION_BEGIN("Breakout Setting");
Buyperiods=Param("Breakout periods",5,1,100,1,1);
BuyBreakout= C>Ref(HHV(H,Buyperiods),-1);
_SECTION_END();
//------------------------------------------------------------
//PriceSmoothing -T3
TBuy = Cross (T3(C,3), T3(C,5));
TSell = Cross (T3(C,5), T3(C,3));
TBuy = ExRem(TBuy, TSell);
TSell = ExRem(TSell, TBuy);
T33 = T3(C,3) > T3(C,5);
T333 = T3(C,3) < T3(C,5);
//Stochastics Part
StochKval = StochK(10,5);
StochDval = StochD(10,5,5);
StBuy=StochK(10,5)>StochD(10,5,5);
StSell=StochK(10,5)<StochD(10,5,5);
///////////////////////////
_SECTION_END();
//-----------------------------------------------------------------------------
orBuy=AscCrossPrediction;
orSell=DescCrossPrediction;
orBuy1=(C>tClose);
orSell1=(tClose>C);
_SECTION_END();
Vol=(ROC(V,1));
CP=(ROC(C,1));
C1 = Ref(C, -1);
uc = C > C1; dc = C <= C1;
ud = C > O; dd = C <= O;
}
if(bullvolume AND !OscillatorOnly){
}
if(bearvolume AND !OscillatorOnly){
}
if(totalVolume AND !OscillatorOnly){
}
if(bullvolume AND !OscillatorOnly){
}
if(bearvolume AND !OscillatorOnly){
}
_SECTION_END();
_SECTION_BEGIN("Haiken-Ashi");
_SECTION_END();
_SECTION_BEGIN("Commentary");
Vpc= utbar OR utcond1 OR utcond2 OR utcond3 OR stdn0 OR stdn1 OR stdn2 OR stdn OR
lvtbar1 OR Lvtbar OR Lvtbar2 OR Hutbar OR Hutcond OR ndbar OR stvol OR tcbar;
WriteIf(nsbar,"No Supply. A no supply bar indicates supply has been removed and the
Smart money can markup the price. It is better to wait for confirmation","")+
WriteIf(stvol,"Stopping Volume. This will be an downbar during a bearish period
closing towards the Top accompanied by High volume.
A stopping Volume normally indicates that smart money is absorbing the supply which
is a Indication that they are Bullishon the MArket.
Hence we Can expect a reversal in the down trend. ","")+
WriteIf(ndbar, "No Demand
Brief Description:
Any up bar which closes in the middle OR Low, especially if the Volume has fallen
off,
is a potential sign of weakness.
//=====================================================================
//background stock name (works only on Amibroker version 5.00 onwards.
//=====================================================================
_SECTION_BEGIN("StocKanalysisBd");
mabBuy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1));
mabSell=Cross (EMA(EMA(C,13),9),EMA(C,13));
mabBuy1= EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1);
mabSell1 =EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1);
_SECTION_END();
//------------------------------------------------------------------------------
//WEEKLY TREND
weeklyprice=C;
Weekly=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),WeeklyPrice);
_SECTION_BEGIN("Weekly_trend-mrtq13");
Prd1=Param("Weekly_Period1",3,1,200,1);
Prd2=Param("Weekly_Period2",5,1,200,1);
TimeFrameSet (inWeekly);
TM = T3 ( Close , Prd1 ) ;
TM2 = T3 ( Close , Prd2 ) ;
UTM = IIf(Close>TM AND Close<TM2,8,
IIf(Close>TM AND Close>TM2,5,
IIf(Close<TM AND Close>TM2,13,
IIf(Close<TM AND Close<TM2,4,2))));
_SECTION_END();
//Pivot Cal
S1 = (Pp * 2) - High;
S2 = (Pp - High) + Low;
S3 = S1 - (High-Low);
_SECTION_BEGIN("Spiker_Shadow");
C1 = Ref(C, -1);
uc = C > C1; dc = C <= C1;
ud = C > O; dd = C <= O;
_SECTION_END();
_SECTION_BEGIN("VSA StocKanalysisBd");
Pp1=Param("NumberOfDays",30,1,200,1);
Pp2=Param("VolOfDays",15,1,200,1);
numDays = Pp1;
dwWideSpread = 1.8;
dwNarrowSpread = 0.8;
dwSpreadMiddle = 0.5;
dwHighClose = 0.7;
dwLowClose = 0.3;
volNumDays = Pp2;
dwUltraHighVol = 2;
dwVeryHighVol = 1.75; // was 1.8
dwHighVol = 1.75; // was 1.8
dwmoderateVol = 1.10; // was 1.8
dwLowVol = 0.75; // was 0.8
upThrustBar = downClose AND H > Ref(H,-1) AND (C == L) AND downClose AND (NOT
narrowRange);
noDemandBar = narrowRange AND LowVolume AND upBar AND (NOT upClose);
//noDemandBar = narrowRange AND LowVolume AND upBar AND (V < Ref(V,-1)) AND (V <
Ref(V,-2));
noSupplyBar = narrowRange AND LowVolume AND downBar AND (V < Ref(V,-1)) AND (V <
Ref(V,-2));
absorption = Ref(downbar, -1) AND Ref(highVolume, -1) AND upBar;
support = Ref(downBar,-1) AND (NOT Ref(downClose,-1)) AND Ref(highVolume,-1) AND
upBar;
stoppingVolume = Ref(downBar,-1) AND Ref(highVolume,-1) AND C > testCloseMiddle AND
(NOT downBar);
bullishsign=moderateVol+UpThrustBar;
weakness = upThrustBar OR noDemandBar OR
(narrowRange AND (H > Ref(H,-1)) AND highVolume) OR
(Ref(highVolume,-1) AND Ref(upBar,-1) AND downBar AND (H < Ref(H,-1)));
_SECTION_END();
_SECTION_BEGIN("Pivot Box");
Hi=Param("High_Period",7,1,50,1);
Lo=Param("Low_Period",7,1,50,1);
A1=ExRemSpan(Ref(High,-2)==HHV(High,Hi),3);
A2=ExRemSpan(Ref(Low,-2)==LLV(Low,Lo),3);
A3=Cross(A1,0.9);
A4=Cross(A2,0.9);
TOP=Ref(haHigh,-BarsSince(A3));
YY1=TOP;
bot=Ref(haLow,-BarsSince(A4));
XX1=bot;
HIVg=Ref(HHV(High,33),1);
LIVg=Ref(LLV(Low,33),1);
Hchg=(C-HIVg)/HIVg*100;
Lchg=(C-LIVg)/LIVg*100;
Echg=(HIVg-C)/C*100;
_SECTION_END();
_SECTION_BEGIN("Trend");
// Trend Detection
for(i=1;i<BarCount;i++)
{
if( CondR[i] )
{
R[i] = 1;
}
else
{
if( CondF[i] )
{
R[i] = 0;
}
else
{
R[i] = R[i-1];
}
}
}
return R;
}
PrD = C;
PrL = H/2+L/2;
PrdD = PrdL = PrdM = Param("Prd",12,2,40,1);
permax = Max(prdd,prdl);
Confirm = MA(C,prdm);
for(i=1;i<BarCount;i++)
{
if( dr[i-1] && df[i] )
{
B[i] = 1;
}
else
{
if( df[i-1] && dr[i] )
{
B[i] = 1;
}
else
{
B[i] = B[i-1] + 1;
}
}
}
return B;
}
Bs = DirBar( Rs, Fs );
Direction = ROC(Confirm,1) > 0 AND ROC(Confirm,5) > 0;
Downward = ROC(Confirm,1) < 0 AND ROC(Confirm,5) < 0;
_SECTION_END();
Chg=Ref(C,-1);
+WriteIf(Rs,EncodeColor(colorBrightGreen)+"UP",WriteIf(Fs,EncodeColor(colorRed)
+"Down","Neutral"))
+"\n"+EncodeColor(colorPink)+"---------------------------------------- "
+"\n"+EncodeColor(47)+"Signal(IBuy): " + WriteIf(Ibuy,EncodeColor(colorBrightGreen)
+"BuyWarning",WriteIf(Isell,EncodeColor(colorRed)
+"SellWarning",WriteIf(BlRSI,EncodeColor(colorBrightGreen)
+"BullishZone",WriteIf(BrRSI,EncodeColor(colorRed)+"BearishZone","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(T3) : " +
WriteIf(TBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(TSell,EncodeColor(colorRed)
+"Sell",WriteIf(T33,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(T333,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(ZLW) : " +
WriteIf(ZBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(ZSell,EncodeColor(colorRed)
+"Sell",WriteIf(ZBuy1,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(ZSell1,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(Mab) : " +
WriteIf(mabBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(mabSell,EncodeColor(colorRed)
+"Sell",WriteIf(mabBuy1,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(mabSell1,EncodeColor(47)+"Neutral",EncodeColor(colorRed)
+"Bearish"))))
+"\n"+EncodeColor(47)+"Signal(TMA) : " +
WriteIf(TMBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(TMSell,EncodeColor(colorRed)
+"Sell",WriteIf(TMBuy1,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(TMSell1,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(T3-RSI) : " +
WriteIf(TillsonBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(TillsonSell,EncodeColor(colorRed)+"Sell",
WriteIf(TB,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(TS,EncodeColor(colorRed)
+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(ADX) : " +
WriteIf(adxBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(adxSell,EncodeColor(colorRed)
+"Sell",WriteIf(adxBuy1,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(adxSell1,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(MACD) : " + WriteIf(MB,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(MS,EncodeColor(colorRed)
+"Sell",WriteIf(MB1,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(MS1,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(Stoch) : " +
WriteIf(StochBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(StochSell,EncodeColor(colorRed)
+"Sell",WriteIf(StBuy,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(StSell,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(TM) : "+ WriteIf(orBuy,EncodeColor(colorBrightGreen)
+"Buy",WriteIf(orSell,EncodeColor(colorRed)
+"Sell",WriteIf(orBuy1,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(orSell1,EncodeColor(colorRed)+"Bearish","Neutral"))))
+"\n"+EncodeColor(47)+"Signal(P5/15):" +
WriteIf(Buybreakout,EncodeColor(colorBrightGreen)
+"BreakOut1",WriteIf(Buybreakout2>Buybreakout,EncodeColor(colorBrightGreen)
+"BreakOut2","Neutral"))
+"\n"+EncodeColor(47)+"Signal(B):"+WriteIf(C>YY1,EncodeColor(colorBrightGreen)
+"BreakOut",WriteIf(C<XX1,EncodeColor(colorRed)+"BreakDown","Neutral"))
+"\n"+EncodeColor(colorPink)+"----------------------------------------"
+"\n"+EncodeColor(07)+"Volume: "+WriteIf(V>Vp2,EncodeColor(colorLime)+"Very
High",WriteIf(V>Vp1,EncodeColor(colorLime)+"
High",WriteIf(V>Vrg,EncodeColor(colorLime)+"Above Average",
WriteIf(V<Vrg AND V>Vn1,EncodeColor(colorRed)+"Less than
Average",WriteIf(V<Vn1,EncodeColor(colorRed)+"Low","")))))
+"\n"+EncodeColor(colorYellow)+"Spread: "+WriteIf(rg
>(arg*2),EncodeColor(colorLime)+" Wide",WriteIf(rg>arg,EncodeColor(colorLime)+"
Above Average",EncodeColor(colorRed)+" Narrow"))
+"\n"+(EncodeColor(colorYellow)+"Close: ")+WriteIf(Vhcls,EncodeColor(colorLime)
+"Very High",WriteIf(ucls,EncodeColor(colorLime)
+"High",WriteIf(mcls,EncodeColor(colorYellow)+"Mid",
WriteIf(dcls,EncodeColor(colorRed)+"Down","Very Low"))))
+"\n"+
EncodeColor(colorYellow) + "Status : " +
WriteIf(Weakness , EncodeColor(colorRed) + "Weak",
WriteIf(stoppingVolume , EncodeColor(colorCustom12) + "StoppingVol",
WriteIf(noSupplyBar , EncodeColor(colorLightOrange) + "NoSupply",
WriteIf(support , EncodeColor(colorLightBlue) + "SupportVol",
WriteIf(noDemandBar , EncodeColor(colorPink) + "NoDemand",
WriteIf(absorption, EncodeColor(colorSkyblue) + "Absorption",
WriteIf(upThrustBar, EncodeColor(colorBlue) + "Upthrust",
WriteIf(bullishsign, EncodeColor(colorPaleGreen) + "STRONG",
EncodeColor(colorTan) + "Neutral")))))))) + " "
+"\n"+EncodeColor(colorPink)+"----------------------------------------"
+"\n"+EncodeColor(49)+"KeyReversal : " + WriteIf(Buyr,EncodeColor(colorBrightGreen)
+"ReverseUP",WriteIf(Sellr,EncodeColor(colorRed)+"ReverseDown","Flat"))
+"\n"+EncodeColor(49) +"Phaze(LTPT) : " +
WriteIf(rc,EncodeColor(26)+"Recovery",WriteIf(ac,EncodeColor(colorGreen)
+"Accumulation",WriteIf(bl,EncodeColor(colorBrightGreen)
+"Bullish",WriteIf(wr,EncodeColor(colorOrange)
+"Warning",WriteIf(ds,EncodeColor(colorRed)
+"Distribution",WriteIf(br,EncodeColor(colorRed)+"Bearish","Neutral"))))))
+"\n"+EncodeColor(49)+"PV BreakOut : " + WriteIf(HIV,EncodeColor(colorBrightGreen)
+"Positive",WriteIf(LIV,EncodeColor(colorRed)+"Negative","Neutral"))
+WriteIf(MAuv>MAdv,EncodeColor(10)+" :
BullVol",WriteIf(MAuv<MAdv,EncodeColor(10)+" : BearVol",": Neutral"))
+WriteIf(rising,EncodeColor(colorBrightGreen)+"
Rising",WriteIf(falling,EncodeColor(colorRed)+" Falling"," Flat"))
+"\n"+ EncodeColor(49) +"RSI: " +WriteIf(RSI(15)>30 AND
RSI(15)<70,EncodeColor(08),WriteIf(RSI(15)<30 ,EncodeColor(07),EncodeColor(04))) +
WriteVal(RSI(15),format=1.2)
+WriteIf(RSI(15)>30 AND RSI(15)<70," Range"+EncodeColor(08),WriteIf(RSI(15)<30 ,"
OverSold"+EncodeColor(07)," OverBought"+EncodeColor(04)))
+"\n"+EncodeColor(49)+"52 WHL: " + HIV1+" : "+LIV1+" -
"+WriteIf(H>HIV1,EncodeColor(colorBrightGreen)
+"High",WriteIf(L<LIV1,EncodeColor(colorRed)+"Low","Neutral"))
+"\n"+EncodeColor(49)+"HL:"+"("+pdyear1+" Yerars"+"):"+
HIV3+" :"+LIV3+"-"+WriteIf(H>HIV3,EncodeColor(colorBrightGreen)
+"High",WriteIf(L<LIV3,EncodeColor(colorRed)+"Low","Neutral"))
+"\n"+EncodeColor(colorRose)+"-------------------------------------------------"
+"\n"+EncodeColor(11)+"R1 "+StrFormat("%1.2f",R1)+" R2 "+StrFormat("%1.2f",R2)+" R3
"+StrFormat("%1.2f",R3)
+"\n"+EncodeColor(02)+"PivotPoint: "+StrFormat("%1.2f",Pp)
+"\n"+EncodeColor(colorCustom11)+"S1 "+StrFormat("%1.2f",S1)+" S2
"+StrFormat("%1.2f",S2)+" S3 "+StrFormat("%1.2f",S3)
+"\n"+EncodeColor(colorRose)+"===========================";
_SECTION_END();
_SECTION_BEGIN("Vol-Trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleNoLabel, -0.5, 100 );
Plot(V,"",IIf(C>O,colorGreen,IIf(C<O,4,7)),2|4|32768,5);
GfxSetOverlayMode(0);
GfxSelectFont("Tahoma", Status("pxheight")/36);
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( colorLightGrey );
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/15 );
GfxTextOut( "Md Rezaul Karim", Status("pxwidth")/2, Status("pxheight")/10 );
GfxSelectFont("Tahoma", Status("pxheight")/40 );
_SECTION_END();
// **************************
// END INDICATOR CODE
// **************************
HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
_SECTION_BEGIN("Resistance");
supres=ParamToggle("Sup_Res","No|Yes",1);
if(supres)
{
Prd1=Param("Res_Period1",2,0,200,1);
_SECTION_END();
_SECTION_BEGIN("Support");
//SP=L > Ref(L,-1) AND Ref(L,1) < L;//Peak
Prd2=Param("Sup_Period1",2,0,200,1);
//PKV5 = ValueWhen(PK,haHigh,5);//PeakValue5
//PKV6 = ValueWhen(PK,haHigh,6);//PeakValue6
_SECTION_BEGIN("Nirvana_mrtq13");
Var4 =(Low+High+2*Close)/4;
OP = EMA(Var4,a);
res1 = HHV(OP,n);
res2 =HHV(OP,m);
sup2 =LLV(OP,m);
sup1 =LLV(OP,n);
_SECTION_BEGIN("Flower");
Show_color = ParamToggle("Display CandleColor", "No|Yes", 1);
r1 = Param( "ColorFast avg", 5, 2, 200, 1 );
r2 = Param( "ColorSlow avg", 10, 2, 200, 1 );
r3 = Param( "ColorSignal avg", 5, 2, 200, 1 );
Prd1=Param("ATR Period",4,1,20,1);
Prd2=Param("Look Back",7,1,20,1);
green = HHV(LLV(L,Prd1)+ATR(Prd1),Prd2);
red = LLV(HHV(H,Prd1)-ATR(Prd1),Prd2);
flowerClose = EMA((Open+High+Low+Close)/4,3) ;
flowerOpen = EMA((Ref(Open,-1) + Ref(flowerClose,-1))/2,3);
Temp = Max(High, flowerOpen);
flowerHigh = EMA(Max(Temp, flowerClose),3);
Temp = Min(Low,flowerOpen);
flowerLow = EMA(Min(Temp, flowerClose),3);
m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
mycolor=IIf(m1<0 AND m1>s1, colorYellow,IIf(m1>0 AND
flowerClose),flowerHigh,flowerLow,IIf(flowerOpen<flowerClose, flowerClose,
_SECTION_END();
_SECTION_BEGIN("Breakout Setting");
Buyperiods=Param("Breakout periods best is usually 18",5,1,100,1,1);
Sellperiods=Param("Exit Breakout",5,1,100,1,1);
_SECTION_END();
_SECTION_BEGIN("Earth-2");
//Copyright 9Trading.com
trend = (5)*(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5))-
(3)*(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3))-
EMA(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3),2);
Buy1 = Cross(trend,5);
//PlotShapes( IIf( Buy1, shapeHollowSmallCircle, shapeNone ), colorWhite, layer =
0, yposition = HaLow, offset = -10 );
_SECTION_END();
_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
r4 = Param( "Wk slow", 17, 2, 200, 1 );
r5 = Param( "Wk fast", 8, 2, 200, 1 );
m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
mycolor=IIf(m1<0 AND m1>s1, colorDarkGreen,IIf(m1>0 AND m1>s1,colorGreen,IIf(m1>0
AND m1<s1,colorDarkRed,colorRed)));
_SECTION_BEGIN("Signals");
j1=Cross(m1,0);
_SECTION_END();
//#include <T3.AFL>;
_SECTION_BEGIN("PFE");
pds=10;
x=sqrt((ROC(C,9)*ROC(C,9))+100);
y=Sum(sqrt((ROC(C,1)* ROC(C,1))+1),pds);
z=(x/y);
pfe=EMA(IIf(C>Ref(C,-9),z,-z)*100,5);
RequestTimedRefresh( 0 );
GfxSelectFont( "Tahoma", 12, 120 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( rsiresult1 =="cu")
{
GfxSelectSolidBrush( ColorRGB(0,90,0) );
}
else
if ( rsiresult2 =="cd")
{
GfxSelectSolidBrush( ColorRGB(90,0,0));
else
if ( rsiresult2 =="")
{
GfxSelectSolidBrush( colorGrey40 );
GfxCircle( 800,90,50 );
_SECTION_END();
//GfxRoundRect( 15,305,135,215, 5, 5 );
GfxCircle( 800,90,70 );
_SECTION_END();
_SECTION_BEGIN("STC");
PF[0]=frac1[0];
PF[1]=frac1[1];
for (i = 2; i < BarCount; i++) {
PF[i]=PF[i-1]+(Factor*(frac1[i]-PF[i-1]));
}
//%FastK of PF
/*
Frac2=1;
Frac2 = IIf(Value4 > 0, ((PF - Value3) / Value4) * 100, Ref(FRAC2,-1));
*/
frac2[0]=0;
for (i = 1; i < BarCount; i++) {
if (Value4[i] > 0 ) {
frac2[i]=((PF[i] - Value3[i])/Value4[i])*100;
}
else {
frac2[i]=frac2[i-1];
}
}
//HT=ParamColor("HT", colorRed );
rsidn=pff <2;
rsiup=pff >98;
RequestTimedRefresh( 0 );
GfxSelectFont( "Tahoma", 12, 120 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( rsiresult1 =="cu")
{
GfxSelectSolidBrush( ColorRGB(0,120,0) );
}
else
if ( rsiresult2 =="cd")
{
GfxSelectSolidBrush( ColorRGB(120,0,0));
else
if ( rsiresult2 =="")
{
GfxSelectSolidBrush( colorGrey40 );
GfxCircle( 800,90,60 );
_SECTION_END();
_SECTION_BEGIN("rsi");
//HT=ParamColor("HT", colorRed );
rsidn=RSI(7) <30;
rsiup=RSI(7) >70;
RequestTimedRefresh( 0 );
GfxSelectFont( "Tahoma", 12, 120 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( rsiresult1 =="cu")
{
GfxSelectSolidBrush( ColorRGB(0,150,0) );
}
else
if ( rsiresult2 =="cd")
{
GfxSelectSolidBrush( ColorRGB(150,0,0));
else
if ( rsiresult2 =="")
{
GfxSelectSolidBrush( colorGrey40 );
GfxCircle( 800,90,50 );
_SECTION_END();
_SECTION_BEGIN("Rays");
//FT=ParamColor("FT", colorRed );
Pp1=3;
Pp2=2;
CS33=HHV(LLV(flowerHigh,Pp1)-ATR(Pp2),4);
CR33=HHV(LLV(flowerHigh,Pp1)-ATR(Pp2),5);
if ( ATRup =="atrup")
{
GfxSelectSolidBrush( ColorRGB(0,180,0) );
}
else
if (ATRdown =="atrdn")
{
GfxSelectSolidBrush( ColorRGB(180,0,0));
else
if ( ATRdown =="")
{
GfxSelectSolidBrush( colorGrey40 );
_SECTION_END();
_SECTION_BEGIN("Exit_Beast-3");
//GT=ParamColor("GT", colorRed );
EntrylookbackPeriod=10;
EntryATRperiod=1.9;
EntrySig = C > ( LLV( flowerLow, EntrylookbackPeriod ) + EntryATRperiod *
ATR( 10 ) );
ExitSig = C < ( HHV( flowerHigh, EntrylookbackPeriod ) -EntryATRperiod * ATR( 10 )
);
RequestTimedRefresh( 0 );
GfxSelectFont( "Tahoma", 12, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( EntryB =="eu")
{
GfxSelectSolidBrush( ColorRGB(0,210,0) ); //
}
else
if ( ExitB =="ed")
{
GfxSelectSolidBrush( ColorRGB(210,0,0)); //
else
if ( ExitB =="")
{
GfxSelectSolidBrush( colorGrey40 );
_SECTION_END();
_SECTION_BEGIN("CCI9-2");
//HT=ParamColor("HT", colorRed );
ccidn=CCI(8) < 0;
cciup=CCI(9) > 0;
RequestTimedRefresh( 0 );
GfxSelectFont( "Tahoma", 12, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( ccresult1 =="cu")
{
GfxSelectSolidBrush( ColorRGB(0,240,0) );
}
else
if ( ccresult2 =="cd")
{
GfxSelectSolidBrush( ColorRGB(240,0,0));
else
if ( ccresult2 =="")
{
GfxSelectSolidBrush( colorGrey40 );
_SECTION_END();
_SECTION_BEGIN("%BB7-1");
//IT=ParamColor("IT", colorRed );
p=7;
x=((C+2*StDev(C,p)-MA(C,p))/(4*StDev(C,p)))*100;
bbdown= x < 40;
bbup= x > 40;
RequestTimedRefresh( 0 );
GfxSelectFont( "Tahoma", 12, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( bbresult1 =="bu")
{
GfxSelectSolidBrush( ColorRGB(62,255,62) );
}
else
if ( bbresult2 =="bd")
{
GfxSelectSolidBrush( ColorRGB(255,62,62) );
else
if ( bbresult2 =="")
{
GfxSelectSolidBrush( colorGrey40 );
_SECTION_END();
_SECTION_BEGIN("TSKPPIVOT4");
CHiPr = 0;
CLoPr = 9999999;
blsLong = 0;
PrevCOBar = 0;
NumBars = 0;
PrePP = 0;
PrevLowVal = 9999999;
BuySig = 0;
blsShort = 0;
PrevHiVal = 0;
blsNewCO = 0;
BarDif = 0;
KPA900Val = E_TSKPA900(Close);
KPAutoStopVal = E_TSKPAUTOSTOP(High,Low,Close);
if ( curBar == 0 )
{
CHiPr = flowerHigh[curBar];
CHiBar = curBar;
CLoPr = flowerLow[curBar];
CLoBar = curBar;
blsLong = 0;
blsShort = 0;
blsNewCO = 0;
PrePP = 0;
PrevCOBar = 0;
PrevHiVal =flowerHigh[curBar];
PrevLowVal = flowerLow[curBar];
BuySig = 0;
SellSig = 0;
blsLL = 0;
}
PlotShapes(
IIf(aHPivs == 1,21,shapeNone),ColorRGB(255,0,145),0, aHiVal, offset = 5);
PlotShapes(IIf(aHPivs == 1, 15,shapeNone), ColorRGB(200,50,75),0, aHiVal,Offset =
5);
PlotShapes(IIf(aLPivs == 1, 21,shapeNone), ColorRGB(0,125,225),0, aLoVal, Offset =
-5);
PlotShapes(IIf(aLPivs == 1, 15,shapeNone), ColorRGB(0,125,255),0, aLoVal, Offset =
-5);
_SECTION_END();
_SECTION_BEGIN("Spiker_Shadow");
C1 = Ref(C, -1);
uc = C > C1; dc = C <= C1;
ud = C > O; dd = C <= O;
upshadow=ParamColor("UpShadowColor",colorDarkTeal );
downshadow=ParamColor("DownShadowColor",colorDarkGrey );
riseFallColor = IIf(rising, upshadow,downshadow);
_SECTION_END();
_SECTION_END();