Improved Generalized Trailing Stop Strategies for Think or Swim

With the latest release, we now have a TOS function in our strategies called “entryprice()”. It returns the price of the most recent entry while using strategies. This is great news for us, because it means we no longer have to reproduce our entry signals in a trailing stop strategy like I described in my earlier post! While it doesn’t make a trailing stop strategy any easier to code, it does make them universal instead of entry specific.

I have created two strategy files for my Donors that use this function to approximate having a trailing stop in the market. There’s one for long exits and one for short exits. Here’s a picture of one in action:

The way this works on the long side is this: after entry, a stop is placed x points (or percent, there is an input) below the entry price. As we make new highs, the stop loss is trailed up x points/percent below that high. It’s the opposite for shorts. In the picture, we didn’t get a big enough retracement from each subsequent low to trigger our trail. It just kept getting moved down until it finally hit.

With these files, you just add them to any chart that you are running any entry strategies on, and they will just work, no other coding required. These strategies are available to blog donors. You can download “TrailingStopStrategies.zip” which contains the strategy files from the Donors Only folder at “Released Thinkscript Strategies” from my Google site. If you are trying to do it yourself, leave a comment and I can answer questions or give some pointers.

Tags: , , ,

2 Responses to “Improved Generalized Trailing Stop Strategies for Think or Swim”

  1. guy halamish Says:

    downloading was ok but the files need a password
    can you help

  2. Prospectus Says:

    Password is sent out to those who make a donation to my blog. There’s a paypal link on the sidebar of the blog front page.

    I’m going to release a free set of files shortly that have fixed stops and profit targets.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: