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

[amibroker] DiNapoli MACD and Stochastic



PureBytes Links

Trading Reference Links

Hi,

I need some help programming these indicators.  Any good TS converters of AB that can help out will be greatly appreciated

thanks

tony

//DiNapoli MACD

inputs:
    Price( numericseries ),
    Length( numericsimple ) ; { this input assumed to be a constant >= 1 }

variables:
    SmoothingFactor( 2 / ( Length + 1 ) ) ;

if CurrentBar = 1 then
    XAverage = Price
else
    XAverage = XAverage[1] + SmoothingFactor * ( Price - XAverage[1] ) ;

inputs:
    Price( numericseries ),
    FastLength( numericsimple ), { this input assumed to be a constant >= 1 }
    SlowLength( numericsimple ) ; { this input assumed to be a constant >= 1 }

MACD = XAverage( Price, FastLength ) - XAverage( Price, SlowLength ) ;


inputs: FastLength( 8.3896 ), SlowLength( 17.5185 ), MACDLength( 9.0503 ) ;

Plot1( MACD( Close, FastLength, SlowLength ), "MACD" ) ;
Plot2( XAverage( Plot1, MACDLength ), "MACDAvg" ) ;

//Stochastic

Input: FastKLen(8), SlowKLen(3), SlowDLen(3);

Plot1(PreferredSlowK(SlowKLen, FastKLen), "%K");
Plot2(PreferredSlowD(FastKLen, SlowKLen, SlowDLen), "%D");
If CheckAlert then
begin
If Plot1 crosses above Plot2 or
Plot1 crosses below Plot2 then
Alert = TRUE;
end;

Enter the following code into the TradeStation Power Editor as a function called "PreferredSlowK":

Input: SlowKLen(Numeric), FastKLen(Numeric);
PreferredSlowK = PreferredSlowK[1] + ((1/SlowKlen)*(FastK(FastKLen)-PreferredSlowK[1]));

Enter the following code into the TradeStation Power Editor as a function called "PreferredSlowD":

Input: FastKlen(Numeric), SlowKLen(Numeric), SlowDLen(Numeric);
PreferredSlowD = PreferredSlowD[1] + ((1/SlowDLen)*(PreferredSlowK(SlowKLen, FastKLen) - PreferredSlowD[1]));


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