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

[amibroker] Re: Plotting ApplyStop Triggers



PureBytes Links

Trading Reference Links

Herman,

I can't get the n-bar stop to be plotted. When I plot the "Sell" 
values, I can only see a "1" plotted and I can't see the n-bar values.

Pavel.


ThreeCCAboveFirst=IIf(C>MA(C,65) AND 
Ref(C,-1)>Ref(MA(C,65),-1) AND 
Ref(C,-2)>Ref(MA(C,65),-2) AND
Ref(C,-3)<Ref(MA(C,65),-3)
,1,0); 

ThreeCCBelowFirst=IIf(C<MA(C,65) AND 
Ref(C,-1)<Ref(MA(C,65),-1) AND 
Ref(C,-2)<Ref(MA(C,65),-2) AND
Ref(C,-3)>Ref(MA(C,65),-3)
,1,0); 

Buy=ExRem(ThreeCCAboveFirst,ThreeCCBelowFirst);

Barstop=5;

ApplyStop(stopTypeNBar,stopModeBars,Barstop-1,0,False,0);

Sell=ExRem(ThreeCCBelowFirst,ThreeCCAboveFirst);

PlotShapes(IIf(Sell==1, shapeDigit1, shapeNone), colorRed, 0, H, -
12 );
PlotShapes(IIf(Sell==6,shapeDigit6,shapeNone),colorBlue,0,H,-12);
Plot(Sell,"Sell",colorRed,1);



--- In amibroker@xxxxxxxxxxxxxxx, Herman <psytek@xxx> wrote:
>
> You can use something like:
> 
> PlotShapes(iif( Sell==3, shapeDigit3, shapenone), colorRed, 0, 
SellStopPrice, 0 )
> 
> to plot a digits for all events encoded in the exit signals, 
exactly where the stop occurred.
> 
> ApplyStop return values
> 
> Using Equity( 1 ) evaluates stops and writes BACK
> signals to sell/cover arrays. Equity(1) also removes
> all extra signals.
> 
> 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 - ruin stop
> 6 - n-bar stop
> 
> herman
> 
> Monday, February 5, 2007, 8:31:34 AM, you wrote:
> 
> > Hello,
> 
> > Is there a way to plot a shape or something similar when the 
ApplyStop 
> > function is triggered? The following code plots a shape at every 
bar 
> > because the ApplyStop always returns a "1".
> 
> > Stop=ApplyStop(stopTypeNBar,stopModeBars,Barstop,0,False,0);
> > PlotShapes(IIf
(Stop,shapeHollowDownArrow,shapeNone),colorBlue,5,H,-12);
> 
> > With thanks,
> 
> > Pavel.
> 
> 
> 
> > 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> 
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >  
> > Yahoo! Groups Links
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.28/672 - Release Date: 2/6/2007 10:22 AM