BlueBerry 2011

#1
Before Please Download : http://www.dosya.tc/filess/qHmFPN/MurreyMath.rar.html

Extract zip file : MurreyMath.dll

and copy C:\Program Files\AmiBroker\Plugins Folder !!!!



SOYDAN BLUEBERRY 2011 Formula

_SECTION_BEGIN("Soydan Bluberry 2011");

////////////////////////////////////////////////////////////////////////////////
function IntPortion (Paramet) {
return IIf (Paramet > 0,floor (Paramet),ceil (Paramet));
};
Length=9;
Phase=0;
function JJMA(Array,Length,Phase)
{
fC0Buffer=fC8Buffer=fA8Buffer=0;
JMAValueBuffer=C;
JMAValue=0;
loopCriteria=cycleDelta=cycleLimit=counterA=counterB=JMATempValue=0;
ring2=0;
ring1=0;
buffer=0;
limitValue = 63;
startValue = 64;
for (i = 0; i <= limitValue; i++) list = -1000000;
for (i = startValue; i <= 127; i++) list = 1000000;
initFlag = True;
lengthParam=IIf (Length < 1.0000000002,0.0000000001,(Length - 1) / 2.0);
if (Phase < -100) phaseParam = 0.5;
else if (Phase > 100) phaseParam = 2.5;
else phaseParam = Phase / 100.0 + 1.5;
logParam = log (sqrt (lengthParam)) / log (2.0);
logParam=IIf ((logParam + 2.0) < 0,0,logParam + 2.0);
sqrtParam = sqrt(lengthParam) * logParam;
lengthParam = lengthParam * 0.9;
lengthDivider = lengthParam / (lengthParam + 2.0);
loopParam=0;
for (shift =0 ; shift <=BarCount-1; shift++) {
series = Close [shift];
if (loopParam < 61) {
loopParam++;
buffer [loopParam] = series;
}
if (loopParam > 30) {
if (initFlag) {
initFlag = False;
diffFlag = 0;
for (i = 1; i <= 29; i++) {
if (buffer [i + 1] != buffer ) diffFlag = 1;
}
highLimit = diffFlag * 30;
if (highLimit == 0) paramB = series;
else paramB = buffer[1];
paramA = paramB;
if (highLimit > 29) highLimit = 29;
} else
highLimit = 0;
for (i = highLimit; i >= 0; i--) {
if (i == 0) sValue = series; else sValue = buffer [31 - i];
if (abs (sValue - paramA) > abs (sValue - paramB)) absValue = abs(sValue - paramA); else absValue = abs(sValue - paramB);
dValue = absValue + 0.0000000001; //1.0e-10;
if (counterA <= 1) counterA = 127; else counterA--;
if (counterB <= 1) counterB = 10; else counterB--;
if (cycleLimit < 128) cycleLimit++;
cycleDelta = cycleDelta +(dValue - ring2 [counterB]);
ring2 [counterB] = dValue;
if (cycleLimit > 10) highDValue = cycleDelta / 10.0; else highDValue = cycleDelta / cycleLimit;
if (cycleLimit > 127) {
dValue = ring1 [counterA];
ring1 [counterA] = highDValue;
s68 = 64; s58 = s68;
while (s68 > 1) {
if (list [s58] < dValue) {
s68 = s68 / 2.0;
s58 = s58 + s68;
} else
if (list [s58] <= dValue) {
s68 = 1;
} else {
s68 = s68 / 2.0;
s58 = s58 - s68;
}
}
} else {
ring1 [counterA] = highDValue;
if ((limitValue + startValue) > 127) {
startValue--;
s58 = startValue;
} else {
limitValue++;
s58 = limitValue;
}
if (limitValue > 96) s38 = 96; else s38 = limitValue;
if (startValue < 32) s40 = 32; else s40 = startValue;
}
s68 = 64;
s60 = s68;
while (s68 > 1) {
if (list [s60] >= highDValue) {
if (list [s60 - 1] <= highDValue) {
s68 = 1;
}
else {
s68 = s68 / 2.0;
s60 = s60 - s68;
}
}
else {
s68 = s68 / 2.0;
s60 = s60 + s68;
}
if ((s60 == 127) && (highDValue > list[127])) s60 = 128;
}
if (cycleLimit > 127) {
if (s58 >= s60) {
if (((s38 + 1) > s60) && ((s40 - 1) < s60))
lowDValue = lowDValue + highDValue;
else if ((s40 > s60) && ((s40 - 1) < s58))
lowDValue = lowDValue + list [s40 - 1];
}
else if (s40 >= s60) {
if (((s38 + 1) < s60) && ((s38 + 1) > s58))
lowDValue = lowDValue + list[s38 + 1];
}
else if ((s38 + 2) > s60)
lowDValue = lowDValue + highDValue;
else if (((s38 + 1) < s60) && ((s38 + 1) > s58))
lowDValue = lowDValue + list[s38 + 1];

if (s58 > s60) {
if (((s40 - 1) < s58) && ((s38 + 1) > s58))
lowDValue = lowDValue - list [s58];
else if ((s38 < s58) && ((s38 + 1) > s60))
lowDValue = lowDValue - list [s38];
}
else {
if (((s38 + 1) > s58) && ((s40 - 1) < s58))
lowDValue = lowDValue - list [s58];
else if ((s40 > s58) && (s40 < s60))
lowDValue = lowDValue - list [s40];
}
}
if (s58 <= s60) {
if (s58 >= s60) list[s60] = highDValue; else {
for (j = s58 + 1; j <= (s60 - 1); j++) {
list [j - 1] = list[j];
}
list [s60 - 1] = highDValue;
}
} else {
for (j = s58 - 1; j >= s60; j--) {
list [j + 1] = list [j];
}
list [s60] = highDValue;
}

if (cycleLimit <= 127) {
lowDValue = 0;
for (j = s40; j <= s38; j++) {
lowDValue = lowDValue + list[j];
}
}
if ((loopCriteria + 1) > 31) loopCriteria = 31; else loopCriteria++;
JMATempValue=sqrtDivider = sqrtParam / (sqrtParam + 1.0);
if (loopCriteria <= 30) {
if (sValue - paramA > 0) paramA = sValue; else paramA = sValue - (sValue - paramA) * sqrtDivider;
if (sValue - paramB < 0) paramB = sValue; else paramB = sValue - (sValue - paramB) * sqrtDivider;
JMATempValue = series;
if (loopCriteria == 30) {
fC0Buffer [shift] = series;
if (ceil(sqrtParam) >= 1) intPart = ceil(sqrtParam); else intPart = 1;
leftInt = IntPortion (intPart);
if (floor(sqrtParam) >= 1) intPart = floor(sqrtParam); else intPart = 1;
rightPart = IntPortion (intPart);
if (leftInt == rightPart) dValue = 1.0;
else
dValue = (sqrtParam - rightPart) / (leftInt - rightPart);
if (rightPart <= 29) upShift = rightPart; else upShift = 29;
if (leftInt <= 29) dnShift = leftInt; else dnShift = 29;
fA8Buffer [shift] = (series - buffer [loopParam - upShift]) * (1 - dValue) / rightPart + (series - buffer[loopParam - dnShift]) * dValue / leftInt;
}
} else {
dValue = lowDValue / (s38 - s40 + 1);
if (0.5 <= logParam - 2.0) powerValue = logParam - 2.0;
else powerValue = 0.5;
if (logParam >= (absValue/dValue)^powerValue) dValue = (absValue/dValue)^powerValue; else dValue = logParam;
if (dValue < 1) dValue = 1;
powerValue = sqrtDivider^(sqrt (dValue));
if (sValue - paramA > 0) paramA = sValue; else paramA = sValue - (sValue - paramA) * powerValue;
if (sValue - paramB < 0) paramB = sValue; else paramB = sValue - (sValue - paramB) * powerValue;
}
}
if (loopCriteria > 30) {
JMATempValue = JMAValueBuffer [shift - 1];
powerValue = lengthDivider^dValue;
squareValue = powerValue^2;
fC0Buffer [shift] = (1 - powerValue) * series + powerValue * fC0Buffer [shift - 1];
fC8Buffer [shift] = (series - fC0Buffer [shift]) * (1 - lengthDivider) + lengthDivider * fC8Buffer [shift - 1];
fA8Buffer [shift] = (phaseParam * fC8Buffer [shift] + fC0Buffer [shift] - JMATempValue) *
(powerValue * (-2.0) + squareValue + 1) + squareValue * fA8Buffer [shift - 1];
JMATempValue = JMATempValue + fA8Buffer [shift];
}
JMAValue = JMATempValue;
}
if (loopParam <= 30) JMAValue = C[BarCount-1];
JMAValueBuffer [shift] = JMAValue;
}
return JMAValueBuffer;
}
//////////////////////////////////////////////////////////////////////////

// SABİTLER Başla //////////////////////////////////////////////////////////////////////////////
SetChartBkColor (ColorRGB(125,125,125));
SetBarsRequired(sbrAll,sbrAll);
SetChartOptions(0,chartShowDates);
GraphXSpace=7;

x = Cum(1); // Sonuncu Gnn Bar Değeri... Yani XU100 iin 3971.Bar
ToplamBar = LastValue(x) ; // Databasedeki Toplam Bar Sayısı
Indices = BarIndex(); // Bar Endeksi ve Bar sayımı iin kullanılan Fonksiyon..
Pi = 3.14159265; // Pi Sayısı
Rtd = 180 / Pi; // Radian Değeri Dereceye evirme Forml
Dtr = 1 / Rtd; // Dereceyi Radiana evirme Forml
UpAciDerecesi = Param("UP Aı Derecesi ??", 26.3, 0, 89.9 ,0.10); // Destek izgisi Pozitif Aı Değeri
DownAciDerecesi = Param("DOWN Aı Derecesi ??", 333.7, 270.1, 360 ,0.10); // Diren izgisi iin Negatif Aı Değeri
UpRadyanAci = UPAciDerecesi * Dtr; // Destek Aı Derecesini Radyan Değere evirdik
UpTanjant = tan(UPRadyanAci) ; // Destek Aının Tanjantını Aldık
DownRadyanAci = DownAciDerecesi * Dtr; // Diren Aı Derecesini Radyan Değere evirdik
DownTanjant = tan(DownRadyanAci) ; // Diren Aının Tanjantını Aldık
// SABİTLER Bitti //////////////////////////////////////////////////////////////////////////////

// Yatay Murrey MAth izgilieri Başla ///////////////////////////////////////////////////////
hts = -50; //Param ("Text Shift", -50,-50,50,0.10);
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);

//Murrey Math Lines Settings
frame = 64; //Param("MM Frame", 64, 4,512,4) ;
multiplier = 1; //Param("Multiplier", 1, 1,5,0.5) ;
//Murrey Math Time Lines Settings
StartMonth = 1;
StartDay = 1;
StartYear = 2000;

y=MML(frame);

Plot(Ln2,"-2/8",colorRed,styleDashed|styleNoTitle);
PlotText ("_ [-2/8] Extreme Overshoot __" , LastValue(BarIndex())-(numbars/hts), LastValue (Ln2),colorRed );

Plot(Ln1,"-1/8",colorOrange,styleDashed|styleNoTitle);
PlotText ("_ [-1/8] Overshoot __" , LastValue(BarIndex())-(numbars/hts), LastValue (Ln1),colorOrange );

Plot(L0,"0/8",colorBlue,styleDashed|styleNoTitle);
PlotText ("_ [0/8] Ultimate Support __" , LastValue(BarIndex())-(numbars/hts), LastValue (L0),colorBlue );

Plot(L1,"1/8",colorYellow,styleDashed|styleNoTitle);
PlotText ("_ [1/8] Weak Stall & Reverse __" , LastValue(BarIndex())-(numbars/hts), LastValue (L1),colorYellow );

Plot(L2,"2/8",colorPink,styleDashed|styleNoTitle);
PlotText ("_ [2/8] Pivot Reversal Major __" , LastValue(BarIndex())-(numbars/hts), LastValue (L2),colorPink );

Plot(L3,"3/8",colorLime,styleDashed|styleNoTitle);
PlotText ("_ [3/8] Bottom of Trading Range __" , LastValue(BarIndex())-(numbars/hts), LastValue (L3),colorLime );

Plot(L4,"4/8",colorBlue,styleDashed|styleNoTitle);
PlotText ("_ [4/8] Major Support/Resistance __" , LastValue(BarIndex())-(numbars/hts), LastValue (L4),colorBlue );

Plot(L5,"5/8",colorLime,styleDashed|styleNoTitle);
PlotText ("_ [5/8] Top of Trading Range __" , LastValue(BarIndex())-(numbars/hts), LastValue (L5),colorLime );

Plot(L6,"6/8",colorPink,styleDashed|styleNoTitle);
PlotText ("_ [6/8] Pivot Reversal Major __" , LastValue(BarIndex())-(numbars/hts), LastValue (L6),colorPink );

Plot(L7,"7/8",colorYellow,styleDashed|styleNoTitle);
PlotText ("_ [7/8] Weak Stall & Reverse __" , LastValue(BarIndex())-(numbars/hts), LastValue (L7),colorYellow );

Plot(L8,"8/8",colorBlue,styleDashed|styleNoTitle);
PlotText ("_ [8/8] Ultimate Resistance __" , LastValue(BarIndex())-(numbars/hts), LastValue (L8),colorBlue );

Plot(Lp1,"+1/8",colorOrange,styleDashed|styleNoTitle);
PlotText ("_ [+1/8] Overshoot __" , LastValue(BarIndex())-(numbars/hts), LastValue (Lp1),colorOrange );

Plot(Lp2,"+2/8",colorRed,styleDashed|styleNoTitle);
PlotText ("_ [+2/8] Extreme Overshoot __" , LastValue(BarIndex())-(numbars/hts), LastValue (Lp2),colorRed );

// Yatay Murrey MAth izgilieri Bitti ///////////////////////////////////////////////////////


//Destek Ve Diren izgileri BaşLıyor//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

XClose =JJMA(C,3,0);
XOpen = JJMA( Ref( XClose, -1 ), 0, 0.5 );
XHigh = Max( H, Max( XClose, XOpen ) );
XLow = Min( L, Min( XClose, XOpen ) );

test1 = TEMA ( XHigh , 2 ) ;
//Plot(test, "High Tema", colorGreen,styleDashed|styleNoLabel);

PK = test1 > Ref(test1,-1) AND Ref(test1,1) < High;
PKV0 = ValueWhen(PK,XHigh,0);
PKV1 = ValueWhen(PK,XHigh,1);
PKV2 = ValueWhen(PK,XHigh,2);
MPK = PKV2 < PKV1 AND PKV1 > PKV0 ;

MPKV1 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,1);
MPKD1 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),1);
R1 = IIf(DateNum() < LastValue(MPKD1,lastmode = True ), Null, LastValue(MPKV1));
//Plot(R1, "Direnc-1", colorRed,styleDashed|styleNoLabel);

MPKV2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,2);
MPKD2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),2);
R2 = IIf(DateNum() < LastValue(MPKD2,lastmode = 1 ), Null, LastValue(MPKV2));
//Plot(R2, "Direnc-2", colorDarkRed,styleDashed|styleNoLabel);

MPKV3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,3);
MPKD3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),3);
R3 = IIf(DateNum() < LastValue(MPKD3,lastmode = True ), Null, LastValue(MPKV3));
//Plot(R3, "Direnc-3", colorDarkRed, styleDashed|styleNoLabel);

MPKV4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,4);
MPKD4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),4);
R4 = IIf(DateNum() < LastValue(MPKD4,lastmode = True ), Null, LastValue(MPKV4));
//Plot(R4, "Direnc-4", colorDarkRed,styleDashed|styleNoLabel);

MPKV5 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,5);
MPKD5 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),5);
R5 = IIf(DateNum() < LastValue(MPKD5,lastmode = True ), Null, LastValue(MPKV5));
//Plot(R5, "Direnc-5", colorDarkRed,styleDashed|styleNoLabel);

MPKV6 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,6);
MPKD6 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),6);
R6 = IIf(DateNum() < LastValue(MPKD6,lastmode = True ), Null, LastValue(MPKV6));
//Plot(R6, "Direnc-6", colorDarkRed ,styleDots|styleNoLine|styleNoLabel);

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

test2 = TEMA ( XLow , 2 ) ;
//Plot(test2, "Low Tema", colorRed,styleDashed|styleNoLabel);

SP = Ref(test2,1) > Low AND test2 < Ref(test2,-1);
SPV0 = ValueWhen(SP,XLow,0);
SPV1 = ValueWhen(SP,XLow,1);
SPV2 = ValueWhen(SP,XLow,2);
MSP = SPV2 > SPV1 AND SPV1 < SPV0 ;

MSPV1 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,1);
MSPD1 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),1);
S1 = IIf(DateNum() < LastValue(MSPD1), Null, LastValue(MSPV1));
//Plot(S1,"Destek-1", colorGreen,styleDashed|styleNoLabel);

MSPV2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,2);
MSPD2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),2);
S2 = IIf(DateNum() < LastValue(MSPD2), Null, LastValue(MSPV2));
//Plot(S2,"Destek-2", colorDarkGreen,styleDashed|styleNoLabel);

MSPV3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,3);
MSPD3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),3);
S3 = IIf(DateNum() < LastValue(MSPD3), Null, LastValue(MSPV3));
//Plot(S3,"Destek-3", colorDarkGreen,styleDashed|styleNoLabel);

MSPV4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,4);
MSPD4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),4);
S4 = IIf(DateNum() < LastValue(MSPD4), Null, LastValue(MSPV4));
//Plot(S4,"Destek-4", colorDarkGreen,styleDashed|styleNoLabel);

MSPV5 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,5);
MSPD5 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),5);
S5 = IIf(DateNum() < LastValue(MSPD5), Null, LastValue(MSPV5));
//Plot(S5,"Destek-5", colorDarkGreen,styleDashed|styleNoLabel);

MSPV6 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,6);
MSPD6 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),6);
S6 = IIf(DateNum() < LastValue(MSPD6), Null, LastValue(MSPV6));
//Plot(S6,"Destek-6", colorDarkGreen,styleDots|styleNoLine|styleNoLabel);

//Aı izgileri BaşLıyor ///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
U1Bar = ValueWhen(Ref(MSP,-1) == False AND MSP == True, Indices+1, 1);
U1X = LastValue(ValueWhen(Ref(MSP,-1) == False AND MSP == True, x, 1));
U1 = LastValue(MSPV1);
U1Fark = ToplamBar - U1Bar ;
U1Tanjant = (U1Fark * Uptanjant) / 100;
U1TrendLine = ( U1 * U1Tanjant ) + U1 ;
U1Rakam = LastValue( ValueWhen( U1TrendLine, U1TrendLine) );
U1Destek= LastValue(ValueWhen( U1Trendline, x ));
U1Line =U1Destek - U1X;
U1AS = (U1Rakam - U1) / U1Line;
U1DestekLine = U1AS * ( x - U1Destek ) + U1Rakam;
UP1 = IIf (x > U1X-1, U1DestekLine,-1e10);
Up1Color=IIf( O > UP1, colorLime,colorDarkYellow );
Plot(UP1," Up1 ",Up1color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
U2Bar = ValueWhen(Ref(MSP,-1) == False AND MSP == True, Indices+1, 2);
U2X = LastValue(ValueWhen(Ref(MSP,-1) == False AND MSP == True, x, 2));
U2 = LastValue(MSPV2);
U2Fark = ToplamBar - U2Bar ;
U2Tanjant = (U2Fark * Uptanjant) / 100;
U2TrendLine = ( U2 * U2Tanjant ) + U2 ;
U2Rakam = LastValue( ValueWhen( U2TrendLine, U2TrendLine) );
U2Destek= LastValue(ValueWhen( U2Trendline, x ));
U2Line =U2Destek - U2X;
U2AS = (U2Rakam - U2) / U2Line;
U2DestekLine = U2AS * ( x - U2Destek ) + U2Rakam;
UP2 = IIf (x > U2X-1, U2DestekLine,-1e10);
Up2Color=IIf( O > UP2, colorLime,colorDarkYellow );
Plot(UP2," Up2 ",Up2color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
U3Bar = ValueWhen(Ref(MSP,-1) == False AND MSP == True, Indices+1, 3);
U3X = LastValue(ValueWhen(Ref(MSP,-1) == False AND MSP == True, x, 3));
U3 = LastValue(MSPV3);
U3Fark = ToplamBar - U3Bar ;
U3Tanjant = (U3Fark * Uptanjant) / 100;
U3TrendLine = ( U3 * U3Tanjant ) + U3 ;
U3Rakam = LastValue( ValueWhen( U3TrendLine, U3TrendLine) );
U3Destek= LastValue(ValueWhen( U3Trendline, x ));
U3Line =U3Destek - U3X;
U3AS = (U3Rakam - U3) / U3Line;
U3DestekLine = U3AS * ( x - U3Destek ) + U3Rakam;
UP3 = IIf (x > U3X-1, U3DestekLine,-1e10);
Up3Color=IIf( O > UP3, colorLime,colorDarkYellow );
Plot(UP3," Up3 ",Up3color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
U4Bar = ValueWhen(Ref(MSP,-1) == False AND MSP == True, Indices+1, 4);
U4X = LastValue(ValueWhen(Ref(MSP,-1) == False AND MSP == True, x, 4));
U4 = LastValue(MSPV4);
U4Fark = ToplamBar - U4Bar ;
U4Tanjant = (U4Fark * Uptanjant) / 100;
U4TrendLine = ( U4 * U4Tanjant ) + U4 ;
U4Rakam = LastValue( ValueWhen( U4TrendLine, U4TrendLine) );
U4Destek= LastValue(ValueWhen( U4Trendline, x ));
U4Line =U4Destek - U4X;
U4AS = (U4Rakam - U4) / U4Line;
U4DestekLine = U4AS * ( x - U4Destek ) + U4Rakam;
UP4 = IIf (x > U4X-1, U4DestekLine,-1e10);
Up4Color=IIf( O > UP4, colorLime,colorDarkYellow );
Plot(UP4," Up4 ",Up4color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
U5Bar = ValueWhen(Ref(MSP,-1) == False AND MSP == True, Indices+1, 5);
U5X = LastValue(ValueWhen(Ref(MSP,-1) == False AND MSP == True, x, 5));
U5 = LastValue(MSPV5);
U5Fark = ToplamBar - U5Bar ;
U5Tanjant = (U5Fark * Uptanjant) / 100;
U5TrendLine = ( U5 * U5Tanjant ) + U5 ;
U5Rakam = LastValue( ValueWhen( U5TrendLine, U5TrendLine) );
U5Destek= LastValue(ValueWhen( U5Trendline, x ));
U5Line =U5Destek - U5X;
U5AS = (U5Rakam - U5) / U5Line;
U5DestekLine = U5AS * ( x - U5Destek ) + U5Rakam;
UP5 = IIf (x > U5X-1, U5DestekLine,-1e10);
Up5Color=IIf( O > UP5, colorLime,colorDarkYellow );
Plot(UP5," Up5 ",Up5color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
U6Bar = ValueWhen(Ref(MSP,-1) == False AND MSP == True, Indices+1, 6);
U6X = LastValue(ValueWhen(Ref(MSP,-1) == False AND MSP == True, x, 6));
U6 = LastValue(MSPV6);
U6Fark = ToplamBar - U6Bar ;
U6Tanjant = (U6Fark * Uptanjant) / 100;
U6TrendLine = ( U6 * U6Tanjant ) + U6 ;
U6Rakam = LastValue( ValueWhen( U6TrendLine, U6TrendLine) );
U6Destek= LastValue(ValueWhen( U6Trendline, x ));
U6Line =U6Destek - U6X;
U6AS = (U6Rakam - U6) / U6Line;
U6DestekLine = U6AS * ( x - U6Destek ) + U6Rakam;
UP6 = IIf (x > U6X-1, U6DestekLine,-1e10);
Up6Color=IIf( O > UP6, colorLime,colorDarkYellow );
Plot(UP6," Up6 ",Up6color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
D1Bar = ValueWhen(Ref(MPK,-1) == False AND MPK == True, Indices+1, 1);
D1X = LastValue(ValueWhen(Ref(MPK,-1) == False AND MPK == True, x, 1));
D1 = LastValue(MPKV1);
D1Fark = ToplamBar - D1Bar ;
D1Tanjant = (D1Fark * Downtanjant) / 100;
D1TrendLine = ( D1 * D1Tanjant ) + D1 ;
D1Rakam = LastValue( ValueWhen( D1TrendLine, D1TrendLine) );
D1Direnc= LastValue(ValueWhen( D1Trendline, x ));
D1Line =D1Direnc - D1X;
D1AS = (D1Rakam - D1) / D1Line;
D1DirencLine = D1AS * ( x - D1Direnc ) + D1Rakam;
D1 = IIf (x > D1X-1, D1DirencLine,-1e10);
D1Color=IIf( C < D1, colorRed,colorDarkYellow );
Plot(D1," D1 ",D1Color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
D2Bar = ValueWhen(Ref(MPK,-1) == False AND MPK == True, Indices+1, 2);
D2X = LastValue(ValueWhen(Ref(MPK,-1) == False AND MPK == True, x, 2));
D2 = LastValue(MPKV2);
D2Fark = ToplamBar - D2Bar ;
D2Tanjant = (D2Fark * Downtanjant) / 100;
D2TrendLine = ( D2 * D2Tanjant ) + D2 ;
D2Rakam = LastValue( ValueWhen( D2TrendLine, D2TrendLine) );
D2Direnc= LastValue(ValueWhen( D2Trendline, x ));
D2Line =D2Direnc - D2X;
D2AS = (D2Rakam - D2) / D2Line;
D2DirencLine = D2AS * ( x - D2Direnc ) + D2Rakam;
D2 = IIf (x > D2X-1, D2DirencLine,-1e10);
D2Color=IIf( C < D2, colorRed,colorDarkYellow );
Plot(D2," D2 ",D2Color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
D3Bar = ValueWhen(Ref(MPK,-1) == False AND MPK == True, Indices+1, 3);
D3X = LastValue(ValueWhen(Ref(MPK,-1) == False AND MPK == True, x, 3));
D3 = LastValue(MPKV3);
D3Fark = ToplamBar - D3Bar ;
D3Tanjant = (D3Fark * Downtanjant) / 100;
D3TrendLine = ( D3 * D3Tanjant ) + D3 ;
D3Rakam = LastValue( ValueWhen( D3TrendLine, D3TrendLine) );
D3Direnc= LastValue(ValueWhen( D3Trendline, x ));
D3Line =D3Direnc - D3X;
D3AS = (D3Rakam - D3) / D3Line;
D3DirencLine = D3AS * ( x - D3Direnc ) + D3Rakam;
D3 = IIf (x > D3X-1, D3DirencLine,-1e10);
D3Color=IIf( C < D3, colorRed,colorDarkYellow );
Plot(D3," D3 ",D3Color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
D4Bar = ValueWhen(Ref(MPK,-1) == False AND MPK == True, Indices+1, 4);
D4X = LastValue(ValueWhen(Ref(MPK,-1) == False AND MPK == True, x, 4));
D4 = LastValue(MPKV4);
D4Fark = ToplamBar - D4Bar ;
D4Tanjant = (D4Fark * Downtanjant) / 100;
D4TrendLine = ( D4 * D4Tanjant ) + D4 ;
D4Rakam = LastValue( ValueWhen( D4TrendLine, D4TrendLine) );
D4Direnc= LastValue(ValueWhen( D4Trendline, x ));
D4Line =D4Direnc - D4X;
D4AS = (D4Rakam - D4) / D4Line;
D4DirencLine = D4AS * ( x - D4Direnc ) + D4Rakam;
D4 = IIf (x > D4X-1, D4DirencLine,-1e10);
D4Color=IIf( C < D4, colorRed,colorDarkYellow );
Plot(D4," D4 ",D4Color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
D5Bar = ValueWhen(Ref(MPK,-1) == False AND MPK == True, Indices+1, 5);
D5X = LastValue(ValueWhen(Ref(MPK,-1) == False AND MPK == True, x, 5));
D5 = LastValue(MPKV5);
D5Fark = ToplamBar - D5Bar ;
D5Tanjant = (D5Fark * Downtanjant) / 100;
D5TrendLine = ( D5 * D5Tanjant ) + D5 ;
D5Rakam = LastValue( ValueWhen( D5TrendLine, D5TrendLine) );
D5Direnc= LastValue(ValueWhen( D5Trendline, x ));
D5Line =D5Direnc - D5X;
D5AS = (D5Rakam - D5) / D5Line;
D5DirencLine = D5AS * ( x - D5Direnc ) + D5Rakam;
D5 = IIf (x > D5X-1, D5DirencLine,-1e10);
D5Color=IIf( C < D5, colorRed,colorDarkYellow );
Plot(D5," D5 ",D5Color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
D6Bar = ValueWhen(Ref(MPK,-1) == False AND MPK == True, Indices+1, 6);
D6X = LastValue(ValueWhen(Ref(MPK,-1) == False AND MPK == True, x, 6));
D6 = LastValue(MPKV6);
D6Fark = ToplamBar - D6Bar ;
D6Tanjant = (D6Fark * Downtanjant) / 100;
D6TrendLine = ( D6 * D6Tanjant ) + D6 ;
D6Rakam = LastValue( ValueWhen( D6TrendLine, D6TrendLine) );
D6Direnc= LastValue(ValueWhen( D6Trendline, x ));
D6Line =D6Direnc - D6X;
D6AS = (D6Rakam - D6) / D6Line;
D6DirencLine = D6AS * ( x - D6Direnc ) + D6Rakam;
D6 = IIf (x > D6X-1, D6DirencLine,-1e10);
D6Color=IIf( C < D6, colorRed,colorDarkYellow );
Plot(D6," D6 ",D6Color, styleThick|styleNoRescale|styleNoLabel);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Basit Destek-Diren Hesaplaması //////////////////////////////////////////////////////////////////
Stop = JJMA(C,6,0);
StopColor=IIf( Stop > Ref(Stop,-1), colorLime,colorRed);

Direnc =ValueWhen (Cross (MA(C, 10), C), HHV(High, 10),1);

Destek = ValueWhen (Cross (C, MA(C, 10)), LLV(Low, 10),1);

Plot (Direnc,"Diren", StopColor, styleDots|styleNoLine|styleNoLabel);
Plot (Destek,"Destek", StopColor, styleDots|styleNoLine|styleNoLabel);

//Basit Destek-Diren Hesaplaması Bitiş ////////////////////////////////////////////////////////////

//Stoploss Hesaplaması Başla ////////////////////////////////////////////////////////////////////////
ALT=Shortstop= HHV ( Stop, 34) - ATR (100);
UST=Longstop= LLV ( Stop, 34) + ATR (100);
Plot (Shortstop," SL for shorts ",ColorRGB(255,255,255), styleThick|styleNoLabel);
Plot (Longstop," SL for longs ",ColorRGB(255,255,255), styleThick|styleNoLabel);
Plot (Stop,"JMA",colorGold,styleThick|styleNoLabel);
Plot((O+C)/2,"Waist",ColorRGB(255,255,255), styleDots|styleNoLine|styleNoLabel);
SetBarFillColor(IIf ( C>O, colorDarkGreen, colorDarkRed));
Plot(C,"Close",ColorRGB(0,0,0),styleCandle + styleNoRescale|styleNoLabel);
Plot( Volume, _DEFAULT_NAME(), colorGold, styleNoTitle | styleHistogram| styleThick | styleOwnScale | styleNoLabel , 10 );
PlotOHLC( ALT, ALT, UST,UST, "Stoploss Band", ColorRGB(100,100,100), styleCloud | styleNoLabel|styleNoTitle);

//Stoploss Hesaplaması Bitiş ////////////////////////////////////////////////////////////////////////

//Kırmızı ve Yeşil Pointler Başla ////////////////////////////////////////////////////////////////////
Tetik = JJMA(Close, 12,0);
Direnc = JJMA(Close, 27,0);
Destek = JJMA(Close, 66,0);
SAT = Cross (Direnc,Tetik);
PlotShapes(shapeCircle*SAT,colorBrightGreen,O,L,-12); // Destek
AL = Cross (Tetik,Destek);
PlotShapes(shapeCircle*AL,colorRed,O,H,12); // Direnc
//Kırmızı ve Yeşil Pointler Bitiş ////////////////////////////////////////////////////////////////////

Title="";
GfxSetBkMode(1);
GfxSetTextAlign(0);
GfxSetTextColor( colorLightBlue );
GfxSelectFont("Verdana", 13, 700, True );
GfxTextOut(" " + "| Soydan BlueBerry | ", 10 , 0 );
GfxSetTextColor( colorWhite );
GfxTextOut( Name() + " Son Kapanış : " + StrFormat("%1.2f", C), 240 , 0 );
GfxSetTextColor( colorGold);
GfxTextOut(" " + "Ortalama : " + StrFormat("%1.2f",Stop) + " ", 565 , 0 );
GfxSetTextColor( colorLime );
GfxTextOut(" " + "| " + StrFormat("%1.2f",UPAciDerecesi) + " UpTrend =" + " " + StrFormat("%1.2f",U1TrendLine) + " | "+ " Stoploss for SHORT : " + StrFormat("%1.2f",Shortstop) + " |", 10 , 25 );
GfxSetTextColor( colorRed );
GfxTextOut(" " + "| " + StrFormat("%1.2f",DownAciDerecesi) + " DownTrend =" + " " + StrFormat("%1.2f",D1TrendLine) + " | "+ " Stoploss for LONG : " + StrFormat("%1.2f",Longstop) + " |", 10 , 50 );
GfxSelectFont("Verdana", 10, 500, True );
GfxSetTextColor( colorWhite );
GfxTextOut(" " + "ToplamBar = " + StrFormat("%1.0f",ToplamBar) + " ", 1020 , 3 );
GfxTextOut(" " + "Seilen Bar Nosu = " + StrFormat("%1.0f",x) + " ", 850 , 3 );

_SECTION_END();
 
Last edited:
#2
Hello,

Thank you very much by it formulates of BlueBerry 2011.
It gives the following error me, y= MML (frame); sintax error ???
You can help me. Thanks.
Greetings,
 
#9
Hi,

I have also syntax error, but I can't upload image or link. Site is blockig.

Can you please post code in notepad?



Regards,

Mauro
 
Last edited:
Thread starter Similar threads Forum Replies Date
V Intraday 0
A Introductions 0
R AmiBroker 3
megapixel Equities 0
I Introductions 1

Similar threads