PureBytes Links
Trading Reference Links
|
Thank you Ara and Herman for your response. After
reading your messages, I looked deeper into the code
and found an array wasn't zero up to the point I
wanted. Yep, the code needed to be changed. I could
not figure out how to do it without a loop so I wrote
one (below). I cannot get it to run because I don't
know how to convert the present value of an array to a
number. The following gets an error.
C0=CCI(7);
C1=CCI(12);
C2=CCI(32);
BSC[0]=0;
BSCC[0]=0;
FullWidthBars[0]=BarIndex()-BarsSince(Cross(0,C2));//error
here
for (i=FullWidthBars[0];i>BarIndex();i++)
{
if(C0>C1 AND Ref(C0,-1)<Ref(C1,-1) AND BSC[0]==0)
BSC[0]=1;
if (BSC[0]>0 AND C0>C2 AND Ref(C0,-1)<Ref(C2,-1))
BSCC[0]=BSCC[0]+1;
}
If I use "Selectedvalue", I get a constant rather than
incrementing numbers for each bar. The documentation
says it returns not the value at the current bar but
the value at a selected time.
This is my first attempt at writing pattern matching
code. I want a variable lookback period which is
triggered by one event and then narrowed by the first
occurance of the second event following event 1. Then
I count the occurrances of a third event.
I just cannot get it to work because of type mismatch.
Help from anyone would be appreciated.
Robert
--- Robert Nemeth <rjnemeth@xxxxxxxxx> wrote:
> Could someone tell me how to convert current array
> value to number? I think this is my problem with:
>
>
Sum(Cond1,HHV(BarsSince(Cond2)+1,BarsSince(Cond3)))<=1
>
> The variable doesn't seem to be correct in the
> Period
> field of "SUM" or "HHV". I tried "SelectedValue" but
> it did not work and probably is not designed to
> function this way for a backtest.
>
> Tnx
> Robert
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - More reliable, more storage, less spam
> http://mail.yahoo.com
>
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|