Hi,

Something like this ...

initialBuyStop =
 iif(averagePrice > Ref(averagePrice, -1)
 && Ref(averagePrice,-1) < Ref(averagePrice,-2), LOW - fixValue, 
initialBuyStop);


finalBuyStop = iif(fixValue < LOW - initialBuyStop, LOW - fixValue, 
initialBuyStop);

Cheers

--- In [email protected], "loewenste...@..." <zl...@...> wrote:
>
> Hello, I am relative new to Amibroker and am trying to migrate some stuff 
> from TradeStation to AB.
> 
> The IIF statement has me in tangles and I would appreciate if someone can 
> help me translate the following two statements:
> 
> TradeStation code:
> first one:
> 
> IF ( averagePrice > averagePrice[1 day ago] AND 
>    averagePrice[1 day ago] < averagePrice[2 days ago] )
> THEN
>    initialBuyStop = LOW - fixValue;
> 
> and the second one:
> 
> IF fixValue < ( LOW - initialBuyStop ) 
> THEN
>    finalBuyStop = ( LOW - fixValue ) 
> ELSE
>    finalBuyStop = initialBuyStop;
> 
> 
> Many thanks in advance,
> Marinus
>


Reply via email to