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

[amibroker] Problem using Equity(1)



PureBytes Links

Trading Reference Links

Hi,

Anyone help please, why does the following code produce 3 signals on 
the last 3 days .

If you run it through a scan to pick the latest trades and you will see 
what I mean ie: the 3 arrows.

One signal is prior to the actual profit/initial stop.
One signal on the actual profit/initial stop.
One signal is following the actual profit/initial stop.

Is there something obviously wrong here:

Thanks, Glenn

---------------------8<--------------------
GraphXSpace=10;

N= Cross( EMA(Close,9) , EMA(Close,21) );

Buy= N AND Ref(N,-1)==0;
Sell= Close<Ref(LLV(Low,11),-1);
buyprice = open;
sellprice = open;

ApplyStop( stopTypeProfit, stopModePercent, 25, False, False);
ApplyStop( stopTypeLoss, stopModePercent, 20, False, False);

PositionSize=5000;

SetTradeDelays( 1, 1, 0 ,0);

Equity(1);

//Buy Signal plot
PlotShapes(IIf(Buy,shapeHollowUpArrow ,shapeNone),5,0,L,-10); 

//Sell Signal plot
PlotShapes(IIf(Sell,shapeHollowDownArrow ,shapeNone),4,0,H,-
10);

//LLV Trailing Stop plot
PlotShapes(IIf(Sell==1,shapeDigit1 ,shapeNone),9,0,H,50);       

//Initial Stop plot
PlotShapes(IIf(Sell==2,shapeDigit2,shapeNone),4,0,H,50);       

//Profit Exit plot
PlotShapes(IIf(Sell==3,shapeDigit3,shapeNone),5,0,H,50);       

Plot(Close,"Price",colorBlack,128);
---------------------8<--------------------


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Coral Calcium for Greater Health. 1 month supply - $23.95
(1 bottle, 90 tablets, 400mg each with Magnesium & Vitamin D)
http://www.challengerone.com/t/l.asp?cid=2805&lp=calcium2.asp
http://us.click.yahoo.com/mcIe3D/v9VGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/