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

[amibroker] nested IIF statement, can this be refined?


  • Date: Sat, 06 Feb 2010 15:47:30 -0000
  • From: "cawalton111" <cawalton111@xxxxxxxxx>
  • Subject: [amibroker] nested IIF statement, can this be refined?

PureBytes Links

Trading Reference Links

Hi all,

I have the following nested IIF statement but I suspect it is a clumsy beginners effort and would like to know if this can be parred down and perhaps extended beyond the 11 periods it covers, Thanks, Cliff

AvgDnPen=IIf((DnPenSum/DnPenCount > 0),DnPenSum/DnPenCount,
IIf(Ref(DnPenSum/DnPenCount,-1)> 0,Ref(DnPenSum/DnPenCount,-1),
IIf(Ref(DnPenSum/DnPenCount,-2)> 0,Ref(DnPenSum/DnPenCount,-2),
IIf(Ref(DnPenSum/DnPenCount,-3)> 0,Ref(DnPenSum/DnPenCount,-3),
IIf(Ref(DnPenSum/DnPenCount,-4)> 0,Ref(DnPenSum/DnPenCount,-4),
IIf(Ref(DnPenSum/DnPenCount,-5)> 0,Ref(DnPenSum/DnPenCount,-5),
IIf(Ref(DnPenSum/DnPenCount,-6)> 0,Ref(DnPenSum/DnPenCount,-6),
IIf(Ref(DnPenSum/DnPenCount,-7)> 0,Ref(DnPenSum/DnPenCount,-7),
IIf(Ref(DnPenSum/DnPenCount,-8)> 0,Ref(DnPenSum/DnPenCount,-8),
IIf(Ref(DnPenSum/DnPenCount,-9)> 0,Ref(DnPenSum/DnPenCount,-9),
IIf(Ref(DnPenSum/DnPenCount,-10)> 0,Ref(DnPenSum/DnPenCount,-10),
Ref(DnPenSum/DnPenCount,-11))))))))))));
 

PS its related to the Elder SafeZone stop calc's.



------------------------------------

**** 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/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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