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

[amibroker] Re: Plotting Stops



PureBytes Links

Trading Reference Links

John,

That is because they return nothing. The

> > 0 = stopTypeLoss - maximum loss stop,
> > 1 = stopTypeProfit - profit target stop,
> > 2 = stopTypeTrailing - trailing stop,
> > 3 = stopTypeNBar - N-bar stop

just inform you which kind of stop is triggered with ApplyStop.
The "==" sign is an equal sign and saying

Sell==4 means : did I get a TrailingStop triggered (use equity(1))

Regards
Leo

--- In amibroker@xxxxxxxxxxxxxxx, "John Rowlinson" <john@xxxx> wrote:
> Hi Anthony,
> 
> Thanks for this but I cannot get Sell==4, Buy==4, Cover==4 or 
> Short==4 to return anything.  Any idea why that might be - it's 
> frustrating me?
> 
> Thanks
> 
> 
> 
> John
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Anthony Faragasso <ajf1111@xxxx> 
> wrote:
> > Applystop:
> > 
> > type =
> > 0 = stopTypeLoss - maximum loss stop,
> > 1 = stopTypeProfit - profit target stop,
> > 2 = stopTypeTrailing - trailing stop,
> > 3 = stopTypeNBar - N-bar stop
> > 
> > 
> > For visual conformation of ApplyStop function, add the following 
> lines
> > below your ApplyStop formula in Indicator Builder:
> > 
> > 
> > Equity(1); // THIS EVALUATES STOPS
> > 
> > Plot(Sell==4,"ApplyStop Sell",colorRed,1|styleOwnScale);
> > Plot(Cover==4,"ApplyStop Cover",colorGreen,1|styleOwnScale);
> > 
> > John Rowlinson wrote:
> > 
> > >  Hi Leo,
> > >
> > > This is great.  Is the value for a stoploss == 2?  I tried this
> > > today. I want to plot a level 1 on my inidicator.  So if I use:
> > >
> > > Graph5 = IIf(Cover==2, 1, 0);
> > >
> > > Then that should do it?  I can't seem to get it to work.
> > >
> > >
> > >
> > > John
> > >
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "leo_amelc"
> > > <leo.timmermans.lt@xxxx> wrote:
> > > > 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
> >                         ADVERTISEMENT
> > 
> > 
> > >
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > 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 the Yahoo! Terms of 
> Service.


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