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

[amibroker] Re: how to code this



PureBytes Links

Trading Reference Links


SORRY SORRY dudes  ,
I think I stuffed up my formula . Can I re type what I want.

not taking into account syntax what i want is - 

value = initvalue + value[i-1] + value[i-1]* variable_X 
      = initvalue +   value[i-1]*( 1+ variable_X ) 


initval = valuewhen(cum(1) == 1 , c ) ; // first close of chart ;
// value[i-1]  means previous value calculated .
// i = nth bar
// variable_X = say 0.01 ;

EG- 

initval = valuewhen(cum(1) == 1 , c )  say on bar 1 = 1.00 ; 
variable_X = say 0.01 ;

value         = initvalue +   value[i-1]*( 1+ variable_X ) 
value @ bar 1 = $1.00 + 0 * ( 1+ 0.01 ) = 1.00
value @ bar 2 = $0    + 1.00  * ( 1+ 0.01 ) = 1.01
value @ bar 3 = $0    + 1.01 * ( 1+ 0.01 ) = 1.021
value @ bar 4 = $0    + 1.021 * ( 1+ 0.01 ) = 1.12211 etc

thanks :-)
MOZ



--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx> 
wrote:
> Paul,
> 
> You know I tried to get it with AMA2() first....
> 
> I tried:
> value=ama2(cum(1),2,3);
> 
> but the returned values did not look correct as what were presented 
in the email.....I did not think of cum(1) != 1.....
> 
> value=AMA2(cum(1) != 1,2,3); // works
> 
> Thank you
> Anthony
>   ----- Original Message ----- 
>   From: Paul Chivers 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Wednesday, November 10, 2004 12:11 AM
>   Subject: Re: [amibroker] Re: how to code this
> 
> 
>   If AMA2 is
> 
>       forward * array + feedback * PREV;
> 
>   and das300 wants
> 
>       VALUE := KONSTANT + (PREV * Konstant2)
>   i.e.
>       2 + (PREV * 3)
> 
>   you can use        AMA2(Cum(1)!=1,2,3)
> 
>   The "cum(1)!=1" is needed to seed AMA2 with 0 as it uses 1 by 
default.
>   If you can suffer starting with a seed of 1, then simply use
>       AMA2(1,2,3).
> 
>   With those coefficients the series quickly goes asymptotic anyway.
> 
>   BTW, there is usually no need to use loops, as AFL is an array-
processing 
>   language, with an implicit "for( i=0;i < BarCount; i++ )" around 
every 
>   statement.
> 
> 
>   ----- Original Message ----- 
>   From: "Anthony Faragasso" <ajf1111@xxxx>
> 
> 
> 
>   Constant1=2;
> 
>   Constant2=3;
> 
>   Value1=0;
> 
>   for( i=1;i < BarCount; i++ )
> 
>   {
> 
>   Value1[i]=constant1[i]+(value1[i-1]*Constant2[i]);
> 
>   }
> 
>   Filter=1;
> 
>   //AddColumn(Value,"");
> 
>   AddColumn(Value1,"v1");
> 
> 
> 
>     ----- Original Message ----- 
>     From: das300@xxxx
> 
>     VALUE := KONSTANT + (PREV * Konstant2)
> 
>     :-)
> 
> 
> 
>   Check AmiBroker web page at:
>   http://www.amibroker.com/
> 
>   Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> 
>         Yahoo! Groups Sponsor 
>               ADVERTISEMENT
>              
>        
>        
> 
> 
> --------------------------------------------------------------------
----------
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
>       
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
> 
> 
> 
> [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/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/