Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Cobra Trading System for Amibroker (AFL)

Rating:
4 / 5 (Votes 9)
Tags:
trading system, amibroker

Hi Friends Here I Present You One Nice System With Buy Sell Signals And Auto Trendline

Hope All Will Like It

Thank You

Screenshots

Similar Indicators / Formulas

All in One
Submitted by Nahid almost 14 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 10 years ago
Kase CD V2batu
Submitted by batu1453 over 10 years ago
Ichimoku
Submitted by prashantrdx over 10 years ago
Arvind' System
Submitted by akdabc over 14 years ago
Miftha remix for dse
Submitted by coolpace over 14 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Chart Settings");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
SetChartBkGradientFill(ParamColor("Upper Chart",colorBlack),ParamColor("Lower Chart",colorBlack));
_SECTION_END();
Plot(C,"P&F Chart Close",IIf( C > O, colorAqua, colorRed ),styleCandle|styleThick+styleNoLabel+stylePointAndFigure);
xx = Cum(1);
nbar = Param("nbar",5,2,50,1);
PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) <= H;
PHighPrice = ValueWhen(PHigh,H);
PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) >= L;
PLowPrice = ValueWhen(PLow,L);
startval_L = ValueWhen(PLow,L,1);
endval_L = ValueWhen(PLow,L,0);
startbar_L = ValueWhen(PLow,xx,1);
endbar_L = ValueWhen(PLow,xx,0);
aa_L = (endval_L-startval_L)/(endbar_L-startbar_L);
bb_L = startval_L;
trendline_L = aa_L * (xx - startbar_L) + bb_L;
dtrendline_L = trendline_L - Ref(trendline_L,-1);
startval_L_extend = ValueWhen(PLow,L,2);
endval_L_extend = ValueWhen(PLow,L,1);
startbar_L_extend = ValueWhen(PLow,xx,2);
endbar_L_extend = ValueWhen(PLow,xx,1);
aa_L_extend = (endval_L_extend-startval_L_extend)/(endbar_L_extend-startbar_L_extend);
bb_L_extend = startval_L;
trendline_L_extend = aa_L_extend * (xx - startbar_L) + endval_L_extend;
dtrendline_L_extend = trendline_L_extend - Ref(trendline_L_extend,-1);
dtrendline_L_extend = IIf(PLow,Ref(dtrendline_L,-1),dtrendline_L_extend);
startval_L_extend2 = ValueWhen(PLow,L,3);
endval_L_extend2 = ValueWhen(PLow,L,2);
startbar_L_extend2 = ValueWhen(PLow,xx,3);
endbar_L_extend2 = ValueWhen(PLow,xx,2);
aa_L_extend2 = (endval_L_extend2-startval_L_extend2)/(endbar_L_extend2-startbar_L_extend2);
bb_L_extend2 = endval_L_extend2;
trendline_L_extend2 = aa_L_extend2 * (xx - endbar_L_extend2) + endval_L_extend2;
dtrendline_L_extend2 = trendline_L_extend2 - Ref(trendline_L_extend2,-1);
dtrendline_L_extend2 = IIf(PLow,Ref(dtrendline_L_extend,-1),dtrendline_L_extend2);
startval_H = ValueWhen(PHigh,H,1);
endval_H = ValueWhen(PHigh,H,0);
startbar_H = ValueWhen(PHigh,xx,1);
endbar_H = ValueWhen(PHigh,xx,0);
aa_H = (endval_H-startval_H)/(endbar_H-startbar_H);
bb_H = startval_H;
trendline_H = aa_H * (xx - startbar_H) + bb_H;
dtrendline_H = trendline_H - Ref(trendline_H,-1);
startval_H_extend = ValueWhen(PHigh,H,2);
endval_H_extend = ValueWhen(PHigh,H,1);
startbar_H_extend = ValueWhen(PHigh,xx,2);
endbar_H_extend = ValueWhen(PHigh,xx,1);
aa_H_extend = (endval_H_extend-startval_H_extend)/(endbar_H_extend-startbar_H_extend);
bb_H_extend = startval_H;
trendline_H_extend = aa_H_extend * (xx - startbar_H) + endval_H_extend;
dtrendline_H_extend = trendline_H_extend - Ref(trendline_H_extend,-1);
dtrendline_H_extend = IIf(PHigh,Ref(dtrendline_H,-1),dtrendline_H_extend);
startval_H_extend2 = ValueWhen(PHigh,H,3);
endval_H_extend2 = ValueWhen(PHigh,H,2);
startbar_H_extend2 = ValueWhen(PHigh,xx,3);
endbar_H_extend2 = ValueWhen(PHigh,xx,2);
aa_H_extend2 = (endval_H_extend2-startval_H_extend2)/(endbar_H_extend2-startbar_H_extend2);
bb_H_extend2 = endval_H_extend2;
trendline_H_extend2 = aa_H_extend2 * (xx - endbar_H_extend2) + endval_H_extend2;
dtrendline_H_extend2 = trendline_H_extend2 - Ref(trendline_H_extend2,-1);
dtrendline_H_extend2 = IIf(PHigh,Ref(dtrendline_H_extend,-1),dtrendline_H_extend2);
tld = ParamToggle("All trendlines","show|hide",1);
if (tld)
{
trendline_L = IIf(dtrendline_L > 0,trendline_L,Null);
trendline_L_extend = IIf(dtrendline_L_extend > 0,trendline_L_extend,Null);
trendline_L_extend2 = IIf(dtrendline_L_extend2 > 0,trendline_L_extend2,Null);
trendline_H = IIf(dtrendline_H < 0,trendline_H,Null);
trendline_H_extend = IIf(dtrendline_H_extend < 0,trendline_H_extend,Null);
trendline_H_extend2 = IIf(dtrendline_H_extend2 < 0,trendline_H_extend2,Null);
}
trendline_L_extend2 = IIf(BarsSince(Plow) <= nbar,trendline_L_extend2,Null);
trendline_H_extend2 = IIf(BarsSince(PHigh) <= nbar,trendline_H_extend2,Null);
GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
PlotShapes(shapeUpArrow*PLow,colorYellow,0,L,-30);
PlotShapes(shapeDownArrow*PHigh,colorWhite,0,H,-30);
Plot(trendline_L, "", colorLime,styleLine|styleThick);
Plot(IIf(BarsSince(Plow) <= nbar,trendline_L_extend,Null), "", colorLightGrey, styleLine | styleThick);
Plot(IIf(BarsSince(Plow) > nbar,trendline_L_extend,Null), "",colorBrightGreen, styleLine | styleThick);
Plot(IIf(BarsSince(Plow) <= nbar,trendline_L_extend2,Null), "",colorDarkGreen, styleLine| styleThick);
Plot(trendline_H, "", colorRed,styleLine|styleThick);
Plot(IIf(BarsSince(PHigh) <= nbar,trendline_H_extend,Null), "", colorLightGrey, styleLine | styleThick);
Plot(IIf(BarsSince(PHigh) > nbar,trendline_H_extend,Null), "",colorOrange, styleLine | styleThick);
Plot(IIf(BarsSince(PHigh) <= nbar,trendline_H_extend2,Null), "",colorOrange, styleLine | styleThick);
signalFlag = ParamToggle("Possible Signals","show|hide",1);
if (signalFlag)
{
Buy = (!IsEmpty(trendline_H_extend) AND Cross(C,trendline_H_extend) AND BarsSince(PHigh) > nbar) OR
(!IsEmpty(trendline_H_extend2) AND Cross(C,trendline_H_extend2) AND !PHigh) OR
(PHigh AND C > trendline_H_extend2 AND Ref(C,-1) < Ref(trendline_H_extend,-1) AND !IsEmpty(trendline_H_extend) AND !IsEmpty(trendline_H_extend2) );
BuyPrice = C;
Short = (!IsEmpty(trendline_L_extend) AND Cross(trendline_L_extend,C) AND BarsSince(PLow) > nbar) OR
(!IsEmpty(trendline_L_extend2) AND Cross(trendline_L_extend2,C) AND !PLow) OR
(PLow AND C < trendline_L_extend2 AND Ref(C,-1) > Ref(trendline_L_extend,-1) AND !IsEmpty(trendline_L_extend) AND !IsEmpty(trendline_L_extend2));
ShortPrice = C;
Sell = 0;
Cover = 0;
_SECTION_BEGIN(" EXPLORE");
AL=(!IsEmpty(trendline_H_extend) AND Cross(C,trendline_H_extend) AND BarsSince(PHigh) > nbar) OR
(!IsEmpty(trendline_H_extend2) AND Cross(C,trendline_H_extend2) AND !PHigh) OR
(PHigh AND C > trendline_H_extend2 AND Ref(C,-1) < Ref(trendline_H_extend,-1) AND !IsEmpty(trendline_H_extend) AND !IsEmpty(trendline_H_extend2) );
BuyPrice = C;
SAT=(!IsEmpty(trendline_L_extend) AND Cross(trendline_L_extend,C) AND BarsSince(PLow) > nbar) OR
(!IsEmpty(trendline_L_extend2) AND Cross(trendline_L_extend2,C) AND !PLow) OR
(PLow AND C < trendline_L_extend2 AND Ref(C,-1) > Ref(trendline_L_extend,-1) AND !IsEmpty(trendline_L_extend) AND !IsEmpty(trendline_L_extend2));
ShortPrice = C;
AL_status=WriteIf(AL,"Alis Yap"," ");
SAT_status=WriteIf(SAT,"Satis Yap"," ");
AL_col=IIf(AL, colorDarkGreen , colorWhite);
SAT_col=IIf(SAT, colorRed,colorWhite);
Filter= AL OR SAT;
AddColumn(C, "KAPANIS", 1.2, IIf(C > Ref(C,-1),colorBlue, colorRed));
AddTextColumn(AL_status, "ALIS", 1.2, colorWhite, Al_col);
AddTextColumn(SAT_status, "SATIS", 1.2, colorWhite, SAT_col);
}
_SECTION_END();
function ALFilter( price, FP2, FP1, gain )
{
FP2 = 100/(200-FP2);
FP1 = 0.80+FP1/500;
result = price;
L0 = L1 = L2 = L3 = price;
coef = 0.5;
HH = 0.1;
LL = 0;
for ( i = 2; i < BarCount; i++ )
{
error = abs( price[i] - result[i-1] );
if ( error > HH )
{ HH = error; }
else
{ HH *= FP2; }
if ( error < LL )
{ LL = error; }
else
{ LL *= FP2; }
if ( HH != LL )
{ coef[i] = FP1*Coef[i-1]+(1-FP1)*((error - LL) / (HH - LL)); }
alpha = coef[i]*gain[i];
L0[i] = alpha*price[i] + (1 - alpha)*L0[i-1];
L1[i] = -(1 - alpha)*L0[i] + L0[i-1] + (1 - alpha)*L1[i-1];
L2[i] = -(1 - alpha)*L1[i] + L1[i-1] + (1 - alpha)*L2[i-1];
L3[i] = -(1 - alpha)*L2[i] + L2[i-1] + (1 - alpha)*L3[i-1];
result[i] = (L0[i] + 2*L1[i] + 2*L2[i] + L3[i]) / 6;
}
return result;
}
price = ParamField("Price field", 3);
FP2 = Param( "Filter Parameter 2", 99, 0, 99, 1 );
FP1 = Param( "Filter Parameter 1", 0, 0, 99, 1 );
gain = Param( "Gain Parameter", 1.0, 0.1, 2.5, 0.1 );
Plot( ALFilter(price, FP2, FP1, gain), "www.facebook.com/groups/traderszone/",colorYellow,styleLine+styleDots|styleThick );

12 comments

1. mahesh.aranake

Dear Admin,

Does this look into future? not able to make out clearly – pl advice

2. mahesh.aranake

Dear Admin,

Does this look into future? not able to make out clearly – pl advice

3. TradersZone

Yes It’s Look In To Future But If You Trading With Other Legging Indi You Will Get Good Result And After Signal Come Wait For Next Candle Gen-rate

4. davidalan

very nice afl thank you. would you translate alis yap, satis yap,kapanis to english thanks in advance

5. kv_maligi

Hi,

Very Nice chart, what is the yellowline meant for ?

Is this Stoploss?
when to book profits i mean targets?

Thanks
Viswanath

6. nimishsdll

I am not sure if I am doing anything wrong here.

Please help me with errors on Line 4, Col: 23
Line 136 col 8, Line 140 Col: 7.

7. wana88

Very Nice chart

8. f29825604

Very Nice chart
thanks

9. pourya1362

Very good.
Thanks.

10. manumoneya

Fisrt comment on the site , my fav

11. xavier

POLYNOMIAL for Amibroker (AFL)
http://www.wisestocktrader.com/indicators/2600-polynomial

good modification :)

12. kmmasoud

thanks so much , I think each chart such this , it has to have text description really worth
thanks

Leave Comment

Please login here to leave a comment.

Back