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

RE: [amibroker] equity and applystop



PureBytes Links

Trading Reference Links

From a Graham post:
 
Here is a simple system with trail stop. Star is plotted at stop

Buy = Cross( MA(C,10), MA(C,100) );
Sell=0;
ApplyStop(2,1,10,0,0,1);
Plot(C,"close",colorBlack,styleCandle);
Equity(1); // THIS EVALUATES STOPS
PlotShapes(shapeStar*(Sell==4),colorRed,0,H,12);


d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Thomas Z
Sent: Saturday, October 01, 2005 11:40 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] equity and applystop

Hi Dingo,

yes, i know and i have read it.
So in my code i have a "normal" stop loss and a regular exit, but it doesn't work.
Only the regular exit will be ploted.

PlotShapes(IIf(Sell==1,25,IIf(Sell==2,25,-1e10)),Sellcolor,0,SellPrice,0);


Regards

Thomas
www.tradingbasis.com


dingo wrote:
at the bottom of the help screen for Applystop is the following comment:
 
Graham Kavanagh
gkavanagh@xxxxxxxxxxxxx
2004-09-30 21:55:42
from equity comments

Depending on kind of the stop various values
are written back to sell/cover array to enable you to distinguish if given signal was generated by regular rule or by stop.

1 - regular exit
2 - max. loss
3 - profit target
4 - trailing
5 - n-bar stop
6 - ruin stop
 
you need to add the approp value to your if.
 
d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Thomas Z
Sent: Saturday, October 01, 2005 10:44 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] equity and applystop

Hello,

i want to plot shapes at the when the applystop function stopped my trade.
So i have coded it as described in the amibroker help:
"Using Equity( 1 ) evaluates stops and writes BACK
signals to sell/cover arrays. Equity(1) also removes
all extra signals. "

Unfortunately i only receive shapes when it was a regular exit but not when it was a stop exit.
The build-in arrow appear at the stop bar. Can someone help ?
Here is my sample code:

fast = EMA(C,3); slow = EMA(C,10);
Buy=Cross(fast,slow); Sell=Cross(slow,fast);
Short = 0; Cover = 0;

Equity(1);
PlotShapes(IIf(Sell==1,25,IIf(Sell==2,25,-1e10)),Sellcolor,0,SellPrice,0);
Regards

Thomas
www.tradingbasis.com
    


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