[amibroker] How to get a number from an array

 

Hello there,

in order to obtain the highest peak value of the bars after the entry bar  I've written this code:


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

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

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


This code doesn't work; the AFL reports the error nr. 6: "Condition in IF, WHILE, FOR statement must numeric or boolean type; you cannot use array here...".

How can I change the variable EntryBar from an array into a number? I've tried "Bar = EntryBar" but it's the same thing.

Thanks to anyone have an answer.


Regards





__._,_.___

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


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv