alexwang7777 發表於 10-6-18 14:49

Aggressive AFL Code (ATR SYSYTEM)

SetBarsRequired(1000000, 1000000);
SetChartOptions(2,chartShowArrows|chartShowDates);
SetTradeDelays(0,0,0,0);

period = Param("Period", 13, 1, 240, 1);
mult = Param("Multiplier", 1.7, 1, 240, 0.1);
showPrice = ParamToggle("Show Price","No|yes",1);
showArrows = ParamToggle("Show Arrows","No|yes",1);
showRibbon = ParamToggle("Show Ribbon","No|yes",1);

f=ATR(period);

VS = Close;
trend = 0;
HighC=0;
Lowc=0;


for( i = period+1; i < BarCount; i++ )
{

vs = vs;
trend = trend;
highC = HighC;
lowc = lowc;

if ((trend>=0) && ( C <VS ))
{
trend =-1;
HighC = C;
lowc = C;
}

if ((trend<=0) && (C >VS))
{
trend=1;
HighC = C;
lowc = C;
}

if (trend==-1)
{
if (C<lowc) lowc = C;
VS= lowc+ (mult*f);
}


if (trend==1)
{
if (C>HighC) HighC = C;
VS= HighC-(mult*f);
}

}


Buy=Cross(Trend,0);
Sell=Cross(0, Trend);
Short = Sell;
Cover = Buy;

if (ShowPrice) Plot(Close,"Close",colorBlack,styleCandle);
Plot(VS, "Vol Stop",IIf(trend==1,10,11 ),styleThick);

mkol = IIf( Trend==1, 10, 11);
if (ShowRibbon) Plot(5, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel|styleNoTitle, 0, -5);

shape = Buy * shapeUpArrow + Sell* shapeDownArrow;
if (ShowArrows) PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low-f, High+f));
AlertIf( Buy, "SOUND C:\\Windows\\Media\\timeout.wav", "Sell " + C,2,1+2,1);
AlertIf( Sell, "SOUND C:\\Windows\\Media\\timeout.wav","Buy " + C,1,1+2,1);


alexwang7777 發表於 10-6-18 14:50

AlertIf( Buy, "SOUND C:\\Windows\\Media\\timeout.wav", "Sell " + C,2,1+2,1);

AlertIf( Sell, "SOUND C:\\Windows\\Media\\timeout.wav","Buy " + C,1,1+2,1);
買賣點會回報聲音........音效請自己改喔^^

mimi 發表於 10-6-18 17:31

推 ~~~   好東西~~謝謝分享~~~

mndmnd 發表於 12-4-29 14:31

{:4_187:}看看哦~~~~~~

jacky768120 發表於 12-8-17 03:13

謝謝你的分享,研究學習看看

pigpig123 發表於 12-8-17 08:42

不錯,很厲害 {:4_163:}
頁: [1]
查看完整版本: Aggressive AFL Code (ATR SYSYTEM)