[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Atc Loop Demo



PureBytes Links

Trading Reference Links

Very impressive Graham, you are a clever dude

--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> Just thought I would throw in this loop for plotting support 
resistance
> lines on price chart
> 
> //Support and resistance levels.
> 
> //using RSI
> 
> //Load into Indicator Builder
> 
> //Sensitivity of the levels can be changed with the variables
> 
> //Can test different numbers live with the Param function ctrl-R 
with open
> pane
> 
> RSIperiod = Param("RSI p",14,3,30,1);
> 
> EMAperiod = Param("EMA p",5,3,10,1);
> 
> Percent = Param("ZIG %",9,5,15,1);
> 
> HHVperiod = Param("HHV p",6,3,10,1);
> 
> NumLine = Param("Num Lines",8,1,20,1);
> 
>  
> 
> //Base = RSI(RSIperiod);
> 
> Base = EMA(RSI(RSIperiod),EMAperiod);
> 
>  
> 
> GraphXSpace=0.5;
> 
> Plot(C,"",colorBlack,styleCandle);
> 
>  
> 
> for( i = 1; i <= numline; i++ )
> 
> {
> 
> ResBase = LastValue(Peak(Base,Percent,i));
> 
> SupBase = LastValue(Trough(Base,Percent,i));
> 
> Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", 
colorRed,
> styleLine);
> 
> Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level",
> colorGreen, styleLine);
> 
> }
> 
> Title = Name() + "; " + Date() + ": Support & Resistance Levels 
using RSI: "
> + EncodeColor(colorGreen)+ "Support Levels are Green;
> "+EncodeColor(colorRed)+ "Resistance Levels are Red:
> "+EncodeColor(colorBlack)+"Number of lines of each ="+WriteVal
(numline,1) ;
> 
>  
> 
> Cheers,
> Graham
> 
>  <http://groups.msn.com/ASXShareTrading>
> http://groups.msn.com/ASXShareTrading
> 
>  <http://groups.msn.com/FMSAustralia> 
http://groups.msn.com/FMSAustralia
> 
> -----Original Message-----
> From: Herman vandenBergen [mailto:psytek@x...] 
> Sent: Saturday, 26 April 2003 12:30 PM
> To: Amibroker@xxxxxxxxxxxx Com
> Subject: [amibroker] Atc Loop Demo
> 
>  
> 
> DT Challenged me for a loop demo :-) so here is one, attached.
> 
>  
> 
> This shows how to optimize a system using loops, substitute your 
own trading
> system and vary the parameter's function and values. This was my 
first
> application for testing the new looping function. Here I use a 
Loop in an
> Exploration to optimize the system to three degrees. As i go along 
I save
> the best Equities obtained with the 2nd and 3rd opt parameters in a
> stock-specific Calibration file - using the AddToComposite(). I 
read back
> the data from the Composite and display the results in The result 
table.
> 
>  
> 
> The lower part is repeats the trading system and shows how you can 
read back
> parameters and use them into your system.
> 
>  
> 
> Throughout you will find some tricks, such as to display zero-based
> exploration data at the current date range in your result table.
> 
>  
> 
> Now you ask: why do all this work? Some reasons:
> 
>  
> 
> 1) You can backtest groups of stocks and save their individual 
optimization
> values (somebody wished for this on the list)
> 
> 2) You don't ever have to type in optimized values, they are read 
from your
> disk.
> 
> 3) Opt1 in the Optimization part is, in this demo, assigned to a 
period, but
> it could just as well be the value of a trend indicator. This 
would allow
> you to create calibration values to perform under various trending
> conditions. You would optimize a large number of stocks and create
> (automatically) a calibration file for each stock. Then when you 
are using
> your trading system you would obtain the Opt1 from your trending 
indicator
> and based on it, you would select the other two parameters. What 
do you
> have: an adaptive trading system.
> 
>  
> 
> Have fun, I hope some others can explain any questions that may 
come up. I
> have to get back to another project :-)
> 
>  
> 
> best regards,
> 
> Herman.
> 
>  
> 
> Ps. If you click the Check button you'll get a Look-Ahead error, I 
believe
> this is due to the using the Atc. The trading system is incidental 
anyway -
> you should substitute your own!
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor
> 
> 
> 
> 
>  
> 
<http://rd.yahoo.com/M=247865.3003379.4507215.2595810/D=egroupweb/S=1
7056321
> 98:HM/A=1482387/R=0/*http:/ads.x10.com/?
bHlhaG9vaG0xLmRhd=1051277302%3eM=247
> 
865.3003379.4507215.2595810/D=egroupweb/S=1705632198:HM/A=1482387/R=1
=105127
> 7302%
3eM=247865.3003379.4507215.2595810/D=egroupweb/S=1705632198:HM/A=1482
38
> 7/R=2> 
> 
> 
>  
> <http://us.adserver.yahoo.com/l?
M=247865.3003379.4507215.2595810/D=egroupmai
> l/S=:HM/A=1482387/rand=595547471> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/cjB9SD/od7FAA/AG3JAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/