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

[amibroker] Re: Newby question - coding help sought.



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "loewensteijn@xxx" <zl2ml@xxx> 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
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/