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

RE: [amibroker] AmiBroker 4.31.0 BETA Examples



PureBytes Links

Trading Reference Links










Tomasz

A bit slow, but thanks for the latest Beta. The if and for
functions are fantastic. Opens a wide area for me without having to resort
directly to script. Saves a lot of lines and time having to assign variables,
arrays and linking these back to AFL.

 



<font size=3 color=teal
face="Times New Roman">Cheers,
Graham

<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/ASXShareTrading

<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/FMSAustralia



<span
>-----Original Message-----
From: <font
 face=Tahoma>Tomasz Janeczko<font
face=Tahoma> [mailto:amibroker@xxxxxx] 
Sent: Monday, 14 April 2003 3:54
PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] AmiBroker
4.31.0 BETA Examples

<font size=2
face="Times New Roman"> 



<font size=2
face="Times New Roman">Hello,





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">While IIF works on ARRAY,





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">if/else works on
INDIVIDUAL number/boolean (element of the array).





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Therefore you should
write either





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">a1 = IIF( C > Ref( C,
-1 ), 1, 0 );





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">(or even: a1 = C >
Ref( C, -1 );





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">or iterate:





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">for( i = 1; i <
BarCount; i++ )





<font size=2
face="Times New Roman">{





<font size=2
face="Times New Roman">   if  (
Close[ i ] > Close[ i - 1 ] )





<font size=2
face="Times New Roman">      
a1[ i ] = 1;





<font size=2
face="Times New Roman">   else





<font size=2
face="Times New Roman">       a1[
i ] = 0;





<font size=2
face="Times New Roman">}





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">It is important to
understand that IIF is a FUNCTION that works on arrays,





<font size=2
face="Times New Roman">while if/else is control
flow STATEMENT.





<font size=2
face="Times New Roman">Function just evaluates
all arguments and returns value(s)





<font size=2
face="Times New Roman">Control flow statement
changes program flow.





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">This is fundamental
difference.





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Best regards,
Tomasz Janeczko
amibroker.com







<span
>----- Original Message ----- 





<font
size=2 face=Arial>From: <a
href="" title="jcasavant@xxxxxxxxxxxx">Jayson 





<span
>To:<font
face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx






<span
>Sent:<font
face=Arial> Monday, April 14, 2003 7:55 AM





<span
>Subject:<font
face=Arial> RE: [amibroker] AmiBroker 4.31.0
BETA Examples





<font size=2
face="Times New Roman"> 





<font size=2 color=blue
face=Arial>Steve,





<font size=2 color=blue
face=Arial>Your example
makes sense yet does not seem to work for me. Else seems to be ignored . Using
the IIF this would simply be ......





<font size=2 color=blue
face=Arial>a1=iif(c>ref(c,-1),1,0); 
I am certainly missing something here.... your input appreciated..





<font size=2 color=blue
face=Arial>jayson





<font size=2
face="Times New Roman"> 





<font size=2 color=blue
face=Arial><img
border=0 width=752 height=638 src="gif00210.gif"
align=baseline>





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman"> 



<font size=2 color=blue
face=Arial>Jayson


-----Original Message-----
From: Steve Dugas
[mailto:sjdugas@xxxxxxxxx]
Sent: Sunday, April 13, 2003 11:25
AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] AmiBroker
4.31.0 BETA Examples



<font size=2
face="Times New Roman">Hi Ken,





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">I think the concept of
loops and if-then-else is the same in all languages. I imagine you
 could read up on it at many websites (e.g. - MSDN scripting
site). Once you grasp the concept, it is just a matter of using AFL syntax. You
would probably use it mostly for iterating your arrays if you wanted to do
that. Here is a simple pseudo-code - try coding it in AFL:





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">For (SecondBar to
LastBar)





<font size=2
face="Times New Roman">  If (Today's Close
> Yesterday's Close)





<font size=2
face="Times New Roman">   
MyArray = 1





<font size=2
face="Times New Roman">  Else





<font size=2
face="Times New Roman">   
MyArray = 0





<font size=2
face="Times New Roman">Plot MyArray





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Of course, please feel
free to ask for help!





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Steve





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">----- Original Message
----- 







<font
size=2 face=Arial>From: <a
href="" title="amibroker@xxxxxx">Tomasz Janeczko 





<span
>To:<font
face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx






<span
>Sent:<font
face=Arial> Sunday, April 13, 2003 10:39 AM





<span
>Subject:<font
face=Arial> Re: [amibroker] AmiBroker 4.31.0
BETA Examples





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Ken,





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Very nice story :-)





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">As per your request,
attached is a Parabolic SAR formula 





<font size=2
face="Times New Roman">that I have rewritten
from JScript version





<font size=2
face="Times New Roman">(<a
href="">http://www.amibroker.com/library/detail.php?id=242)





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Best regards,
Tomasz Janeczko
amibroker.com





<font size=2
face="Times New Roman">----- Original Message
----- 



<font size=2
face="Times New Roman">From: "Ken Close"
<closeks@xxxxxxxx>





<font size=2
face="Times New Roman">To: <<a
href="">amibroker@xxxxxxxxxxxxxxx>





<font size=2
face="Times New Roman">Sent: Sunday, April 13,
2003 4:05 PM





<font size=2
face="Times New Roman">Subject: RE: [amibroker]
AmiBroker 4.31.0 BETA Examples







<font size=2
face="Times New Roman"> 



<font size=2
face="Times New Roman">> Tomasz:
> 
> As always, you have good sound advice.  However......
> 
> You say, "Here is a fast sports car, very versatile and
powerful.  It
> has 7 forward gears, but if you are a beginner, do not worry....always
> stay in maximum of 4th gear. Plenty of nice driving is possible in 4th
> gear.   Wait until you become more experienced before you try
gears 5,
> 6, and 7."
> 
> I say, "Thank you for providing such a nimble sports car, but I am in
a
> race, and I do not think I can finish even 10th in this race, until I
> get out past 4th gear.  If you or others would just provide some more
> examples of how to use 5th and 6th gear, then I could more confidently
> try them. Maybe even copy your use of them. Then, probably, I will have
> enough experience to try 7th gear on my own."
> 
> More examples is all I am asking for....my objective is not to stay in
> 4th gear.
> 
> Thanks,
> 
> Ken
> 
> -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@xxxxxx] 
> Sent: Sunday, April 13, 2003 9:47 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] AmiBroker 4.31.0 BETA Examples
> 
> Ken,
> 
> > First, additional kudos to Tomasz for another step-jump in capability
> of
> > Amibroker.
> Thank you.
> 
> > Second, a caution, in marketing terms, of having capability that is
so
> > hard to apply for "non-programmers", beginners, and
non-technical
> types
> > that the extra capability is viewed not as an advantage or benefit,
> but
> > just the opposite.
> 
> The beginners don't really need to jump into deep water right from
> the start as AFL still supports "old-way" of work.
> 
> When you write
> 
> TypicalPrice = (H+L+C) /3;
> 
> it still operates on H, L, C arrays and produces array so no
> looping is needed.
> 
> New features are added as 'extra' stuff and do not
> change the way old statements work.
> 
> > I apologize - but may speak for many hidden lurkers - that I have
just
> > mastered the idea that "every AFL statement only executes
once", but
> now
> > I must scramble to reorient my brain for repeated iterations thru AFL
> > statements.
> 
> See above - you don't need really to write loops if you don't want them.
> All previously written code will execute the same way as before.
> 
> Unless you use a while and/or for loop nothing has really changed.
> 
> So, you don't really need to "re-orient your brain" :-)
> 
> You can view new features as a replacement of JScript/VBScript.
> You may use these new features only when you needed to use
> scripting in previous versions.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: <a
href="">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/

> 
> 
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor
---------------------~-->
> Make Money Online Auctions! Make $500.00 or We Will Give You Thirty
Dollars for Trying!
> http://us.click.yahoo.com/yMx78A/fNtFAA/i5gGAA/GHeqlB/TM
>
---------------------------------------------------------------------~->
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: <a
href="">amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html

> 
> Your use of Yahoo! Groups is subject to <a
href="">http://docs.yahoo.com/info/terms/ 
> 
> 
> 

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


Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.




<font size=2
face="Times New Roman">

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


Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.



Send BUG REPORTS to bugs@xxxxxxxxxxxxx<font
face="Courier New">
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx 
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.




<font size=2
face="Times New Roman">



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


Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.











Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.




Attachment: Description: ""