[amibroker] Re: How to get a number from an array

 

Hi,

Some comments inline,

> Buy = IIf(<entry condition>,True,0);

You don't need the IIF here. Buy = <entry condition> will give you the same result.

> EntryBar = IIf(<entry condition>,BarIndex(),0);

> for( i = EntryBar; i < BarCount; i++ )
> {
>   PeakValue = HHV(H,(Bar - i);
   ....
> }

You should be able to do the above without a loop. Try the below in Explore and see if it is giving you what you are after,
Filter = 1;
entryCondition = mtRandomA() > 0.5;
PeakValue = HHV(H, BarsSince(entryCondition) + 1);
AddColumn(entryCondition, "EC");
AddColumn(BarsSince(entryCondition) + 1, "HHV period");
AddColumn(H, "High Value");
AddColumn(PeakValue, "Peak since Entry");

__._,_.___

Posted by: rosenberggregg@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
**** 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/


.

__,_._,___


EmoticonEmoticon