- Joined
- 11 May 2005
- Posts
- 573
- Reactions
- 3
Great work dude! What I want to know is, how did I not see this in december Im currently doing up a swing trading system for forex. I'll keep you posted how it works with that.
// ATR Trailing stop - stevo 2006
// When stop line drops exit is triggered.
multiplier = Param("ATR Multiplier", 2, 0, 10, 0.1);
myATR= multiplier*ATR(10); // calculate ATR
initial=C-myATR; // raw stop - not racheted
stop[ 0 ] = Close[ 0 ];
for( i = 1 ; i < BarCount; i++)
{
if( Close[ i ] > stop[ i - 1])
{
temp = Close[ i ] - myATR[ i ];
if( temp > stop[ i - 1 ] ) stop[ i ] = temp;
else stop[ i ] = stop[ i - 1 ];
}
else
stop[ i ] = initial[ i ];
}
Plot( stop, "ATR Stop", colorRed, styleLine);
Sorry, the AFL files are set to read-only, something that my revision control system does. For some reason AmiBroker always gives that error when trying to load a read-only AFL file (don't ask me why it needs to write to the file).
Anyway, select all the AFL files and then go into the Properties dialog and uncheck the Read-Only checkbox.
Despite that error though, the indicator should still load and work.
Cheers,
GP
cback = Param("Countback?", 20, 1, 100, 1);
GraphXSpace = 10;
Plot(Close, "Price", -1, styleCandle);
e30 = EMA(Close, 30);
e60 = EMA(Close, 60);
cblLine = GP_CountBack(cback, True);
Stop = GP_CreateStop(cblLine, Close, Null, Null, "", -1, -1, True);
Buy = Cross(e30, e60);
Sell = Stop < Ref(Stop, -1);
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
Stop = IIf(Flip(Buy, Ref(Sell,-1)), Stop, Null);
Plot(e30, "EMA(30)", colorRed, styleLine);
Plot(e60, "EMA(60)", colorGreen, styleLine);
Plot(Stop, "Stop", colorBlue, styleLine | styleThick | styleDots);
PlotShapes(IIf(Buy, shapeUpTriangle, shapeNone), colorBlue, 0, Low, -30);
PlotShapes(IIf(Sell, shapeDownTriangle, shapeNone), colorBlue, 0, Low, 30);
I can't seem to do anything with this file except opening it in Excel. Can anyone tell me how to access the dll file and AFL files.
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.