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

[amibroker] Re: Conditional include



PureBytes Links

Trading Reference Links

Currently executing bar ?! ...

It's the LAST BAR ... which will change as the system sees new 
data.  I thought you were wanting to use it this manner i.e. on a go 
forward basis ... Is that correct or are you wanting to use it in 
some other way as well ?

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
> Of course on the {}. I didn't not think about the multiple lines of
> code. That explains another error.
> 
>  
> 
> One question: does LastValue() represent the LastValue as 
determined by
> the currently executing bar or is LastValue the very last value of 
the
> array, thus giving the same result every time? 
> 
>  
> 
> I guess I can easily test this myself!
> 
> --
> 
> Terry
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On
> Behalf Of Tomasz Janeczko
> Sent: Tuesday, September 06, 2005 09:56
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Conditional include
> 
>  
> 
> Hello,
> 
>  
> 
> First, you have to use BRACES, since #include simply "pastes" code 
from
> external file in the place when
> 
> it is used, so you end up with MULTIPLE lines (so they have to be
> enclosed in braces.
> 
>  
> 
> Second thing is that your newBuy and newSell are ARRAYS and can 
not be
> used in "if" condition
> 
> See MOST COMMON MISTAKES:
> http://www.amibroker.com/guide/a_mistakes.html
> 
>  
> 
>  
> 
> So corrected code would look as follows:
> 
>  
> 
>  if ( LastValue( newBuy OR newSell ) )
> 
>  {
> 
>         #include <W_Xfactor.afl>
> 
>  }
> 
>  else
> 
>         tradeLevel = trange = 1;
> 
>  
> 
>  
> 
> However please note that this operates on lastvalue only, not on
> bar-by-bar basis.
> 
>  
> 
> Please read Understanding AFL
> 
> http://www.amibroker.com/guide/h_understandafl.html
> 
>  
> 
> to learn how AmiBroker processes array statements.
> 
>  
> 
> If you need bar-by-bar execution you need to write a LOOP.
> 
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> ----- Original Message ----- 
> 
> From: Terry <mailto:MagicTH@x...>  
> 
> To: amibroker@xxxxxxxxxxxxxxx 
> 
> Sent: Tuesday, September 06, 2005 4:47 PM
> 
> Subject: [amibroker] Conditional include
> 
>  
> 
> I would like to conditionally load and execute an Include file 
only on
> days when certain conditions are True. I do this with ParamToggle 
all
> the time since ParamToggle creates a numeric or Boolean condition. 
Now I
> want to do it only on days when I have a Buy or Sell condition 
which is
> in an array and Amibroker complains that array is not allowed in 
an if()
> statement. IIf is not acceptable since it is just an assignment
> statement. I don't want to build a loop since the include file uses
> arrays. 
> 
>  
> 
> Here's the code. Any ideas?
> 
>  
> 
>  
> 
>     if (newBuy OR newSell)
> 
>         #include <W_Xfactor.afl>
> 
>     else
> 
>         tradeLevel = trange = 1;
> 
>  
> 
> Error 6. Condition in IF, WHITEL, FOR statements ahs to be Numeric 
or
> Boolean type. You can not use array here, please use [] (array 
subscript
> operator) to access array elements.
> 
> --
> 
> Terry
> 
>  
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> SPONSORED LINKS 
> 
> 
> Investment
> <http://groups.yahoo.com/gads?
t=ms&k=Investment+management+software&w1=I
> 
nvestment+management+software&w2=Real+estate+investment+software&w3=I
nve
> 
stment+property+software&w4=Software+support&w5=Real+estate+investmen
t+a
> 
nalysis+software&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZ
NcM
> u4KNQ>  management software 
> 
> Real
> <http://groups.yahoo.com/gads?
t=ms&k=Real+estate+investment+software&w1=
> 
Investment+management+software&w2=Real+estate+investment+software&w3=
Inv
> 
estment+property+software&w4=Software+support&w5=Real+estate+investme
nt+
> 
analysis+software&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKG
MtJ
> 9tFSJA>  estate investment software 
> 
> Investment
> <http://groups.yahoo.com/gads?
t=ms&k=Investment+property+software&w1=Inv
> 
estment+management+software&w2=Real+estate+investment+software&w3=Inv
est
> 
ment+property+software&w4=Software+support&w5=Real+estate+investment+
ana
> 
lysis+software&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6
oX5
> WZw>  property software 
> 
> 
> Software
> <http://groups.yahoo.com/gads?
t=ms&k=Software+support&w1=Investment+mana
> 
gement+software&w2=Real+estate+investment+software&w3=Investment+prop
ert
> 
y+software&w4=Software+support&w5=Real+estate+investment+analysis+sof
twa
> re&w6=Investment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w>
> support 
> 
> Real
> <http://groups.yahoo.com/gads?
t=ms&k=Real+estate+investment+analysis+sof
> 
tware&w1=Investment+management+software&w2=Real+estate+investment+sof
twa
> 
re&w3=Investment+property+software&w4=Software+support&w5=Real+estate
+in
> 
vestment+analysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8
PlA
> JASx0wrSaX5-Zlw>  estate investment analysis software 
> 
> Investment
> <http://groups.yahoo.com/gads?
t=ms&k=Investment+software&w1=Investment+m
> 
anagement+software&w2=Real+estate+investment+software&w3=Investment+p
rop
> 
erty+software&w4=Software+support&w5=Real+estate+investment+analysis+
sof
> tware&w6=Investment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg>
> software 
> 
>  
> 
> 
>   _____  
> 
> 
> YAHOO! GROUPS LINKS 
> 
>  
> 
> *	 Visit your group "amibroker
> <http://groups.yahoo.com/group/amibroker> " on the web.
>   
> *	 To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
>   
> *	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> <http://docs.yahoo.com/info/terms/>  Service. 
> 
>  
> 
> 
>   _____





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a difference. Find and fund world-changing projects at GlobalGiving.
http://us.click.yahoo.com/PcNrnD/PbOLAA/cosFAA/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/