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

Re: Re[2]: [amibroker] Re: A shorter syntax to reference past elements of array



PureBytes Links

Trading Reference Links

Title: Re[2]: [amibroker] Re: A shorter syntax to reference past elements of array
Yes I would agree, and I was thinking about that too and liked it, but implementing this would
a) potentially break existing code (if anybody uses H1 or similar for any other purpose)
b) potentially cause the same confusion as C@x or C#1 (positive number for referring past)
 
Similar solution is C.1 , H.1 (using dot "member of") and althogh it does not suffer from a)
it suffers from b). And no, C.-1 is not an option, since it is visually to similar to C-.1
(which is valid statement Close - 0.1 )
 
All in all, it seems that it would be hard to come up with solution that would please everybody.
 
Theoretically just predefining 5 variables O1, L1, H1, C1, V1 just for "previous bar value of OHLC"
should address 90% of most common "easy" situations, and then a) is not a big problem
since it is only 5 variables.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Herman
To: Graham
Sent: Friday, February 20, 2009 1:59 AM
Subject: Re[2]: [amibroker] Re: A shorter syntax to reference past elements of array

fwiw, I routinely define these values at the top of my code:


O1         = Ref(O,-1);

L1         = Ref(L,-1);

H1         = Ref(H,-1);

C1         = Ref(C,-1);


and also sometimes O2,... O3, ... and so on. dito for other often used statements. 


NONE of the suggested formats can beat this!


herman



Thursday, February 19, 2009, 7:36:01 PM, you wrote:


> I think using the Ref should be kept just the way it is. I cannot see

> how any alternative method would be less confusing to newbies.


> btw you can change

> P = (Ref(H,-1) + Ref(L,-1) + Ref(C,-1)) / 3;

> to

> P = Ref(H+L+C,-1) / 3;

> and thus reduce the amount of typing :)




__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___