PDA

View Full Version : Tuyệt Chiêu AmiBroker



tradingpro8x
19-01-2011, 08:59 AM
Amibroker có nhiều chức năng hay lắm. Mình tìm được bản portable cho nó nè. Bạn nào cần liên hệ mình nhé

tigeran
11-02-2011, 08:05 AM
Giới thiệu với các bác công thức của RMO Trade Mode trong AmiBroker nè:


//////
_SECTION_BEGIN("RMO");
SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);
Buy=Cross(SwingTrd2,SwingTrd3);
Sell=Cross(SwingTrd3,SwingTrd2);
Bull_Trend=EMA(SwingTrd1,81)>0;
Bear_Trend=EMA(SwingTrd1,81)<0;
Ribbon_kol=IIf(Bull_Trend,colorGreen, IIf(Bear_Trend,colorRed, colorBlack));
Plot(4, "ribbon", Ribbon_kol, styleOwnScale|styleArea|styleNoLabel, -0.5,100);
Impulse_UP= EMA(SwingTrd1,30) > 0;
Impulse_Down= EMA(SwingTrd1,81) < 0;
bar_kol=IIf(impulse_UP, colorBlue, IIf(impulse_Down, colorRed,IIf(Bull_Trend, colorRed, colorBlue)));
Plot(Close,"Close",bar_kol,styleBar | styleThick );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBlue, colorRed ),0, IIf( Buy, Low, High ) );
_SECTION_END();
/////

tigeran
14-02-2011, 07:58 AM
Sau đây là code của PatternExplorer:



//|------------------------------------------------------------------
//|SECTION 21 - default buy, sell, short and cover rules. They are added to the PatternExplorer signals.
//|------------------------------------------------------------------
def_Buy = 1;
def_Sell = 1;
def_Short = 1;
def_Cover = 1;
//|------------------------------------------------------------------


//|------------------------------------------------------------------
//|SECTION 22 - Use Param from Chart
//|------------------------------------------------------------------
// NOT all parameters are possible. Currently only sensitivity is possible.
def_UseFromChart = 1;
//|------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------------------------------------------
//SECTION 23 - Add custom code before PatternExplorer code.
//-------------------------------------------------------------------------------------------------------------------------------------
//The following code allows you to add any custom code to any tool. Just use the Formula names as displayed in the workspace.

procedure AddCustomCodeBeforePE()
**
if(FormulaName == "PE - SI Relative Strength")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators. }
}
else
if(FormulaName == "PE - SI Trend")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators.
}
else
if(FormulaName == "PE - Candlesticks")
**
// AddColumn(MA(C, 5) > MA(C, 20), "MA(C, 5) > MA(C, 20)", 1.0);// Example to add a column before all the PatternExplorer columns, only in the Candlestick tool.
// Plot(PeTaio(), "PeTaio", colorBlue, 1+styleOwnScale, -100, 100);//Example to overlay the TAIO indicator over the Price Chart in the Candlestick tool.
}
else
**
// do anything
}
}
//-------------------------------------------------------------------------------------------------------------------------------------


// -------------------------------------------------------------------------------------------------------------------------------------
// SECTION 24 - Add custom code after PatternExplorer code.
// -------------------------------------------------------------------------------------------------------------------------------------
procedure AddCustomCodeAfterPE()
**
if(FormulaName == "PE - Alert 1 - Price")
**
// AddColumn(H == HHV(H, 20), "H == HHV(H, 20)", 1.0);// Example to add a column after PatternExplorer columns in PE - Alert 1 - Price.
}
// AddColumn(RSI() < 30, "RSI() < 30");// Example to add a column after PatternExplorer columns in all tools.
}
//-------------------------------------------------------------------------------------------------------------------------------------


//V3 - End of settings - Caution: Never change or remove this line !

tigeran
14-02-2011, 07:59 AM
Còn đây là đoạn code thứ 2 nè các bạn:


//-------------------------------------------------------------------------------------------------------------------------------------
//SECTION 23 - Add custom code before PatternExplorer code.
//-------------------------------------------------------------------------------------------------------------------------------------
//The following code allows you to add any custom code to any tool. Just use the Formula names as displayed in the workspace.

procedure AddCustomCodeBeforePE()
**
if(FormulaName == "PE - SI Relative Strength")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators. }
}
else
if(FormulaName == "PE - SI Trend")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators.
}
else
if(FormulaName == "PE - Candlesticks")
**
// AddColumn(MA(C, 5) > MA(C, 20), "MA(C, 5) > MA(C, 20)", 1.0);// Example to add a column before all the PatternExplorer columns, only in the Candlestick tool.
// Plot(PeTaio(), "PeTaio", colorBlue, 1+styleOwnScale, -100, 100);//Example to overlay the TAIO indicator over the Price Chart in the Candlestick tool.
}
else
**
// do anything
}
}
//-------------------------------------------------------------------------------------------------------------------------------------


// -------------------------------------------------------------------------------------------------------------------------------------
// SECTION 24 - Add custom code after PatternExplorer code.
// -------------------------------------------------------------------------------------------------------------------------------------
procedure AddCustomCodeAfterPE()
**
if(FormulaName == "PE - Alert 1 - Price")
**
// AddColumn(H == HHV(H, 20), "H == HHV(H, 20)", 1.0);// Example to add a column after PatternExplorer columns in PE - Alert 1 - Price.
}
// AddColumn(RSI() < 30, "RSI() < 30");// Example to add a column after PatternExplorer columns in all tools.
}
//-------------------------------------------------------------------------------------------------------------------------------------


//V3 - End of settings - Caution: Never change or remove this line !

tigeran
16-02-2011, 10:14 AM
Mọi người lưu bý điểm khác biệt cơ bản giữa Explore và Indicator nhé:

- Explore đóng vai trò như bộ lọc đầu vào. Sau khi lọc xong chúng ta vẫn phải tét lại bằng các công cụ PTKT khác

- Indicator là công cụ PT cụ thể nhưng cũng có thể được tích hợp và Explore để tăng tính hiệu quả và giảm bớt công sức tét

tigeran
17-02-2011, 08:35 AM
Mình mới tìm được một hệ thống trade tương đối lạ này. Các bác thử nhé:

Chaloke Simple Trailing Stop

///// Chaloke Simple Trailing Stop /////

Prd1=Param("ATR Period 1-20",4,1,20,1);//{Default = 4 Because most traders use 5}
Prd2=Param("LookBack Period 1-20",11,1,20,1);//{Default = 11 Because most traders use 10}

//{Green} {Start Long position when Close>Green}
Green=HHV(LLV(L,Prd1)+ATR(Prd1),Prd2);

//{Red} {Stop loss when Close<Red}
RED=LLV(HHV(H,Prd1)-ATR(Prd1),Prd2);

Color=IIf(C>Green ,colorBrightGreen,IIf(C < RED,colorRed,colorBlue));


Plot(Green,"Green",colorBrightGreen,styleLine);
Plot(RED,"Red",colorRed,styleLine);
Plot(C,"Chaloke Simple Trailing Stop System",Color,64);


Plot(LLV(HHV(H,5)-ATR(5),6),"",colorBlack);
Plot(LLV(HHV(H,5)-ATR(5),5),"",colorBlack);
Plot(LLV(HHV(H,5)-ATR(5),4),"",colorBlack);
Plot(LLV(HHV(H,5)-ATR(5),3),"",colorBlack);

tradingpro8x
17-02-2011, 04:03 PM
Hệ thống của bác hơi bị cũ rồi bác ạ. Em có cái này còn ác chiến và hiện đại hơn nhiều

(lưu ý là hơi khỏ sử dụng nhé :D:D:D:D)

/// AFBI Channel System ///
FixV=6;
x=MA(((H+L)/2)+(O-C),5);
i=DEMA(x,5);
j=(x+StDev(x,FixV))+ATR(2)/1.5;
k=(x-StDev(x,FixV))-ATR(2)/1;
color=IIf(BarsSince(Cross(k,C))>
BarsSince(Cross(C,j)), colorBrightGreen,colorRed);
Plot(C,"",Color,64);
Plot(J,"J",colorGreen);
Plot(K,"K",colorDarkRed);
Title=Name()+" "+Date()+" "+EncodeColor(colorSkyblue)+" AFBI Channel System "+EncodeColor(colorYellow)+" Vol="+NumToStr(Volume,1.0)+" "+" O="+Open+" H="+HHV(H,1)+" L="+LLV(L,1)+"
Close="+ Close+""+"("+numtostr((Close-ref(C,-1))/ref(c,-1)*100,1.2)+" %)";

1nightdream
17-02-2011, 08:54 PM
Em thì không hoành tráng như các bác. Có đoạn code này khá đơn giản nhưng thấy khá hữu ích

Các bác xài thử rùi cho ý kiến đóng góp cho em nó :):):):)

weeklyopen = TimeFrameGetPrice("O",inWeekly);
weeklyhigh = TimeFrameGetPrice("H",inWeekly);
weeklylow = TimeFrameGetPrice("L",inWeekly);
weeklyclose = TimeFrameGetPrice("C",inWeekly);

weeklyOpen = TimeFrameCompress( weeklyOpen, inWeekly );weeklyHigh = TimeFrameCompress( weeklyHigh, inWeekly );weeklyLow = TimeFrameCompress( weeklyLow, inWeekly );weeklyClose = TimeFrameCompress( weeklyClose, inWeekly );

PlotOHLC(weeklyopen,weeklyhigh,weeklylow,weeklyclo se,"WEEK",colorBlack,styleCandle);

tradingpro8x
18-02-2011, 03:31 PM
Hệ thống của bác xài được đấy. Tuy nhiên hình như hơi chậm (cỡ BMW thôi). Có cái nào cỡ Ferrari post lên cho anh em khai quan điểm nhãn cái

tigeran
19-02-2011, 03:25 PM
Các bác dạo này cũng hi-tech ghê nhỉ. Em thì không có nhiều hệ thống phức tạp chỉ có cái này thôi. Các bác xem qua cho ý kiến

//Chaloke Stochastic///

x1= StochK(14 ,7 ) ;
x2= TEMA(x1 ,5 ) ;
x3= EMA(x2 ,5 ) ;

Plot(x2, "Chaloke Stochastic" ,colorBlue,4);
Plot(x3,"",colorRed,1);

tradingpro8x
20-02-2011, 07:23 PM
Cái bác mới post xài giống như Stochastic oscillator phải không?

1nightdream
20-02-2011, 08:55 PM
Em thấy nó giống với dạng như RMO hơn

tigeran
21-02-2011, 08:02 AM
Các bác nhận xét đều đúng cả. Nói chung các chỉ báo đều có những nhóm nhất định thôi chứ không thể mỗi cái đều khác nhau quá xa được

/// Chaloke Reaction Trend System ///

XX=(H+L+C)/3;
BB=2*XX-H;
SS=2*XX-L;
HBOP=2*XX-2*L+H;
LBOP=2*XX-2*H+L;
color=IIf(BarsSince(Cross(H,Ref(HBOP,-1)))>
BarsSince(Cross(Ref(LBOP,-1),L)),colorRed , colorBrightGreen);
Plot(C,"",Color,64);
Plot(XX,"",colorYellow);
Plot(BB,"",colorLime);
Plot(SS,"",colorPink);
Plot(HBOP,"",colorGreen);
Plot(LBOP,"",colorDarkRed);

Title=Name()+" "+Date()+" "+EncodeColor(colorSkyblue)+" Chaloke RTS System "+EncodeColor(colorYellow)+" Vol="+NumToStr(Volume,1.0)+" "+" O="+Open+" H="+HHV(H,1)+" L="+LLV(L,1)+"
Close="+ Close+""+"("+numtostr((Close-ref(C,-1))/ref(c,-1)*100,1.2)+" %)";

tigeran
23-02-2011, 04:29 PM
Mình gửi thêm một công thức mà các cao thủ AmiBroker không thể thiếu trong bí kíp



//|------------------------------------------------------------------
//|SECTION 21 - default buy, sell, short and cover rules. They are added to the PatternExplorer signals.
//|------------------------------------------------------------------
def_Buy = 1;
def_Sell = 1;
def_Short = 1;
def_Cover = 1;
//|------------------------------------------------------------------


//|------------------------------------------------------------------
//|SECTION 22 - Use Param from Chart
//|------------------------------------------------------------------
// NOT all parameters are possible. Currently only sensitivity is possible.
def_UseFromChart = 1;
//|------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------------------------------------------
//SECTION 23 - Add custom code before PatternExplorer code.
//-------------------------------------------------------------------------------------------------------------------------------------
//The following code allows you to add any custom code to any tool. Just use the Formula names as displayed in the workspace.

procedure AddCustomCodeBeforePE()
**
if(FormulaName == "PE - SI Relative Strength")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators. }
}
else
if(FormulaName == "PE - SI Trend")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators.
}
else
if(FormulaName == "PE - Candlesticks")
**
// AddColumn(MA(C, 5) > MA(C, 20), "MA(C, 5) > MA(C, 20)", 1.0);// Example to add a column before all the PatternExplorer columns, only in the Candlestick tool.
// Plot(PeTaio(), "PeTaio", colorBlue, 1+styleOwnScale, -100, 100);//Example to overlay the TAIO indicator over the Price Chart in the Candlestick tool.
}
else
**
// do anything
}
}
//-------------------------------------------------------------------------------------------------------------------------------------


// -------------------------------------------------------------------------------------------------------------------------------------
// SECTION 24 - Add custom code after PatternExplorer code.
// -------------------------------------------------------------------------------------------------------------------------------------
procedure AddCustomCodeAfterPE()
**
if(FormulaName == "PE - Alert 1 - Price")
**
// AddColumn(H == HHV(H, 20), "H == HHV(H, 20)", 1.0);// Example to add a column after PatternExplorer columns in PE - Alert 1 - Price.
}
// AddColumn(RSI() < 30, "RSI() < 30");// Example to add a column after PatternExplorer columns in all tools.
}
//-------------------------------------------------------------------------------------------------------------------------------------


//V3 - End of settings - Caution: Never change or remove this line !

tradingpro8x
02-03-2011, 08:21 AM
Cái hệ thống phân tích kỹ thuật này xài thế nào vậy bác. Chứ code trong AmiBroker không em không hiểu nổi

Bác có cái nào tương tự trong MetaStock không:D

tigeran
03-03-2011, 08:20 AM
Cái hệ thống phân tích kỹ thuật này xài thế nào vậy bác. Chứ code trong AmiBroker không em không hiểu nổi

Bác có cái nào tương tự trong MetaStock không:D

Không có bác ạ. Đâu phải cái nào cũng có đồng thời trong hai phần mềm phân tích kỹ thuật đâu. Tùy cái chứ

tradingpro8x
10-03-2011, 10:53 AM
Căng nhỉ em toàn phân tích kỹ thuật trên Metastock thôi

1nightdream
12-03-2011, 05:30 PM
Thế là bác bị bất lợi rùi. Dân phân tích kỹ thuật đỉnh là phải xài cả hai cùng lúc

Em gửi các bác một chỉ báo mới này. Cái này xài cho AmiBroker nhé :D:D

SetChartOptions(0,chartShowArrows|chartShowDates);
_SECTION_BEGIN("Vol-bands");
Vf=Param("V-b Values",0.0146,-0.0001,0.1,0.0001);
P1 = ValueWhen(TimeNum() == 095500, Open);
T0 = P1+(P1*0.25*Vf);
B0 = P1-(P1*0.25*Vf);
T1 = P1+(P1*0.5*Vf);
B1 = P1-(P1*0.5*Vf);
T2 = P1+(P1*1*Vf);
B2 = P1-(P1*1*Vf);
T3 = P1+(P1*1.28*Vf);
B3 = P1-(P1*1.28*Vf);
T4 = P1+(P1*1.5*Vf);
B4 = P1-(P1*1.5*Vf);
T5 = P1+(P1*2*Vf);
B5 = P1-(P1*2*Vf);
T6 = P1+(P1*2.5*Vf);
B6 = P1-(P1*2.5*Vf);
T7 = P1+(P1*3*Vf);
B7 = P1-(P1*3*Vf);

hts = Param ("Text Shift", -55,-150,150,1);
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
Today = LastValue(Day()) ;
starttime = ParamTime( "Start Time", "09:55" );
endtime = ParamTime( "End Time", "10:00" );
tn = TimeNum();
timecond = tn >= starttime AND tn <= endtime;
firstBarOfDay = timecond ;
firstBarOfDay = firstBarOfDay - Ref( firstBarOfDay, -1 );
Cb=ParamToggle("0.25 ","NO|YES",1);
Cb1=ParamToggle("0.50","NO|YES",1);
Cb2=ParamToggle("1.0 ","NO|YES",1);
Cb3=ParamToggle("1.28","NO|YES",1);
Cb4=ParamToggle("1.5 ","NO|YES",0);
Cb5=ParamToggle("2.0 ","NO|YES",0);
Cb6=ParamToggle("2.5 ","NO|YES",0);
Cb7=ParamToggle("3.0 ","NO|YES",0);
if(Cb==1)**
Plot(IIf( tn > endtime , t0, Null ) ,"",7, styleLine+ styleNoLabel);
PlotText("0.25= " + WriteVal(T0,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T0,1) , 2);
Plot(IIf( tn > endtime , b0, Null ),"",7, styleLine+ styleNoLabel);
PlotText("0.25= " + WriteVal(B0,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B0,1) , 2);
}if(Cb1==1)**
Plot(IIf( tn > endtime , t1, Null ),"",48, styleDashed+ styleNoLabel);
PlotText("0.50= " + WriteVal(T1,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T1,1) , 2);
Plot(IIf( tn > endtime , b1, Null ),"",48, styleDashed+ styleNoLabel);
PlotText("0.50= " + WriteVal(B1,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B1,1) , 2);
}if(Cb2==1)**
Plot(IIf( tn > endtime , t2, Null ),"",3, styleLine+ styleNoLabel);
PlotText("1.00= " + WriteVal(T2,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T2,1) , 2);
Plot(IIf( tn > endtime , b2, Null ),"",3, styleLine+ styleNoLabel);
PlotText("1.00= " + WriteVal(B2,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B2,1) ,2);
}if(Cb3==1)**
Plot(IIf( tn > endtime , t3, Null ),"",51, styleDashed+ styleNoLabel);
PlotText("1.28= " + WriteVal(T3,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T3,1) , 2);
Plot(IIf( tn > endtime , b3, Null ),"",51, styleDashed+ styleNoLabel);
PlotText("1.28= " + WriteVal(B3,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B3,1) , 2);
}if(Cb4==1)**
Plot(IIf( tn > endtime , t4, Null ),"",5, styleDashed+ styleNoLabel);
PlotText("1.50= " + WriteVal(T4,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T4,1) , 2);
Plot(IIf( tn > endtime , b4, Null ),"",5, styleDashed+ styleNoLabel);
PlotText("1.50= " + WriteVal(B4,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B4,1) , 2);
}if(Cb5==1)**
Plot(IIf( tn > endtime , t5, Null ),"",4, styleDashed+ styleNoLabel);
PlotText("2.00= " + WriteVal(T5,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T5,1) , 2);
Plot(IIf( tn > endtime , b5, Null ),"",4, styleDashed+ styleNoLabel);
PlotText("2.00= " + WriteVal(B5,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B5,1) , 2);
}if(Cb6==1)**
Plot(IIf( tn > endtime , t6, Null ), "",47, styleDashed+ styleNoLabel);
PlotText("2.50= " + WriteVal(T6,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (T6,1) , 2);
Plot(IIf( tn > endtime , b6, Null ),"",47, styleDashed+ styleNoLabel);
PlotText("2.50= " + WriteVal(B6,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (B6,1) , 2);
}if(Cb7==1)**
Plot( T7,"", colorLightBlue, 1|styleNoLabel );
Plot( B7,"", colorLightBlue, 1|styleNoLabel );}



Plot(Close, "Price", 47, styleCandle );
up= tn > endtime AND((Cross(Close,t0)OR Cross(Close,t1)OR Cross(Close,t2) OR Cross(Close,t3)OR Cross(Close,t4)OR Cross(Close,t5)OR Cross(Close,t6) OR Cross(Close,t7)
OR Cross(Close,b0) OR Cross(Close,b1) OR Cross(Close,b2) OR Cross(Close,b3) OR Cross(Close,b4) OR Cross(Close,b5) OR Cross(Close,b6) OR Cross(Close,b7)));
dn=tn > endtime AND ((Cross(b0,Close)OR Cross( b1,Close)OR Cross( b2,Close)OR Cross(b3,Close)OR Cross( b4,Close)OR Cross( b5,Close) OR Cross( b6,Close) OR Cross( b7,Close)
OR Cross(t0,Close)OR Cross( t1,Close)OR Cross( t2,Close)OR Cross(t3,Close)OR Cross( t4,Close)OR Cross( t5,Close)OR Cross( t6,Close)OR Cross( t7,Close)));

Cb7=ParamToggle("Alerts","NO|YES" ,0);if(Cb7==1)**
PlotShapes( IIf( up, shapeUpArrow, shapeNone ),10,0,L,-20 );
PlotShapes( IIf( dn, shapeDownArrow, shapeNone ),13,0,H,-20 );}
//------------------------------------------------------------
HaC=(O+H+L+C)/4;
pab=tn > endtime AND (Cross(HaC,t0)OR Cross(Hac,b0));
pb= tn > endtime AND (Cross(HaC,t1) OR Cross(Hac,b1));
pb1=tn > endtime AND (Cross(HaC,t2) OR Cross(Hac,b2));
pb2=tn > endtime AND (Cross(HaC,t3) OR Cross(Hac,b3)) ;
pb3=tn > endtime AND (Cross(HaC,t4) OR Cross(Hac,b4));
pb4=tn > endtime AND (Cross(HaC,t5)OR Cross(Hac,b5));
pb5=tn > endtime AND (Cross(HaC,t6)OR Cross(Hac,b6));
pb6=tn > endtime AND (Cross(HaC,t7)OR Cross(Hac,b7));

pas=tn > endtime AND (Cross(b0,HaC)OR Cross(t0,HaC));
ps= tn > endtime AND (Cross( b1,HaC)OR Cross( t1,HaC));
ps1=tn > endtime AND (Cross( b2,HaC)OR Cross( t2,HaC));
ps2=tn > endtime AND (Cross(b3,HaC)OR Cross(t3,HaC));
ps3=tn > endtime AND (Cross( b4,HaC)OR Cross( t4,HaC));
ps4=tn > endtime AND (Cross( b5,HaC)OR Cross( t5,HaC));
ps5=tn > endtime AND (Cross( b6,HaC)OR Cross( t6,HaC));
ps6=tn > endtime AND (Cross( b7,HaC)OR Cross( t7,HaC));

PlotP = ParamToggle("Plot Shapes","Off,On",0);
//P1Shape = Param("buy Shape Typ",35,0,50,1);
//P2Shape = Param("sell Shape Typ",36,0,50,1);
if(PlotP)**
PlotShapes(IIf(pab,shapeDigit1,shapeNone),colorAqu a,0,L,-10 );
PlotShapes(IIf(pas,shapeDigit1,shapeNone),colorCus tom2,0,H,10 );
PlotShapes(IIf(pb,shapeDigit2,shapeNone),colorLime ,0,L,-10 );
PlotShapes(IIf(ps,shapeDigit2,shapeNone),colorOran ge,0,H,10 );
PlotShapes(IIf(pb1,shapeDigit3,shapeNone),2,0,L,-10 );
PlotShapes(IIf(ps1,shapeDigit3,shapeNone),13,0,H,1 0 );
PlotShapes(IIf(pb2,shapeDigit4,shapeNone),6,0,L,-10 );
PlotShapes(IIf(ps2,shapeDigit4,shapeNone),31,0,H,1 0 );
PlotShapes(IIf(pb3,shapeDigit5,shapeNone),5,0,L,-10 );
PlotShapes(IIf(ps3,shapeDigit5,shapeNone),4,0,H,10 );
PlotShapes(IIf(pb4,shapeDigit6,shapeNone),5,0,L,-10 );
PlotShapes(IIf(ps4,shapeDigit6,shapeNone),4,0,H,10 );
PlotShapes(IIf(pb5,shapeDigit7,shapeNone),5,0,L,-10 );
PlotShapes(IIf(ps5,shapeDigit7,shapeNone),4,0,H,10 );
PlotShapes(IIf(pb6,shapeDigit8,shapeNone),5,0,L,-10 );
PlotShapes(IIf(ps6,shapeDigit8,shapeNone),4,0,H,10 );
}
Title = EncodeColor(colorWhite)+ "Volatility-Bands stocks" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V);
_SECTION_END();
_SECTION_BEGIN("Background text");
C11=ParamColor("up panel",colorDarkOliveGreen );
C12=ParamColor("dn panel",colorDarkGrey );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",12,1,20,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSetOverlayMode(1);
GfxGradientRect(0,0,pxwidth, pxheight, C11, C12 );
GfxSelectFont("Tahoma", Status("pxheight")/C13 );
GfxSetTextAlign( 6 );
GfxTextOut( Name(), Status("pxwidth")/C14, Status("pxheight")/C15 );
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxTextOut( "Volatility Bands - stocks", Status("pxwidth")/C14, Status("pxheight")/C15*2.5 );
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxTextOut( " www.TAtechnics.in", Status("pxwidth")/C14, Status("pxheight")/C15*4 );
_SECTION_END();
NewDay = Day() != Ref( Day(), -1 );
DailyBarNum = BarsSince( NewDay ) + 1;
DBN = DailyBarNum <= 1;
Plot( DBN, "Day Seprator", 31, styleHistogram| styleOwnScale | styleNoLabel);

tigeran
16-03-2011, 04:38 PM
Cái công thức của bác dài thế kia thì ngay cả dân phân tích kỹ thuật chuyên nghiệp cũng khiếp vía đấy

tigeran
23-03-2011, 08:50 AM
Mình nghĩ công thức dài ngắn không quan trọng chủ yếu là phải đáp ứng hai tiêu chuẩn:

- Thứ nhất, tỷ lệ chính xác phải tương đối

- Thứ hai, phải đảm bảo dễ sử dụng (chứ nếu không thì căng đấy :D )

tradingpro8x
15-04-2011, 08:15 AM
Vấn đề độ chính xác cũng không phải quá quan trọng> mình nghĩ điều quan trọng nhất khi xài chỉ báo (indicator) kỹ thuật là phải hiểu rõ nó. Chứ nếu không thì hết sức nguy hiểm

tigeran
27-04-2011, 07:18 AM
Điều này thì chắc chắn rồi. Bác nào có thêm kinh nghiệm gì đặc sắc thì chỉ cho mình với

tradingpro8x
13-05-2011, 07:54 AM
Cái chỉ báo phân tích kỹ thuật này khá hay đấy. Các bác dùng thử nhé

/* ABKP Benchmark Bar
the Benchmark Bar Up must exceed the High of the prior two bars AND
close above the high of the prior two bars. And, naturally
Fast 2 must be blue to confirm the momentum strength of the
POWER BAR.
the Benchmark Bar Down must exceed the low of the prior two bars AND
close below the low of the prior two bars. And, naturally
Fast 2 must be red to confirm the momentum strength of the
POWER BAR.

Note: not mentioned in the PDF is the requirement that there
be a change in color in for the Power Bar. For an up Power Bar then
you can have Red|Yellow, Red|Blue, or Yellow|Blue. For the down
Power Bar you can have Blue|Yellow, Blue|Red, or Yellow Red.

*/
parmPowerBarUpColor = ParamColor("Power Bar Up color", colorAqua);
parmPowerBarDnColor = ParamColor("Power Bar Dn color", colorPink);
parmFast2Confirm = ParamToggle("Fast2 confirm", "No|Yes", 0);
parmA900Confirm = ParamToggle("A900 confirm", "No|Yes", 1);
parmPRange = ParamToggle("Confirm % Range", "No|Yes", 0);
parmRibbon = ParamToggle("Plot as ribbon", "No|Yes" , 0);
parmRibbonSize = Param("Ribbon size", 1, 0.5, 10, 0.5);
parmThreshold = Param("SC Threshold", 5, -5, 5, 1);
parmVoice = ParamToggle("Voice", "No|Yes", 0);
parmPlotTargets = ParamToggle("Plot targets", "No|Yes", 0);
parmDebug = ParamToggle("Debug", "No|Yes", 0);
SetBarsRequired(350, -1);
// constants
_N(APaneName = Name() + Interval(2) + _SECTION_NAME());
_N(ANewBarName = "NewBar" + APaneName);

//functions
function ANewBar()
**
PrevDT = StaticVarGet( ANewBarName);
DT = LastValue(DateTime());
StaticVarSet( ANewBarName,DT);
return DT != PrevDT;
}
function MRound2(Number, Multiple )
**
if(Multiple == 0 )
**

xMultiple = 0.01; }
else
**
xMultiple = Multiple;
}
Divided = Number / xMultiple;
intDivided = int(Divided);
intDivided = intDivided + round(Divided - intDivided);
return intDivided * xMultiple;
}

ObjAB = CreateObject("Broker.Application");
ticker = objAB.Stocks(Name() );

// KP indicators
Ctmpl = E_TSKPCOLORTMPL(Open,High,Low,Close,Volume);
total = 0;
total = total + IIf(tskp_colortmplcnd0 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd1 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd2 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd3 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd4 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd5 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd6 > 0, 1, -1);
total = total + IIf(tskp_colortmplcnd7 > 0, 1, -1);
KPScoreCard = total + IIf(tskp_colortmplcnd8 > 0, 1, -1);
dummy = E_TSKPFAST2(Open,High,Low,Close,Volume);

// calculations
Range = H -L;
RangePercent = (C - L) / Range;

PriorHHScoreCard = Ref(HHV(KPScoreCard, 1), -1);
PriorLLScoreCard = Ref(LLV(KPScoreCard, 1), -1);
ChangeInBarColor = ((KPScoreCard >= parmThreshold AND PriorHHScoreCard < parmThreshold) OR (KPScoreCard >= -(parmThreshold-1) AND PriorHHScoreCard <= -parmThreshold))
OR ((KPScoreCard <= -parmThreshold AND PriorHHScoreCard > -parmThreshold) OR (KPScoreCard <= (parmThreshold-1) AND PriorHHScoreCard >= parmThreshold));
PriorHHV = Ref(HHV(H, 2) , -1); //highest high of the 2 prior bars
PriorLLV = Ref(LLV(L, 2) , -1); //lowest low of the 2 prior bars
if(parmDebug == 1)
**
printf("PHHScoreCard: %g% \nPLLScoreCard: %g%\nChgInBar: %g%\nKPScoreCard: %g%\n", PriorHHScoreCard, PriorLLScoreCard, ChangeInBarColor, KPScoreCard);
}
if(parmFast2Confirm == 0)
**
BBarUp = H > PriorHHV AND C > PriorHHV AND ChangeInBarColor;
BBarDn = L < PriorLLV AND C < PriorLLV AND ChangeInBarColor;
}
else //confirm with Fast2
**
KPFast21 = tskp_Fast2val1;
KPFast22 = tskp_Fast2val2;
if(parmDebug == 1)
**
printf("KPFast21: %g%\nKPFast22: %g%\n", KPFast21, KPFast22);
}
BBarUp = H > PriorHHV AND C > PriorHHV AND ChangeInBarColor AND KPFast21 == 1;
BBarDn = L < PriorLLV AND C < PriorLLV AND ChangeInBarColor AND KPFast22 == -1;
}
if(parmA900Confirm == 1);
{a 5 period simple moving average
KPA900 = E_TSKPA900(Close);
BBarUp = BBarUp AND C > KPA900;
BBarDn = BBarDn AND C < KPA900;

}
if(parmPRange == 1)
**
BBarUp = BBarUp AND RangePercent >= 0.7;
BBarDn = BBarDn AND rangePercent <= 0.4;
}

//paint the pane
if(parmDebug == 1)
**
printf("BBarUp: %g%\nBBarDn: %g%\n", BBarUp, BBarDn);
}
if(parmRibbon == 0)
**
PlotShapes(IIf(BBarUp , shapeHollowStar, shapeNone), parmPowerBarUpColor, 0, L, -8);
PlotShapes(IIf(BBarDn , shapeHollowStar, shapeNone), parmPowerBarDnColor, 0, H, 8);
}
else Plot( IIf(BBarUp OR BBarDn, parmRibbonSize, 0), "" , IIf(BBarUp, parmPowerBarUpColor, IIf(BBarDn, parmPowerBarDnColor, Null)) , styleArea | styleNoLabel | styleOwnScale , 0, 10);
//voice
ANewBarSignal = ANewBar();
if(parmVoice == 1)
**
if(ANewBarSignal)
**
if(LastValue(Ref(BBarUp, -1)) ) Say(Interval(2) + " Benchmark bar: up. Stop at " + NumToStr(Ref(L, -1) - ticker.TickSize, 1.2) + ".");
if(LastValue(Ref(BBarDn, -1)) ) Say(Interval(2) + " Benchmark bar: down. Stop at " + NumToStr(Ref(H, -1) + ticker.TickSize, 1.2) + ".");
}
}
//plot targets
if(parmPlotTargets == 1)
**
RangeAvg = MRound2(Ref(MA(H-L, 5), -1) , ticker.ticksize ) ;
BBarUpSince = BarsSince(BBarUp);
BBarDnSince = BarsSince(BBarDn);
PT = IIf( BBarUpSince <= BBarDnSince, Ref(O, - BBarUpSince + 1 ) + Ref(RangeAvg, -BBarUpSince -1), Ref(O, - BBarDnSince + 1) - Ref(RangeAvg, -BBarDnSince -1) );
Stop = IIf( BBarUpSince <= BBarDnSince, Ref(L, - BBarUpSince) - ticker.TickSize, Ref(H, - BBarDnSince) + ticker.TickSize);
Plot(Stop, "Stop", colorRed, styleLine | styleStaircase);
Plot(PT, "Target", colorGreen, styleLine | styleStaircase);
}

tigeran
27-05-2011, 09:08 AM
Bác lấy đâu ra cái chỉ báo phân tích kỹ thuật kinh thế. Nhìn muốn loạn chưởng luôn.

Cho cái hướng dẫn đầu tư chứng khoán theo nó cái bác ơi
:D:D:D

1nightdream
03-06-2011, 07:41 AM
Cái chỉ báo phân tích kỹ thuật này thuộc nhóm trend và momentum đấy

/// Chaloke Reaction Trend System ///

XX=(H+L+C)/3;
BB=2*XX-H;
SS=2*XX-L;
HBOP=2*XX-2*L+H;
LBOP=2*XX-2*H+L;
color=IIf(BarsSince(Cross(H,Ref(HBOP,-1)))>
BarsSince(Cross(Ref(LBOP,-1),L)),colorRed , colorBrightGreen);
Plot(C,"",Color,64);
Plot(XX,"",colorYellow);
Plot(BB,"",colorLime);
Plot(SS,"",colorPink);
Plot(HBOP,"",colorGreen);
Plot(LBOP,"",colorDarkRed);

Title=Name()+" "+Date()+" "+EncodeColor(colorSkyblue)+" Chaloke RTS System "+EncodeColor(colorYellow)+" Vol="+NumToStr(Volume,1.0)+" "+" O="+Open+" H="+HHV(H,1)+" L="+LLV(L,1)+"
Close="+ Close+""+"("+numtostr((Close-ref(C,-1))/ref(c,-1)*100,1.2)+" %)";

tradingpro8x
07-06-2011, 08:03 AM
Hệ thống phân tích kỹ thuật này cũng hay lắm

//|------------------------------------------------------------------
//|SECTION 21 - default buy, sell, short and cover rules. They are added to the PatternExplorer signals.
//|------------------------------------------------------------------
def_Buy = 1;
def_Sell = 1;
def_Short = 1;
def_Cover = 1;
//|------------------------------------------------------------------


//|------------------------------------------------------------------
//|SECTION 22 - Use Param from Chart
//|------------------------------------------------------------------
// NOT all parameters are possible. Currently only sensitivity is possible.
def_UseFromChart = 1;
//|------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------------------------------------------
//SECTION 23 - Add custom code before PatternExplorer code.
//-------------------------------------------------------------------------------------------------------------------------------------
//The following code allows you to add any custom code to any tool. Just use the Formula names as displayed in the workspace.

procedure AddCustomCodeBeforePE()
**
if(FormulaName == "PE - SI Relative Strength")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators. }
}
else
if(FormulaName == "PE - SI Trend")
**
def_Filter = 1;//Filter set to 1 because common filter conditions are mostly not useful in the composite indicators.
}
else
if(FormulaName == "PE - Candlesticks")
**
// AddColumn(MA(C, 5) > MA(C, 20), "MA(C, 5) > MA(C, 20)", 1.0);// Example to add a column before all the PatternExplorer columns, only in the Candlestick tool.
// Plot(PeTaio(), "PeTaio", colorBlue, 1+styleOwnScale, -100, 100);//Example to overlay the TAIO indicator over the Price Chart in the Candlestick tool.
}
else
**
// do anything
}
}
//-------------------------------------------------------------------------------------------------------------------------------------


// -------------------------------------------------------------------------------------------------------------------------------------
// SECTION 24 - Add custom code after PatternExplorer code.
// -------------------------------------------------------------------------------------------------------------------------------------
procedure AddCustomCodeAfterPE()
**
if(FormulaName == "PE - Alert 1 - Price")
**
// AddColumn(H == HHV(H, 20), "H == HHV(H, 20)", 1.0);// Example to add a column after PatternExplorer columns in PE - Alert 1 - Price.
}
// AddColumn(RSI() < 30, "RSI() < 30");// Example to add a column after PatternExplorer columns in all tools.
}
//-------------------------------------------------------------------------------------------------------------------------------------


//V3 - End of settings - Caution: Never change or remove this line !

1nightdream
25-07-2011, 11:02 AM
Cho thêm cái hướng dẫn cho cái hệ thống phân tích kỹ thuật này đi cụ. Thế này thì ai mà biết xài

:(:(:(:(

tigeran
07-09-2011, 07:55 AM
Mình thấy những bác già già thường khoái xài MetaStock hơn vì nó đơn giản. AmiBroker chắc chỉ thích hợp với những tay phân tích kỹ thuật còn trẻ

1nightdream
10-10-2011, 05:25 PM
Cũng chưa chắc đâu bác. Tùy quan điểm mỗi người thôi

tigeran
15-12-2011, 04:33 PM
AmiBroker có đặc tính show theo Template nên không cần mày mò nhiều còn MetaStock thì mở hơn nên cần xài lâu mới biết

1nightdream
30-01-2012, 02:37 PM
Bác nào rành AmiBroker giải thích giúp em cái đoạn code của cái chỉ báo này với

Plot( E_TSKPMODSPLIT(High,Low,Close) , _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", style=styleNoLabel) );

tigeran
11-02-2012, 09:50 AM
Cái này nhìn có vẻ giống một bộ lọc trong AmiBroker. Bác kiếm được ở đâu thế

tradingpro8x
15-02-2012, 08:22 AM
Có cao nhân nào biết công thức của hệ thống giao dịch phân tích kỹ thuật RMO Trade Mode trên AmiBroker không chỉ giúp em với

tigeran
16-02-2012, 08:23 AM
Mình thấy có cái công thức này nè bác, phân tích ra cũng gần gần như RMO Trade Mode bên MetaStock đấy


//////
_SECTION_BEGIN("RMO");
SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);
Buy=Cross(SwingTrd2,SwingTrd3);
Sell=Cross(SwingTrd3,SwingTrd2);
Bull_Trend=EMA(SwingTrd1,81)>0;
Bear_Trend=EMA(SwingTrd1,81)<0;
Ribbon_kol=IIf(Bull_Trend,colorGreen, IIf(Bear_Trend,colorRed, colorBlack));
Plot(4, "ribbon", Ribbon_kol, styleOwnScale|styleArea|styleNoLabel, -0.5,100);
Impulse_UP= EMA(SwingTrd1,30) > 0;
Impulse_Down= EMA(SwingTrd1,81) < 0;
bar_kol=IIf(impulse_UP, colorBlue, IIf(impulse_Down, colorRed,IIf(Bull_Trend, colorRed, colorBlue)));
Plot(Close,"Close",bar_kol,styleBar | styleThick );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBlue, colorRed ),0, IIf( Buy, Low, High ) );
_SECTION_END();
/////

1nightdream
06-03-2012, 08:40 AM
THật ra mình thấy cũng không cần quá nhiều "tuyệt chiêu" làm gì. Cứ mấy cái Template của AmiBroker là xài mệt nghỉ rùi

tigeran
11-09-2012, 09:45 AM
Có cái chỉ báo phân tích kỹ thuật AmiBroker khá hay nè các bác

Weekly Price Graph

weeklyopen = TimeFrameGetPrice("O",inWeekly);
weeklyhigh = TimeFrameGetPrice("H",inWeekly);
weeklylow = TimeFrameGetPrice("L",inWeekly);
weeklyclose = TimeFrameGetPrice("C",inWeekly);

weeklyOpen = TimeFrameCompress( weeklyOpen, inWeekly );weeklyHigh = TimeFrameCompress( weeklyHigh, inWeekly );weeklyLow = TimeFrameCompress( weeklyLow, inWeekly );weeklyClose = TimeFrameCompress( weeklyClose, inWeekly );

PlotOHLC(weeklyopen,weeklyhigh,weeklylow,weeklyclo se,"WEEK",colorBlack,styleCandle);

tigeran
11-09-2012, 11:12 AM
Đây là loạt bài về phần mềm phân tích kỹ thuật AmiBroker

Optimization Iteration Reload (OIR) for AmiBroker

One of the (few) notable hardships of using AmiBroker is the inability to view a single optimization iteration result in a backtest or on a chart without having to manually re-enter each of the (who knows how many ...) individual strategy parameters - once thru all of them to setup a backtest, then once thru all of them again to visualize on a chart, and then all of this all over again for every single optimization iteration you want to examine.

CodeForTraders is very pleased to offer our solution to this chore - Optimization Iteration Reload for AmiBroker.

What It Is
Optimization Iteration Reload for AmiBroker is an Excel VBA application, and a process for using it, that allows you to quickly browse optimization results and choose any iteration you wish for quick, "no typing required" reloading into the AA Window parameter set or your chart parameter set.

The only modification needed to your code is the addition of a #include line, which results in the loading of the product output.

How It Works

There are just a few steps involved:

Prep your strategy code by adding the #include line
After your optimization, do a File -> Export of the AA Window results to a .csv file
Open the .csv file in Excel, and highlight the parameters for your chosen iteration
Use Alt-F8 (or your own hotkey) to invoke Optimization Iteration Reload
Return to your chart and use the Parameter Dialog reset button, or
Return to the AA Window, use the Parameter Dialog reset button, and run a backtest
The whole process takes mere seconds.

What It Looks Like

Bim, Bam, Boom - you can now easily browse any iteration of any optimization, choosing it for generation of a complete backtest report with performance graphs - NO TYPING REQUIRED !

Take a look at how it's done:

http://www.screencast.com/t/ajppho5f

1nightdream
15-09-2012, 06:27 PM
Có hai đoạn code của phần mềm phân tích kỹ thuật AmiBroker khá hay nhờ các cao thủ cho ý kiến

Đoạn 1:

// Zig-Hi-Zag-Lo and Zig on Close formula
VolON = ParamToggle( \"Plot Volume\", \"Off|On\", 1 );
ZigON = ParamToggle( \"Plot ZigHiLo\", \"Off|On\", 1 );
pr = Param( \"ZigZag change\", 0.15, 0.01, 20, 0.01 );
CloseORhilo = ParamToggle( \"ZigOnClose\", \"ZigOnHiLo\", 1 );

if ( CloseORhilo == 1 )
**
pk = PeakBars( C, pr ) == 0;// PeakBars( H, pr ) == 0
tr = TroughBars( C, pr ) == 0;// TroughBars( L, pr ) == 0

zzHi = Zig( C, pr );// Zig( H, pr )
zzLo = Zig( C, pr );// Zig( L, pr )
Avg = ( zzHi + zzLo ) / 2;

x = IIf( pk, zzHi, IIf( tr, zzLo, IIf( Avg > Ref( Avg, -1 ), C, C ) ) );// Ref( Avg, -1 ), H, L ) ) )
}
else
**
pk = PeakBars( H, pr ) == 0;// PeakBars( H, pr ) == 0
tr = TroughBars( L, pr ) == 0;// TroughBars( L, pr ) == 0

zzHi = Zig( H, pr );// Zig( H, pr )
zzLo = Zig( L, pr );// Zig( L, pr )
Avg = ( zzHi + zzLo ) / 2;

x = IIf( pk, zzHi, IIf( tr, zzLo, IIf( Avg > Ref( Avg, -1 ), H, L ) ) );// Ref( Avg, -1 ), H, L ) ) )
}

zzHiLo = Zig( x, pr );

zzup = zzHiLo > Ref( zzHiLo, -1 ) ;
zzdn = zzHiLo < Ref( zzHiLo, -1 );
ribboncol = IIf( zzup , colorWhite, colorBlack );
Plot ( 3, \"\", ribboncol, styleArea | styleOwnScale | styleNoLabel, 0, 100 );// Plot the Zig ribbon

if ( ZigON == 1 )
Plot( zzHiLo, \"\", ribboncol , styleNoLabel );

//Swing Volume
Volswing = Sum( V, BarsSince( zzup != Ref( zzup, -1 ) ) + 1 );

SwingBar = BarsSince( zzHiLo != Ref( zzHiLo, -1 ) );

// plot Volume at X % from peak and trough
percent = Param( \"PositTextVol%\", 5, 2, 90, 0.5 );

xshift = Param( \"xshift %\", 1.5, 1, 90, 0.5 );

yshift = Param( \"yshift %\", 5, 1, 90, 0.5 );

Miny = Status( \"axisminy\" );

Maxy = Status( \"axismaxy\" );

y = Miny + ( Maxy - Miny ) * percent / 100;

FirstVisibleBar = Status( \"FirstVisibleBar\" );

Lastvisiblebar = Status( \"LastVisibleBar\" );

if ( VolON == 1 )
**
for ( i = Firstvisiblebar + 1; i <= Lastvisiblebar AND i < BarCount - 1; i++ )
**
if ( zzup [i] AND zzup [ i+1] == 0 )
**
PlotText( \"\" + Volswing [ i] , i - xshift , H[i] + yshift , colorWhite );
}

if ( zzup [i] == 0 AND zzup [ i+1] == 1 )
**
PlotText( \"\" + Volswing [ i] , i - xshift , L[i] - yshift , colorBlack );
}
}

PlotText( \"\" + Volswing , i + 2 , zzHiLo, LastValue( ribboncol ) );
}

[B]Đoạn 2:


PriceAtBuy = 0;
HighSinceBuy = 0;
Exit = 0;

for( i=0; i< BarCount; i++)
**
if(PriceAtBuy == 0 AND Buy[i])
**
PriceAtBuy = BuyPrice[i];
}
if(PriceAtBuy > 0)
**
HighSinceBuy = Max(High[i], HighSinceBuy);
if(Exit == 0 AND Buy[i] AND (Close[i] < BuyPrice[i-2] ))
**
Sell[i] = 1;
SellPrice[i] = Min(Open[i+1],(Close[i] < BuyPrice[i-2]));
Buy[i] = 0;
}
if(Exit == 0 AND Close[i] > PriceAtBuy AND HighSinceBuy AND (Close[i] < HighSinceBuy[i-2]))
**
Sell[i] = 1;
SellPrice[i] = Min(Open[i+1],(Close[i] <HighSinceBuy[i-2]));
Buy[i] = 0;
PriceAtBuy = 0;
HighSinceBuy = 0;
}
}
}

1nightdream
17-09-2012, 08:26 AM
Đây là đoạn AFL Code trong phần mềm phân tích kỹ thuật AmiBroker về một Hítogram của hai chỉ báo MA 35 và MA 5 ngày

//histogram for long MA(35) & short MA(5) by microprocessor

Long_MA=MA(Close,35);
Short_MA=MA(Close,5);
Plot(Long_MA,"",colorRed);//can omit this line
Plot(Long_MA,"long moving avg",colorRed,styleHistogram);
Plot(Short_MA,"",colorBlue);//can omit this line
Plot(Short_MA,"short moving avg",colorBlue,styleHistogram);

tronghoangfi
02-10-2012, 12:54 PM
Cái chỉ báo phân tích kỹ thuật này khá hay đấy. Các bác dùng thử nhé

ABKP Benchmark Bar

Bác vui lòng hướng dẫn add code này vào Ami! Em add nó báo lỗi nên không xem được. Cảm ơn bác đã chia sẻ!

tronghoangfi
02-10-2012, 12:58 PM
Có hai đoạn code của phần mềm phân tích kỹ thuật AmiBroker khá hay nhờ các cao thủ cho ý kiến

Đoạn 1:

Đoạn 2:

Bác vui lòng hướng dẫn add code này vào Ami! Em add nó báo lỗi nên không xem được. Cảm ơn bác đã chia sẻ!

tronghoangfi
02-10-2012, 01:03 PM
Thế là bác bị bất lợi rùi. Dân phân tích kỹ thuật đỉnh là phải xài cả hai cùng lúc

Em gửi các bác một chỉ báo mới này. Cái này xài cho AmiBroker nhé :D:D

SetChartOptions(0,chartShowArrows|chartShowDates);
.
.
.
.

Bác vui lòng hướng dẫn add code này vào Ami! Em add nó báo lỗi nên không xem được. Cảm ơn bác đã chia sẻ!

tronghoangfi
02-10-2012, 01:05 PM
Sau đây là code của PatternExplorer:

......................


Bác vui lòng hướng dẫn add code này vào Ami! Em add nó báo lỗi nên không xem được. Cảm ơn bác đã chia sẻ!

tradingpro8x
02-10-2012, 01:47 PM
Bác copy mấy cái code ấy ra dạng TXT (dạng Notepad ấy) rồi cho vào chỗ chứa Template của ổ C:\Program Files\AmiBroker thử vì một số máy làm vụ này thấy hiệu quả đấy

Với lại bác cũng lưu ý vì mình thấy một số cái nó là bộ lọc chứ không phải là chỉ báo nhé

tronghoangfi
03-10-2012, 10:18 PM
Bác copy mấy cái code ấy ra dạng TXT (dạng Notepad ấy) rồi cho vào chỗ chứa Template của ổ C:\Program Files\AmiBroker thử vì một số máy làm vụ này thấy hiệu quả đấy

Với lại bác cũng lưu ý vì mình thấy một số cái nó là bộ lọc chứ không phải là chỉ báo nhé

Em vẫn chưa làm được với công thức ABKP Benchmark Bar, nó báo có lỗi ký tự trong công thức đó. mặc dù 1 số công thức khác cũng theo cách add công thức Ami mà em thường làm thì lại được. Cảm ơn bác!

tigeran
04-10-2012, 08:17 AM
Bác có email không thì gửi lên đây giúp để mình gửi mail cho bác mấy cái file AFL luôn cho nó tiện vì có thể trong quá trình copy lên bọn mình sót hay quá trình pót nó bị lỗi sao đó bác ạ

Định post trực tiếp lên đây nhưng diễn đàn không cho attach file nên chịu :(:(:(

tronghoangfi
04-10-2012, 06:36 PM
Dạ! Email của em là tronghoangfi@yahoo.com . Cảm ơn bác tigeran nhiều!

tigeran
06-10-2012, 03:57 PM
Mình gửi cái tool PTKT của AmiBroker vào mail bác Hoàng rồi nhé. Bác check mail thử :D:D:D

tronghoangfi
09-10-2012, 10:45 PM
Dạ! Cảm ơn bác nhiều! :happy:

binhbinh
03-11-2012, 06:13 PM
Amibroker có nhiều chức năng hay lắm. Mình tìm được bản portable cho nó nè. Bạn nào cần liên hệ mình nhé
Hướng dẫn cụ thể cho những người chưa biết với, các bác so chiêu như thế ae không biết nhìn vào thì ........ vui lòng add hướng dẫn cụ thể ;););)

tigeran
05-11-2012, 08:04 AM
Để cài phần mềm PTKT phân tích kỹ thuật AmiBroker Porttable vào máy các bác làm như sau:

Download Phần mềm Phân tích kỹ thuật AmiBroker ở link sau:

http://share.vn/PKD/AmiBroker.rar

Giải nén file AmiBroker.rar

Copy thư mục vừa giải nén vào C:\Program Files

Vào thư mục C:\Program Files\AmiBroker chuột phải vào Broker và chọn Send to\Desktop\Create shortcut

Sau đó nhấn vào Shortcut trên Desktop. Bâyu giờ thì bác tha hồ mà sử dụng nhé :D

phan91
01-07-2013, 10:59 AM
em mới đọc lại bài này có cái IS này mà ko bít code: anh em nào có up lên đc ko. em cảm ơn
Indicators System (IS):

1. Người sử dụng IS phải chắc chắn rằng mã cổ phiếu được lựa chọn là một cổ phiếu có các chỉ số FA tốt (P/E, ROA, ROE, P/BV v.v…)

2. Người sử dụng IS phải chắc chắn rằng mã cổ phiếu được lựa chọn vừa trải qua 3 thời kỳ : Tăng trưởng – Phân phối – Suy giảm và đang ở trong thời kỳ Tích lũy

3. Sau một thời gian ngừng giao dịch đủ dài, thị trường luôn luôn có một sự thay đổi theo chiều hướng tích cực. Đặc thù của thị trường Việt Nam là có 04 kỳ nghỉ dài : Tết Dương lịch, Tết Âm lịch, Ngày Quốc tế Lao động, Ngày Quốc khánh.

4. Người sử dụng IS phải chắc chắn rằng chênh lệch tính bằng % giữa thị giá tại đỉnh tăng trưởng so với thị giá trung bình của thời kỳ tích lũy phải luôn lớn hơn lợi nhuận kỳ vọng của người sử dụng.

5. Người sử dụng IS phải chắc chắn rằng MACD luôn luôn có phân kỳ dương tối thiểu > 10 phiên giao dịch

6. Người sử dụng IS phải chắc chắn rằng độ rộng của Bollinger Bands đang được thu lại rất hẹp và ổn định > 10 phiên giao dịch

7. Người sử dụng IS phải chắc chắn rằng chỉ thực hiện hành động mua sau khi xuất hiện ngôi sao Doji.

8. Người sử dụng IS phải chắc chắn rằng trong vòng 10 phiên giao dịch gần nhất, mã cổ phiếu được chọn không hề chịu tác động của bất kỳ tin tức có tác động trước hoặc tức thời vào giá mang tính chất thuận lợi hoặc bất lợi

9. Người sử dụng IS phải chắc chắn rằng tính từ thời điểm quyết định mua đến thời điểm mua được, 08 điều kiện trên không hề thay đổi.

10. Người sử dụng IS phải chắc chắn rằng chỉ thực hiện hành động mua khi cả 09 điều kiện trên cùng xuất hiện.

tradingpro8x
01-07-2013, 02:46 PM
Trong mấy cái điều kiện của IS có có điều kiện CB cũng như chu kỳ nên chẳng thể coding được hết đâu

Với lại nếu cứ cứng nhắc theo cái điều kiện của IS thì cuối cùng sẽ chẳng có CP nào được chọn cả bạn ui

tradingpro8x
13-08-2013, 08:31 AM
Lập trình trong AmiBroker:

Cách 1: Sử dụng công cụ Formula Editor:

Vào , chọn Formula Editor hoăc chọn nút có hình cái búa (xem hình bên cạnh)

http://i1202.photobucket.com/albums/bb371/kiendoi/FormulaEditor.png

Cửa sổ Formula Editor sẽ mở ra:
Gõ nội dung code vào cửa sổ (hoặc copy từ nơi khác dán vào)

http://i1202.photobucket.com/albums/bb371/kiendoi/FormulaEditor2.png

Gõ tên cho file code (để lưu lại) và chọn Save (từ menu File/Save hoặc nhấp vào nút Save. Sau đó, đóng cửa sổ Formula Editor .
Trong thí dụ trên tên file là MACross. Sẽ có 1 file tên MACross.afl được tạo ra trong folder Custom của Amibroker (thường mặc định là folder C:\Program Files\AmiBroker\Formulas\Custom).

Cách 2: Dùng NotePad tạo file .afl:

Cũng có thể dùng NotePad gõ nội dung code (hoặc copy từ nơi khác paste vào) cửa sổ NotePad.
Rồi lưu vào folder C:\Program Files\AmiBroker\Formulas\Custom với tên mở rộng là .afl (trong thí dụ trên là MACross.afl).
Lưu ý: Khi lưu nhớ chọn Save as type là All files

Cách 3: Sử dụng file .afl đã có sẵn:

Khi có sẵn files .afl (kể cả do người khác tạo ra). Để sử dụng files .afl, cần copy vào folder C:\Program Files\AmiBroker\Formulas\Custom.
Khi đó, trong Amibroker tên file afl đó sẽ xuất hiện trong mục Custom (trong tab Chart) và có thể sử dụng như các files khác đã có sẵn trong Ami.

1nightdream
13-08-2013, 09:04 AM
Kinh nghiệm phân tích kỹ thuật của mình thì nên xài Cách 3 cho khỏe :D:D:D:D:D

tigeran
19-08-2013, 03:00 PM
Là dân chuyên phân tích kỹ thuật PTKT thì cũng phải tự lập trình chứ bác, chứ chả nhẽ cứ lấy của người khác mãi coi sao được :tungxen::tungxen::tungxen::tungxen::tungxen:

tradingpro8x
23-08-2013, 08:42 AM
Mình thấy lập trình trong phần mềm phân tích kỹ thuật AmiBroker khá giống lập trình trong C+ của Microsoft. Vì vậy, ai đã biết C+ thì có thể coi là một lợi thế khi nghiên cứu :pipe1::pipe1::pipe1::pipe1::pipe1::pipe1::pipe1:: pipe1::pipe1:

tradingpro8x
12-09-2013, 02:42 PM
Mình ủng hộ vụ này, lấy của người khác mãi thì không bao giờ trở thành cao thủ phân tích kỹ thuật được

https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash3/p235x165/1150238_510352475699673_1373827796_n.jpg

quannh
14-09-2013, 11:28 PM
Kinh nghiệm phân tích kỹ thuật của mình thì nên xài Cách 3 cho khỏe :D:D:D:D:D
Đúng là cách 3 là khỏe nhất :):cheers:

quannh
14-09-2013, 11:30 PM
Mình thấy lập trình trong phần mềm phân tích kỹ thuật AmiBroker khá giống lập trình trong C+ của Microsoft. Vì vậy, ai đã biết C+ thì có thể coi là một lợi thế khi nghiên cứu :pipe1::pipe1::pipe1::pipe1::pipe1::pipe1::pipe1:: pipe1::pipe1:
Đúng rồi nó gần giống C++. Mình thì hay chôm về xong coi nội dung nó viết gì thôi. Chỉ code mấy cái đơn giản thôi. 3 năm trước còn code theo yêu cầu của môi giới của mình, nhưng giờ thì lười rồi.

1nightdream
16-09-2013, 08:37 AM
Đồng ý hai tay vụ này. Tuy nhiên thì lấy code của các chuyên gia phân tích kỹ thuật khác về mình nghĩ nên chỉnh sửa lại cho phù hợp với bản thân :goku::goku::goku::goku::goku:

tradingpro8x
17-07-2014, 03:09 PM
Lập trình không quan trọng cao siêu, mình nghĩ quan trọng nhất vẫn là ý tưởng phân tích kỹ thuật độc đáo :afro1:

tigeran
31-03-2015, 09:43 AM
AmiBroker ngày càng phổ biến do giao diện đẹp và cho phép coding thoải mái :D

traderviet
02-04-2015, 08:57 AM
Cái topic này hay quá, mình mới sử dụng ami một thời gian giờ phải tệp tin coding thôi.:jump:

v2htrader
05-04-2015, 02:03 PM
Chỉ báo RSI - With Overbought & Oversold coloured for Amibroker

Home / Các chỉ báo kỹ thuật hay / Chỉ báo RSI - With Overbought & Oversold coloured for Amibroker
Chỉ báo RSI - With Overbought & Oversold coloured for Amibroker
20:25 Các chỉ báo kỹ thuật hay
Chỉ báo kỹ thuật RSI indicator With Overbought & Oversold coloured được chỉnh sửa về màu sắc để giúp Nhà đầu tư dễ dàng nhận biết thị trường ( cổ phiếu ) đang ở trong tình trạng quá mua hoặc quá bán.

Các chỉ số mặc định :

• Period 14
• Plot ( 30/50/70 )
( có thể thay đổi )

traderviet
11-04-2015, 08:42 AM
theo mình thì giao diện đẹp mắt, thoáng dễ nhìn thì mới phân tích kỹ thuật dễ dàng chứ rối rắm và không biết tùy biên chỉnh sửa tham số thì hơi khó khăn trong phân tích kỹ thuật lắm. Vì vậy biết chút ít về IT, CODING thì cũng hay nhỉ. hihihi

quanghnn
11-04-2015, 08:59 AM
tuyệt chiêu này là cái j vậy

quanghnn
11-04-2015, 09:03 AM
thì ra là code à

tigeran
16-04-2015, 01:08 PM
Phải coding mới là tuyệt chiêu Phân tích kỹ thuật chứ bác :D:D:D:D

quanghnn
17-04-2015, 06:19 PM
nhiều chức năng hay

Secret25
20-06-2015, 12:40 AM
Quan trọng là bạn đánh chiến thuật như thế nào. Còn coding nhìn có vẻ rất pro nhưng cũng k mang lại profit nếu bạn k có chiến thuật tốt

traderviet
01-07-2015, 04:40 PM
uhm, mình cũng đồng ý là cần có chiến lược tốt hiệu quả. Còn coding chỉ là hỗ trợ

desong91
02-03-2016, 05:45 PM
Ai giúp mình tạo code vẽ 2 đường Roc 5 và 9 với. Thanks nhiều nhiều!

tigeran
03-03-2016, 08:25 AM
Ai giúp mình tạo code vẽ 2 đường Roc 5 và 9 với. Thanks nhiều nhiều!

Bạn tham khảo trong đây thử vì mình ít code trong AmiBroker

http://www.amibroker.com/guide/afl/roc.html

http://www.wisestocktrader.com/indicators/1660-roc-price-change

dreampoohnguyen
16-01-2017, 11:18 PM
Anh gửi cho em được không ạ. Mail em là thienminh8894@gmail.com
Em cảm ơn anh ạ

trongtin123
18-01-2017, 10:54 AM
E tìm thấy cái này: mấy bác vào youtube.com
bấm tìm: Tuyệt chiêu Amibroker sẽ thấy

trongtin123
18-01-2017, 01:29 PM
youtube.com/watch?v=0tuv1kyn1Js

đây nhé. code chuẩn

pasal
16-02-2017, 09:59 AM
Em mới dùng ami không rõ lắm Cùng lúc em có thể sử dụng nhiều công thức không hay chỉ được sử dụng 1

JokerZ
13-09-2017, 09:14 AM
Bạn tham khảo trong đây thử vì mình ít code trong AmiBroker

http://www.amibroker.com/guide/afl/roc.html

http://www.wisestocktrader.com/indicators/1660-roc-price-change

Chủ yếu là vấn đề ý tưởng cá nhân, chứ code dựng sẵn chắc gì đã hay :heo3:

Hieu Tran
31-10-2017, 01:33 PM
Các bác cho em hỏi mới học code của Amibroker thì bắt đầu tư đâu vậy?

Hieu Tran
07-11-2017, 02:43 PM
Có bác nào biết nguồi học code Amibroker ở đâu kg?