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

RE: [amibroker] Displaced EMA help



PureBytes Links

Trading Reference Links

Hello Tony,

 

you can use plot(…..shift   to plot into the future, however this is only for plotting and not for automatic analysis.

Try out the two different codes below.

 

shift = Param("Shift",5,0,30,1);

p = Param ( " Percent ", 100, 0, 100, 5 ) ;

Detrended = Close - MA (Close,7) ;

SDevNow = StDev ( detrended, 135 ) ; 

 

Overbought = ( Sum ( Close,6 ) + 7 * p/100 * 2 * SDevNow) / 6 ;

Oversold = ( Sum ( Close,6 ) - 7 * p/100 * 2 * SDevNow ) / 6 ;

 

Plot ( Overbought, _DEFAULT_NAME(), ParamColor ("color", colorCustom10 ), ParamStyle("Style", styleDashed ),0,0,shift ) ;

Plot ( Oversold, _DEFAULT_NAME(), ParamColor ("color", colorCustom10 ), ParamStyle("Style", styleDashed),0,0,shift) ;

Plot(C,"Close",1,128);

 

 

 

 

 

shift = Param("Shift",5,0,30,1);

p = Param ( " Percent ", 100, 0, 100, 5 ) ;

Detrended = Close - MA (Close,7) ;

SDevNow = StDev ( detrended, 135 ) ; 

 

Overbought = Ref(( Sum ( Close,6 ) + 7 * p/100 * 2 * SDevNow) / 6,-shift);

Oversold = Ref(( Sum ( Close,6 ) - 7 * p/100 * 2 * SDevNow ) / 6,-shift);

 

Plot ( Overbought, _DEFAULT_NAME(), ParamColor ("color", colorCustom10 ), ParamStyle("Style", styleDashed ) ) ;

Plot ( Oversold, _DEFAULT_NAME(), ParamColor ("color", colorCustom10 ), ParamStyle("Style", styleDashed)) ;

Plot(C,"Close",1,128);

 

 

 

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

Best regards

 

Thomas

www.tradingbasis.com

support@xxxxxxxxxxxxxxxx

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

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tony Lei
Sent: Monday, January 30, 2006 7:35 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Displaced EMA help

 

Thomas,

I appreciate your help. 

I also have this code but I can't seem to make it plot 1 bar into the future.  E.g. http://www.fibtrader.com/ctp5/ctp11.html

p = Param ( " Percent ", 100, 0, 100, 5 ) ;
Detrended = Close - MA (Close,7) ;
SDevNow = StDev ( detrended, 135 ) ; 

Overbought = ( Sum ( Close,6 ) + 7 * p/100 * 2 * SDevNow) / 6 ;
Oversold = ( Sum ( Close,6 ) - 7 * p/100 * 2 * SDevNow ) / 6 ;

Plot ( Overbought, _DEFAULT_NAME(), ParamColor ("color", colorCustom10 ), ParamStyle("Style", styleDashed ) ) ;
Plot ( Oversold, _DEFAULT_NAME(), ParamColor ("color", colorCustom10 ), ParamStyle("Style", styleDashed) ) ;

thanks again

tony

On 1/30/06, Thomas Z. <tzg@xxxxxxxxxxxxxxxx> wrote:

Hi,

 

no, it's not the same.

Try out the code below:

 

 

///////////////////// 2 period EMA displaced 3 bars into the future

xshift = Param ("Shift" , 3 ,0 ,50 ,1 ,1 );

RED = Ref ( EMA ( Close, 2), xshift ) ;

 

///////////////////// 2 period EMA displaced 3 bars into the future

Plot( EMA ( Close,2 ), "Shifted MA", ParamColor( "Color", colorCycle ), ParamStyle( "Style"),Null, Null , xshift );

Plot(red, "", 1, 1);

 

 

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

Best regards

 

Thomas

www.tradingbasis.com

support@xxxxxxxxxxxxxxxx

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

 


From: amibroker@xxxxxxxxxxxxxxx [mailto: amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tony Lei
Sent: Monday, January 30, 2006 5:44 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Displaced EMA help

 

Hi,

I'm trying to use a displaced EMA in my scanner and I have the following code.  Is this code the same as if I was plotting into the chart?


///////////////////// 2 period EMA displaced 3 bars into the future

RED = Ref ( EMA ( Close, 2), 3 ) ;


///////////////////// 2 period EMA displaced 3 bars into the future
xshift = Param ("Shift", 3,0,50,1,1 );

Plot( EMA ( close,2 ), "Shifted MA", ParamColor( "Color", colorCycle ), ParamStyle("Style"),Null, Null, xshift );

Hope someone can help

thanks

tony




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




SPONSORED LINKS

Investment management software

Real estate investment software

Investment property software

Software support

Real estate investment analysis software

Investment software

 


YAHOO! GROUPS LINKS

 

 






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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS