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

[amibroker] digital Stochastic



PureBytes Links

Trading Reference Links

Hi,

tried to translate this code from TradeSignal to Amibroker (but I think I did something wrong):

TradeSignal Code:

Meta:
Synopsis( "Digitale Stochastic - (c)2008 kahler@xxxxxxxxxxxxxx -
Info: Trader`s 08/2008" ),
SubChart( True ),
WebLink( "http://www.quanttrader.at"; );

Inputs:
PeriodStoch( 5, 1 ),
PeriodSmoothing1( 3, 1 ),
PeriodSmoothing2( 3, 1 ),
OverBought( 80, 0, 100 ),
OverSold( 20, 0, 100 );

Variables:
fast_k( 0 ),
slow_k( 0 ),
slow_d( 0 ),
summ;
{ Berechnung fast_k, slow_k }
StochasticNormal( High, Low, Close, PeriodStoch, PeriodSmoothing1,
PeriodSmoothing2, fast_k, slow_k, slow_d );

{ Digitalisierung }
if (22*slow_k+8*fast_k)/30 >50 then summ=1;
if (22*slow_k+8*fast_k)/30 <50 then summ=-1;

{ Darstellung }
DrawLine(xaverage(summ,periodStoch), "digitale Stochastic" ); 


AFL:

KAdjusted = StochK(5,3);
DAdjusted = StochD(5,3,3);

// Digitalisierung
summ = 0;
for( i = 5; i < BarCount; i++ )
{
	if ((22*KAdjusted[i]+8*DAdjusted[i])/30 >50) summ[i]=1; 
	if ((22*KAdjusted[i]+8*DAdjusted[i])/30 <50) summ[i]=-1;
}
xAverage = EMA(Summ,5);

Plot (xAverage, "Stoch. Dig.", colorBlack);

Is my code right?

Thanks and regards, dubi



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

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