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

[amibroker] Re: TEMA - Kind Attn : Thomas



PureBytes Links

Trading Reference Links



HI Thomas

I am giving below an afl code which will explain what I am trying to 
achieve:

Plot (TEMA(C,12)-TEMA( Close, 26 ),"TEMAMACD",colorWhite,styleLine); 
Plot (EMA(TEMA(C,12)-TEMA( 
close,26 ),9),"TEMAMACDSIGNAL",colorRed,styleLine); 





I am looking for a code which can project a price at which both 
lines will meet.

Thanks once again for your time.



--- In amibroker@xxxxxxxxxxxxxxx, "Thomas Zmuck" <tzg@xxxx> wrote:
> Hi,
> 
> i have posted the code yesterday. You get the close price if both 
values are
> exactly the same. This happens very rarely but below is the code.
> 
> Samevalue = TEMA(C,12)-TEMA(C,26)==EMA(TEMA(C,12)-TEMA(C,26),9);
> 
> Filter = samevalue;
> AddColumn(C,"Close");
> 
> Regards
> 
> Thomas Zmuck
> www.tradingbasis.com
> 
> 
>  
> 
> -----Original Message-----
> From: vichooo_1999 [mailto:vichooo_1999@x...] 
> Sent: Sunday, March 27, 2005 11:33 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: TEMA - Kind Attn : Fred
> 
> 
> 
> 
> Hi Fred
> 
> Thanks for  your reply.
> 
> The Goal is to find the price at which TEMA(c,12)-Tema(c,26) is 
> equal to EMA((tema(c,12)-Tema(c,26)),9)
> 
> Hope u can code it easily.
> 
> Thanks once again
> 
> 
> 
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@xxxx> wrote:
> > 
> > Please provide both sides of the formula as follows ...
> > 
> > Part 1 - What's the goal ?
> > 
> > Part 2 - What do you want to reach the goal ? Price or something 
> > else ?
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "fz_iqbal" <stockslover@xxxx> 
> wrote:
> > > 
> > > Dear Fred,
> > > 
> > > Like Vichoo, I also tried my best with the code u gave, but 
> Thanks 
> > > Fred I am still unable  to get the price at which TEMA MACD 
> cross 
> > over 
> > > will take place.
> > > 
> > > I would be highly grateful if you could kindly code the above 
as 
> > this 
> > > seems to be more complicated than what visualised earlier.
> > > 
> > > Fazal
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "vichooo_1999" 
> > <vichooo_1999@xxxx> 
> > > wrote:
> > > > 
> > > > Hi Fred
> > > > 
> > > > I have been trying for last 30 mins or so I am unable to 
> proceed 
> > > > further. Kindly review the code please:
> > > > 
> > > > P0 = C;
> > > > Acc = 0.0001;
> > > > LVBI = LastValue(BarIndex());
> > > > Mult = 1;
> > > > for (i = 0; i < 10; i++)
> > > > {
> > > > if (P0[LVBI] >= 1)
> > > > i = 99;
> > > > else
> > > > Mult = Mult * 10;
> > > > }
> > > > // ***********************************************
> > > > 
> > > > P1 = Ref(P0, 1) * Mult;
> > > > UpDn = 100 * P1[LVBI];
> > > > 
> > > > for (i = 0; i < 200; i++)
> > > > {
> > > > 
> > > > Calc = P1;
> > > > Calc = TEMA(P1,12);
> > > > Calc = TEMA(P1,26);
> > > > Calc=TEMA(P1,12)-TEMA(P1,26);
> > > > Calc=EMA((TEMA(P1,12)-TEMA(P1,26)),9);
> > > > Goal = TEMA(P1,12)-TEMA(P1,26)==EMA((TEMA(P1,12)-TEMA
> (P1,26)),9);
> > > > 
> > > > if (Calc[LVBI] < Goal)
> > > > P1[LVBI] = P1[LVBI] + UpDn;
> > > > else
> > > > P1[LVBI] = P1[LVBI] - UpDn;
> > > > UpDn = UpDn / 2;
> > > > if (UpDn <= Acc)
> > > > {
> > > > j = i;
> > > > i = 99999;
> > > > }
> > > > }
> > > > 
> > > > Accuracy = 100 * (abs(Goal - Calc) / Goal);
> > > > 
> > > > Filter = BarIndex() == LVBI;
> > > > 
> > > > AddColumn(Mult,"Multiplier", 1.0);
> > > > AddColumn(Calc[LVBI - 1] / Mult, "Curr Ind Val", 1.9);
> > > > AddColumn(Goal / Mult, "Goal Ind Val", 1.9);
> > > > AddColumn(Calc[LVBI] / Mult, "Calc Ind Val", 1.9);
> > > > AddColumn(j,"Iterations", 1.0);
> > > > AddColumn(Accuracy, "Accuray (%)", 1.9);
> > > > AddColumn(Ref(P1, -1) / Mult, "Todays Price", 1.9);
> > > > AddColumn(P1 / Mult, "Goal Price", 1.9);
> 
> 
> 
> 
> 
> 
> 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





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/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/