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

Re: [amibroker] Plotting stop shapes



PureBytes Links

Trading Reference Links

Try placing the Equity(1) after the applystop statements
Also remove the exrem for buy and sell as this stops any new sells
occuring for the applystops
Another suggestion is to always make the main plot come first before
any shapes or secondary overlays. Can save you some frustration later




// Buy/Sell CONDITIONS //

Buy = Cross(MA(C,9),MA(C,30));
Sell = 0;

// STOPS //

/*
1 - regular exit
2 - Max. loss
3 - profit target
4 - trailing
5 - n-bar stop
6 - ruin stop
*/

ApplyStop(stopTypeNBar, stopModeBars, 10);
ApplyStop(stopTypeTrailing,stopModePoint, 3 * (ATR(14)));
Equity(1);

/* PLOTTING & DISPLAYS */
Colorbar = IIf(C > Ref(C, -1), colorBlue, IIf(C<
Ref(C,-1),colorRed,colorGreen));
Plot(Close, "Close", Colorbar, styleBar );
PlotShapes(IIf(Sell==6,shapeDownTriangle,shapeNone),colorRed,0,L,-20);
PlotShapes(IIf(Sell==5,shapeHollowCircle,shapeNone),colorBlue);
PlotShapes(IIf(Sell==4,shapeCircle,shapeNone),colorAqua,0,L,-20);
PlotShapes(IIf(Sell==3,shapeStar,shapeNone),colorBlue,0,L,-20);
PlotShapes(IIf(Sell==2,shapeStar,shapeNone),colorWhite,0,L,-20);
PlotShapes(IIf(Sell==1,shapeDownArrow,shapeNone),colorYellow,0,L,-20);

PlotShapes(shapeUpArrow*Buy , colorBrightGreen,0,L,-20);
--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm



On 2/1/06, Keith Osborne <kosborn3@xxxxxxxxxxxxxx> wrote:
> Hi, can anyone tell me why trailing and N-bar stops are not plotted? In
> the AA backtest it shows both stops being activated correctly. Not sure
> about the Equity(?) statement....should it be 0 or 1? I have trade
> delays set to (1,1,1,1)  and "activate stops immediately" in the AA
> settings.
>
> TIA.....Keith
>
>
>
>
> // Buy/Sell CONDITIONS //
>
> Buy = Cross(MA(C,9),MA(C,30));
> Sell = 0;
>
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
>
>
> // STOPS //
>
> Equity(1);
>
> /*
> 1 - regular exit
> 2 - Max. loss
> 3 - profit target
> 4 - trailing
> 5 - n-bar stop
> 6 - ruin stop
> */
>
> ApplyStop(stopTypeNBar, stopModeBars, 10);
> ApplyStop(stopTypeTrailing,stopModePoint, 3 * Nz(ATR(14)));
>
> /* PLOTTING & DISPLAYS */
>
> PlotShapes(IIf(Sell==6,shapeDownTriangle,shapeNone),colorRed,0,L,-20);
> PlotShapes(IIf(Sell==5,shapeHollowCircle,shapeNone),colorBlue);
> PlotShapes(IIf(Sell==4,shapeCircle,shapeNone),colorAqua,0,L,-20);
> PlotShapes(IIf(Sell==3,shapeStar,shapeNone),colorBlue,0,L,-20);
> PlotShapes(IIf(Sell==2,shapeStar,shapeNone),colorWhite,0,L,-20);
> PlotShapes(IIf(Sell==1,shapeDownArrow,shapeNone),colorYellow,0,L,-20);
>
> PlotShapes(shapeUpArrow*Buy , colorBrightGreen,0,L,-20);
>
> Colorbar = IIf(C > Ref(C, -1), colorBlue, IIf(C<
> Ref(C,-1),colorRed,colorGreen));
> Plot(Close, "Close", Colorbar, styleBar );
>
>
>
> 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
>
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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