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

Re: [amibroker] ATR function & loops



PureBytes Links

Trading Reference Links

Yes it can but... you should move ATR call OUTSIDE of the loop
and use array subscript to get value at given bar

myatr = ATR( ATR_Period ) ; // call this once OUTSIDE the loop 

for( ....
{
....
 {
 THigh=Max(High[i], THigh);
 ATRStop=THigh-ATR_Multiplier* myatr[ i ]; // use VARIABLE here instead of ATR
 
 ...}

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "PKJR" <TradingIQ@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, August 14, 2006 8:29 PM
Subject: [amibroker] ATR function & loops


> Can ATR function be used within loops?
> 
> 
> if (PriceAtBuy>0)
> {
> THigh=Max(High[i], THigh);
> ATRStop=THigh-ATR_Multiplier* ATR(ATR_Period));
> 
> }
> 
> tks/Paul
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> 
>