Home                           

 Try Investor/RT             

 Investor/RT Tour           

 Getting Started              

 What's New                  

 Testimonials                 

  Q&A - Broken down by Topic . . .      Complete List of Questions - All Topics
     Charts and Technical Indicators      TPO Charts
     RTL: Scans, Signals, and Custom Indicators      Importing and Exporting
     Trading Systems and Backtesting      Schedules
     Quotepages, Portfolios and Custom Columns      Alarms / Alerts
     Data: Historical Data, the Database, and Data Services      User Variables (T# and V#)
     Custom Instruments: Spreads and Pairs      General / Miscellaneous
     Controls, Windows, and the Button Indicator      Autotrading
     Slide Shows      Product Line

 
Q&A Home

Investor/RT Answer
Answers to Common Questions

   

Question

How do I implement a stop and/or target in a trading system?
   

Answer

Assuming you have a system that goes both long (with BUY action) and short (with SELLSHORT action).  And let's also assume we want to implement both a stop and a target on both the long and short trades.  Let's also assume that we want the target to be 50 cents and the stop to be 25 cents.

In RTL, the token ENTRY gives us the entry price of any position.  This token makes implementing stops and targets relatively simple.

First, let's look at stops for long position.  In the exit rule or the long position (SELL rule), you would need to include/append the expression:

     OR CL <= ENTRY - 0.25

If the current price has fallen 25 cents below the entry price, then we're getting stopped out.

Now, let's look at the stop for the short position.  In the exit rule or the short position (COVERSHORT rule), you would need to include/append the expression:

     OR CL >= ENTRY + 0.25

If the current price has risen 25 cents above the entry price, then we're getting stopped out.

Now, let's look at the target for the long position.  In the exit rule or the long position (SELL rule), you would need to include/append the expression:

     OR CL >= ENTRY + 0.50

If price rises 50 cents above our entry price on a long position, we've hit our target and we're getting out.

Now, let's look at the target for the short position.  In the exit rule or the short position (COVERSHORT rule), you would need to include/append the expression:

     OR CL >= ENTRY + 0.50

If price falls 50 cents below our entry price on a short position, we've hit our target and we're getting out.

Putting it all together, you would append the following to your SELL rule:

     OR CL <= ENTRY - 0.25 OR CL >= ENTRY + 0.50

and the following to your COVERSHORT rule:

     OR CL >= ENTRY + 0.25 OR CL <= ENTRY - 0.50

If you system's only exit conditions are the stops and targets, then the initial OR can be eliminated.  Otherwise, include your additional exit conditions to the left of the initial OR.