You need to use loops There is a good explanation here
http://www.amibroker.com/kb/2007/03/24/how-to-plot-a-trailing-stop-in-the-price-chart/
Ive never really understood about how to apply a stop loss to a system and hopefully plot it on the chart.
I want to set up a sell condition that would say something like
condition2= If price falls by 2% below entry price - Sell.
or
Condition2=If pricebreaks the low of the entry bar - Sell
I tried this but it doesnt plot. It just plots a line at the bottom of the chart.
ApplyStop(stopTypeLoss,
stopModePercent,
Param( "max. loss stop level", 2, 2, 30, 1 ),
True );
Plot(Sell==4,"ApplyStop Sell",colorRed,1|styleOwnScale);
Is anyone able to help please?
@Billyb, what is meant by //same as above?
Which one above?
Hi Billyb
Thanks again. I pasted the code into the editor and when I displayed it the stop looked a bit odd. Everytime the stop was triggered the stop line would drop down to zero. This pushed the chart right up the top of the page because the stop would drop from todays close down to zero.
Yes if you right mouse click on the symbol then the selection is there to go straight to the opening signal bar. For greater clarity on which bar (apart from the date) switch on the "Show trading arrows" option in chart Parameters/Axes & Grid.Hi all,
Does anyone know if it's possible to get AB to "Sync chart on select" (after backtesting) to include the date of the trade?
JB
Thanks Wysiwyg, much appreciated.Yes if you right mouse click on the symbol then the selection is there to go straight to the opening signal bar...
Anyone interested in selling their Howard Bandy books?
PM me
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?