[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Probably silly coding error;



PureBytes Links

Trading Reference Links

Hi,

I doubt that you want to use hard coded element references like that. 
You are effectively stating that you want to know if the ADX of 
exactly the second bar is greater than that of exactly the first bar, 
regardless of what bar you happen to be on at the time of evaluation 
(e.g. even if you are on bar 1200, you will still be basing your 
trend calculation on the values of bar 0 and bar 1 which is not very 
useful).

More likey, you would want to do something along the lines of:

MyADX = ADX();
trend1 = MyADX > Ref(MyADX, -1);

This way, the value of trend1 is updated for each bar using the 
current bar and the one immediately preceding it.

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "Tony Grimes" <Tonez.Email@xxx> 
wrote:
>
> Try This:
> 
> myADX = ADX();
> trend1 = MyADX[0] > myADX[1];
> 
> 
> On Sat, Oct 11, 2008 at 8:27 AM, noemeenswat <noemeenswat@xxx> 
wrote:
> 
> >   I want to determine or ADX is uptrending or downtrending. 
Therfore I
> > coded:
> >
> > trend1=ADX()[0]>ADX()[1];
> >
> > This should result in a true or false for trend1 depending on
> > trenddirection of ADX. It gives however a consistent error 30 
syntax
> > error.
> >
> > If I replace ADX() by H, C etc it works fine. Can someone explain 
what
> > I'm doing wrong?
> >
> > Thanks
> > Wilco
> >
> >  
> >
>



------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> 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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/