[Attachment(s) from portfoliobuilder99@gmail.com [amibroker] included below]
https://www.amibroker.com/kb/2007/03/24/how-to-plot-a-trailing-stop-in-the-price-chart/
After looking in the Knowledge Base, I copied in some of your lines and got a Plot. Not sure if this is what you were looking for?
app = Optimize("app", 15, 4, 20, 1 );
SetTradeDelays(0,0,0,0);
Buy = Cross( MACD(), Signal() );
Sell = 0;
ApplyStop( 3, 2, app, True );
Equity( 1, 0 ); // evaluate stops, all quotes
InTrade = Flip( Buy, Sell );
SetOption("EveryBarNullCheck", True );
stopline = IIf( InTrade, HighestSince( Buy, High ) -app, Null );
PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeDownArrow,colorRed,0,High);
Plot( Close,"Price",colorBlack,styleBar);
Plot( stopline, "trailing stop line", colorRed );
__._,_.___
Attachment(s) from portfoliobuilder99@gmail.com [amibroker] | View attachments on the web
1 of 1 Photo(s)
Posted by: portfoliobuilder99@gmail.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
.
__,_._,___
EmoticonEmoticon