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

[amibroker] Re: Plotting Stops



PureBytes Links

Trading Reference Links

John,

Maybe this code excerpt can help you. The different stops 
(ApplyStop) have different values that you can use is the PlotShapes.
Hope this helps.

Regards
Leo


PAT = YOUR SYSTEM CONDITION HERE
barcolor=IIf(PAT,colorYellow,colorBlue);
GraphXSpace=5;
Plot(C,"BUY PATTERN",ValueWhen(barcolor!=0,barcolor),styleBar);

// Backtester part
SetTradeDelays(0,0,0,0);
SetOption("AllowSameBarExit",False);
SetOption("ActivateStopsImmediately",False);
SetOption("AllowPositionShrinking",True);
typeLoss=2;typeProfit=3;typeTrailing=4;typeNBar=6;
BuyCond=PAT;
BuyPrice=C;
Buy=BuyCond;
SellPrice=C;
Sell=0; //exit by stops only
ApplyStop(stopTypeProfit,stopModePercent,4,True);
ApplyStop(stopTypeTrailing,stopModePercent,10,True);
ApplyStop(3,1,10); //STOP After 10Bars
Equity(1);
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,C-ATR(1));
PlotShapes(IIf
(Sell==typeNBar,shapeDownArrow,shapeNone),colorRed,0,C+ATR(1));
PlotShapes(IIf
(Sell==typeProfit,shapeSmallDownTriangle,shapeNone),colorBrightGreen,
0,C+ATR(1));
PlotShapes(IIf
(Sell==typeTrailing,shapeSmallDownTriangle,shapeNone),colorRed,0,C+AT
R(1));



> Hello,
> 
> I have an indicator that plots buy, sell etc and I want to plot 
> stops.  How do I do this?  Is it something like sell==4?  I am 
> entering into positions using buy and sell and as I always have a 
> position they reverse each other - so sell=short etc.  I can't 
find 
> anything of much use in on-line help.
> 
> Thanks for any help.
> 
> 
> 
> John Rowlinson


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/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/