PureBytes Links
Trading Reference Links
|
In your loop this and other components like this would appear to be
problematic ...
LLV(z[i],5)
LLV operates on an array, not on an individual element of an array ...
You could calculate something like ...
LLV5 = LLV(z, 5)
Prior to the loop and then check
LLV5[i] in the loop ...
--- In amibroker@xxxxxxxxxxxxxxx, "David Jennings"
<david.d.jennings@xxx> wrote:
>
> Hi,
> I'm very new to AmiBroker and having a conceptual problem with the
coding language.
>
> I've implemented some code based on an alertif. However, I now want
to extend it to do several additional things when the alert is
triggered e.g. write to a file, plot shapes on the screen dependent
on type of alert etc etc. Thus have described a loop in order to
implement an if then else
>
> I'm sure it's patently obvious - here is what I have so far
>
> _SECTION_BEGIN ("Test");
> z = CCI(14);
> LSMA = LinearReg(C, 21);
> EMA34 = EMA(C,34);
> test2 = False;
> // this alert works fine
> AlertIf ( HHV(z,5) < 0 AND
> LLV(z, 5) < -100 AND Ref(z,-1) >-100 AND z < (Ref(z,-1)-5) AND Ref
(z,-1) > Ref(z,-2)
> AND z >-130 AND C < EMA34 AND EMA34 < Ref(EMA34,-1) AND C < LSMA
AND LSMA < Ref(LSMA,-1) ,
> "SOUND C:\\Program Files\\Ahead\\Nero\\Trumpet1.wav", "Audio
alert", 1 );
>
> // this gives error 6:
>
> for (i = 34; i < BarCount; i++)
> {
> if (LLV(z[i],5) >0 AND HHV(z[i], 5) > 100 AND z[i-1] <100 AND z
[i] > z[i-1]+5 AND z[i-1] < z[i-2]
> AND z[i] <130 AND C[i]> EMA34[i] AND EMA34[i] > EMA34[i-1] AND C
[i] > LSMA[i] AND LSMA[i] > LSMA[i-1])
> {
> test2 = True;
> AlertIf(test, "SOUND C:\\Program
Files\\Equis\\MetaStock\\Experts\\STB.wav", "Audio alert", 2 );
> }
> test2 = False;
> }
>
> _SECTION_END();
>
> Grateful for a pointer in the correct direction
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.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/
|