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

[amibroker] Re: Syntax Question



PureBytes Links

Trading Reference Links

Bret,

I get the impression you might be going about whatever your trying to
do in the wrong way. Perhaps if you can briefly explain what it is you
are trying to achieve then someone could suggest an approach.

You might get some ideas from this simplified example (variable %change per ticker):

Range = 1;
if ( Name() == "A" ) {
   Range = 8;
}
else if ( Name() == "AAP" ) {
   Range = 7;
}

One_Peak_Back = LastValue( Peak( H, Range, 1 ) );
Filter = Range != 1;

AddColumn( Close, "Close  " );
AddColumn( Range, "Range  " );
AddColumn( One_Peak_Back, "One_Peak_Back" );


Regards,
William Peters (AmiBroker Group Moderator)
www.amitools.com




Thursday, February 3, 2005, 11:37:21 PM, you wrote:
  
QRSA>  Thanks William.

QRSA>  I tried using nested iif statements to select a value for the percent,
QRSA>  but that still doesn't work.  I'll look around and see if I can find
QRSA>  this setup anywhere else.

QRSA>  Bret 


QRSA>  --- In amibroker@xxxxxxxxxxxxxxx, William Peters <william@xxxx> wrote:
 >> Hi,
 >> 
 >> QRSA>  Range = round ( MA ( 100*ATR ( 50 ) / C, 10 ) );
 >> 
 >> The above statement returns an array of numbers when the Peak
QRSA>  function requires a
 >> non arrayed number for the middle argument.
 >> 
 >> 
 >> Regards,
 >> William Peters (AmiBroker Group Moderator)
 >> www.amitools.com
 >> 
 >> 
 >> 
 >> 
 >> Thursday, February 3, 2005, 9:22:13 PM, you wrote:
 >>   
 >> QRSA>  I have the following bit of code to find a peak and value
QRSA>  based on
 >> QRSA>  ATR.  For some reason, this gives me an error even though I am
 >> QRSA>  rounding the "Range" to be an integer value.  If I hardcode a
QRSA>  percent
 >> QRSA>  into the Peak function it works.  Anybody see the problem? 
QRSA>  TIA, Bret
 >> 
 >> QRSA>  Range = round ( MA ( 100*ATR ( 50 ) / C, 10 ) );
 >>   
 >> QRSA>  One_Peak_Back = LastValue ( Peak ( H, Range, 1 ) );



  

QRSA>  Check AmiBroker web page at:
QRSA> http://www.amibroker.com/

QRSA>  Check group FAQ at:
QRSA> http://groups.yahoo.com/group/amibroker/files/groupfaq.html

    

QRSA> Yahoo! Groups Links
QRSA> To visit your group on the web, go to:
QRSA> http://groups.yahoo.com/group/amibroker/
QRSA>   To unsubscribe from this group, send an email to:
QRSA> amibroker-unsubscribe@xxxxxxxxxxxxxxx
QRSA>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    
  



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/