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

RE: [amibroker] question on formula for plot trade price



PureBytes Links

Trading Reference Links

//You have redundant signals because buy condition is True as long as EMA15>EMA100; similar for Sell condition

//use either Cross (see below) OR ExRem

//added some text placement adustments for stocks and Forex

SepConst = ParamToggle("Stocks|Forex","Stocks|Forex",0);

TextAdj = Param("Text Adj",3,0,100,0.25);

SepParConst = IIf(SepConst==0,TextAdj ,0.01*TextAdj );

 

 

//BuyCond1= EMA(  Close , 15 ) > EMA(  Close , 100 ); original

//Buy = Buycond1 ;//original

//Sell = EMA (Close,15)<EMA(Close,100);

Buy= Cross(EMAClose , 15 ), EMAClose , 100 ));//added

Sell = Cross(EMA (Close,100),EMA(Close,15));//added

Plot(C,"PlotText2", colorBlack, styleLine );

Plot(EMA(C,15),"ema15", colorRed );

Plot(EMA(C,100),"ema100", colorGreen );//added

for( i = 0; i < BarCount; i++ )

{

if( Buy[i] ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]*(1-SepParConst), colorGreen );

if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]*(1+SepParConst), colorRed, colorYellow );

}

 

 

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Noah Bender
Sent: Saturday, February 21, 2009 11:10 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] question on formula for plot trade price

 

hello,

I am new to amibroker and am trying to figure this one out.

I have a simple formula
BuyCond1= EMA(  Close , 15 ) > EMA(  Close , 100 );


Buy = Buycond1 ;

Sell = EMA (Close,15)<EMA(Close,100);

I am trying to plot the trade price on the chart. so far I have this:


 Plot(C,"Price", colorBlack, styleLine );
Plot(EMA(C,15),"ema", colorRed );


for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Buy\n@" + C[ i ], i, L[ i ], colorGreen );
if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ], colorRed, colorYellow );

WHen I apply indicator it plots the price at every point on the chart and not just when the moving averages cross. Does anyone know why? and can show me the formula???

It would be much appreciated.

thanks



__._,_.___


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





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___