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

[amibroker] Re: Converting selectedbar and lastvalue to...



PureBytes Links

Trading Reference Links

Ara said just use the variable. For instance C is an array and using 
C will point to the last value, or the current bar, in the array. To 
point to a bar prior to the current one use Ref(C, -n); where n is 
the number of bars prior to the current one. Replace C with the array 
you want to get the value for.

Use LastValue when you need a value and not an array. An example is 
in an IF statement. IF() cannot take an array and you have to get the 
value. If you want the value of some previous value use LastValue(ref
(c,-n)); 

If your results get confusing dump it to the interpretation window so 
you can compare the values with what you expect them to be. Use 
something like this:

printf(numtostr(lastvalue(c), 1.2)); //  current value of c
printf("\n" + numtostr(lastvalue(ref(c, -1)), 1.2)); // previous c

Barry

--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
>
> just use the variable (without selectedvalue or lastvalue)
>   ----- Original Message ----- 
>   From: Louis P. 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, September 12, 2008 2:47 PM
>   Subject: [amibroker] Converting selectedbar and lastvalue to...
> 
> 
>   Hi,
> 
>   I need to know how to convert code that is using selectedbar (it 
gets the bar before where I am on the chart) and lastvalue (which 
gets the bar at the end of the array) to a code that is checking each 
and every bar for the pattern.
> 
>   Anyone know how to do that?
> 
>   Thanks,
> 
>   Louis
>



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

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 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/