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

[amibroker] Re: EasyLanguage question



PureBytes Links

Trading Reference Links

In the ela/d/s code ...

Y = u_2* price+2*u1*y1-u1_2*y2;
y2 = y1;
y1 = y;

The next time Y is calculated ( on the next bar ) Y2 will have the 
value of Y from two bars ago ... Y1 will have the value of Y from 
one bar ago ... 

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
>
> I am trying to convert a function called Twitcher from TradeStation
> EasyLanguage. Twitcher concept was published in last month's 
FUTURES
> Magazine. Code is from a user's group.
> 
> QUESTION: Does the following code for y refer to the next bar and 
next 2
> bars or previous bars?
> 
> Y = u_2* price+2*u1*y1-u1_2*y2;
> y2 = y1;
> y1 = y;
> 
> Here's the entire EasyLanguage code (for the twitcher function)
> 
> EASYLANGUAGE FUNCTION:
> Inputs: price(NumericSeries), initLength(NumericSimple);
> variables: length(0), x(0), y(0), y1(0), y2(0), u(0), u1(0), u1_2
(0),
> u_2(0);
> 
> If initLength <2 then length = 2 else length = initlength;
> if CurrentBar = 1 then begin
>     x=(1- cosine(360/Length))/0.414213562;
>     u=-x + squareroot(x*x+2*x);
>     u1= 1.0-u;
>     u1_2=u1*u1;
>     u_2=u*u;
>     y1=price;
>     y2=y1;
> end;
> y=u_2* price+2*u1*y1-u1_2*y2;
> y2=y1;
> y1=y;
> 
> TWITCH=Y
> --
> Terry
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> 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/