Thanks R0n1n
I was trying to rename it after I downloaded, not before. All good now..
And thankyou GP for all the work you have posted here, awesome..
Buy = My defined Buy signal;
Short = My defined Short Signal;
cback = Param("Countback?", 20, 1, 100, 1);
cblLineL = GP_CountBack(cback, 1);
CblLineS = GP_CountBack(Cback, 0);
StopL = GP_CreateStop(cblLineL, Close, Buy, Null, "", -1, -2, 1);
StopS = GP_CreateStop(cblLineS, Close, Short, Null, "", -1, -2, 0);
Sell = <My defined Sell Signal> || StopL < Ref(StopL, -1);
Cover = <My defined Sell Signal> || StopS > Ref(StopS, -1);
I've developed a plugin DLL for AmiBroker to generate trailing stop plots from any type of data. It calculates a proper trailing stop array from a specified buy date, where the buy date can either come from a portfolio-like file or be passed from the AFL code. With the sample AFL code provided, the latter is used when a date range has been set, making the beginning of the range the buy date.
The DLL also includes a Guppy Count Back Line function to allow that to be used for trailing stops (there's no Count Back entry function though).
The attached ZIP file includes the following files:
GP_Stops.dll - the plugin code
GP_ATRStop.afl - AFL code for an ATR trailing stop indicator
GP_CBStop.afl - AFL code for a Guppy Count Back trailing stop indicator
GP_EMAStop.afl - AFL code for a simple EMA trailing stop indicator
GP Stops DLL.pdf - an instruction sheet
Pfolio1.csv - a sample portfolio file
See the PDF file for instructions.
These files can be freely distributed and modified. The only thing I ask is that if you modify the AFL code and pass it on to someone else, make it clear that it's not my original code by changing the filename or adding a comment to that effect.
Let me know if you have any problems with it or any comments.
Cheers,
GP
I am new to Ami. too and I don't know the AFL very well. With the trailing stops is it just a matter of pasting the code anywhere into a formula?Thanks for contributing this snippet GP. I was glad I found this post without having to search through your entire post history (forum search function worked well for once!) Remember seeing a it a while back and never downloaded it because I was running fcharts. Finally purchased amibroker a few months ago.
edit - did they reset our post counts here on asf?
I am new to Ami. too and I don't know the AFL very well. With the trailing stops is it just a matter of pasting the code anywhere into a formula?
No post count reset. Have you posted before?
Hey Wysiwyg, I haven't messed around with AFL to much but I do come from a programming background(more specifically object orientated languages like VB and java script). I've pretty much printed out the amibroker manual to get an idea of the functions and conditional statements tonight. I can send you a PM when I attempt running GP's stop plot code with instructions to implement it if you like.
Yeah I've posted before, even entered the competition a few times. That's one bonus I guess I can meet the daily post count again to enter it.
I tried backtesting trade formulas from the Ami. site but throwing darts would give better backtest results. I plan to grow into AFL formulas with Ami. so in no hurry.
Need not send the PM matey, thanks anyway. Strange how your post count has disappeared but your actual posts will still be on the site. Remember any threads ?
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.