PureBytes Links
Trading Reference Links
|
--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> John,
>
> If in fact Peak is supposed to retain the value of the previous Peak when not a new Peak (as opposed to zero shown in my previous post) and similarly for Valley, then my earlier post would need to be modified to the following (also corrected to no longer use the AmiBroker keyword Peak as a variable name)
>
> BP1 = Ref( BP, -1 );
> BP2 = Ref( BP, -2 );
>
> NewPeak = ( BP1 > BP AND BP1 > BP2 );
> Peaks = IIF( NewPeak, BP1, ValueWhen( NewPeak, BP1 ) );
> NewValley = ( BP1 < BP AND BP1 < BP2 );
> Valleys = IIF( NewValley, BP1, ValueWhen( NewValley, BP1 ) );
>
> AvgPeak = MA( Peaks, 50 );
> FracAvgPeak = Fraction * AvgPeak;
> AvgValley = MA( Valleys, 50 );
> FracAvgValley = Fraction * AvgValley;
>
> Mike
Thanks Mike, that too was very helpful.
(You might want to see my prior post about constant confusion[sic].)
Best,
John
------------------------------------
**** 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/
|