Trying to figure out how do to a standard trailing stop. It would initially be percent under the entry price and then get adjusted upwards and the price moves up always staying 4 percent under the highest price. I went through the forums but I do not really understand it.
CODE:
Please log in to see this code.
Not to sure this is the way to do it ?
Size:
Color:
Try this:
CODE:
Please log in to see this code.
Size:
Color:
That is great. Is there a function to specify a minimum hold period? I am trying to back test mutual fund switching, and I need to hold for 30 days, so the stop lose would need to be deactivated for the first 30 days.
Size:
Color:
Sure. Define a counter of days outside the loop and here's how it would look then:
CODE:
Please log in to see this code.
Size:
Color:
I would like to plot a line of the 95% trailing stop of the highest high since the position was opened in the price pane. Is that possible and, if so, could you indicate the required code changes.
Thanks
Mike
CODE:
Please log in to see this code.
Size:
Color:
Sure, see PlotStops() in the QuickRef.
Size:
Color:
Eugene,
My exit strategy requires the closing price to be below the 20 day MA and also be below 95% of the highest high since the position was opened. In this senario PlotStops only plots a red dot when the close has already fallen below the 20 day MA.
I should have phrased my earlier request differently. What I would like to do is to plot a line of 95% of the value of the highest high reached since the inception of the long position. By plotting this information throughout the trade I would be able to visualize proximity to my exit criteria at all times. Is this possible and could you provide or direct me to sample code.
Thanks,
Mike
Size:
Color:
QUOTE:
In this senario PlotStops only plots a red dot when the close has already fallen below the 20 day MA.
To rephrase, this exit strategy might be incomplete since it doesn't have a clear exit level defined at each bar.
QUOTE:
What I would like to do is to plot a line of 95% of the value of the highest high reached since the inception of the long position
Here's how:
CODE:
Please log in to see this code.
Size:
Color:
This is very close to what I was looking for. I'm assuming that a plot is not possible since DrawLine was used.
Thank you for the help.
Mike
Size:
Color:
A plot is possible if you have a clear exit level defined for each bar. Here, your exit technique is active on a very few bars during a trade.
Size:
Color: