Trailing % Stop Tool

Using the POINTS() function combined with RATCHET() it’s possible to create a trailing stop tool based on any technical measure. Use this example in a Show Plot tool to plot a trailing stop 20% from the closing price of the bar on which you click. As the price rises the red line will maintain 20% away from the closing price, and will remain flat when the price falls.

Remember to save the tool as an indicator in the same tool view to add it to your toolbox.

//Get the mouse-click date
$V=POINTS().Point1.DateTime;
//Set % trail from CLOSE
PCT=CLOSE()*0.8;
//Use to set % trail from HIGH instead
//PCT=HIGH()*0.8;
//Calculate the 2% below the low on the date of the mouse-click
RATCHET(PCT, START=$V)

Capture

Hi Darren,

many thanks for your % trailing stop script.

Is it possible to change the script that the % trailing script can also be applied when I click the high of a bar that is an important pivot high so that the % trailing stop works the same way as when I click the low of an important pivot low?

Another question: Is it also possible that the % trailing stop indicator stops calculating/plotting the red line when the price moves below/above the trailing stop red line? So it works the same way as the ATR Trailing Stop tool but instead using average true range it uses percent changes.

Or to formulate my questions in a different way: Can you create a tool that works like the ATR Trailing Stop but uses instead the average true range it uses percent changes?

Thanks

Thomas

Hi Thomas,

Do you mean you want to draw the line 20% above the high? If so, change line 5 to the following:

PCT=HIGH()*1.2;

Then click on the RATCHET function (line 9) and change the direction to Down.

It’s not possible to stop the line when it is crossed in scripting - that will require a new tool to be developed.

Hi Darren,

Is it possible to use this when your technical measure includes user-configurable parameters? For example, in your script change it to something like

PCT = LOW() - VARTOLIST(VAL=$abc)

where $abc is a parameter that can be adjusted using the right-click properties screen? When I follow your approach, I don’t seem to have the capability of setting those parameters inside my script

I have a system for entry and exit stops that uses a single formula with different parameters for each market I trade, so this would be very handy for me.

Thanks in advance

Dave M.

Thanks David. We added a ‘Show Stop’ tool since the initial post in this thread, so maybe that will be able to do what you need?

Show Stop: https://help.optuma.com/kb/faq.php?id=1240