StockFetcher Forums · Filter Exchange · A filter to manage the amount that you risk in each trade<< >>Post Follow-up
Caspian101
5 posts
msg #121393
Ignore Caspian101
modified
8/25/2014 4:16:19 PM

An important part of being a successful trader is not risking too much of your portfolio on any one transaction. A rule of thumb that I have seen is don't stand to lose any more than 2% of your overall portfolio value on a trade.

We can limit losses on trades by using stop loss or trailing stop orders to sell if the price falls too far. This filter uses the 'Average True Range' to measure the volatility of a stock and where you would need to potentially set your stop orders. It then uses this information, together with your overall portfolio value and the previous close stock price to calculate how many shares of a stock that you can buy to stay within your risk tolerance.

Fetcher[
symlist(TSLA, GOOG, AAPL, SPY) /*Enter your tickers here, separated by commas */

SET {PFVALUE, 20000} /* Set the value of your portfolio here*/
SET {MAX_TXN_RISK_PCT, 0.005} /*Set the maximum percentage amount of your portfolio that you want to risk in a trade, in percent here - e.g. 0.01 = 1%, 0.005 = 0.5% etc*/
SET {MAX_TXN_RISK_AMT, PFVALUE * MAX_TXN_RISK_PCT}
SET {SATR, AVERAGE TRUE RANGE(5)}
SET {CSP, close}
SET {MSL, CSP-SATR}
SET {MSLP1, MSL/CSP}
SET {MSLP2, 1 - MSLP1}
SET {SL_PCT, MSLP2 * 2} /*Set the multiplier on your stop loss here; for example, setting a multiplier of two assumes that you have put a stop loss at 2 times the Average True Range distance (the average true range is the amount that a stock moves in a particular period of time - Its volatility)*/
SET {SL_PCT_1, SL_PCT * 100}
SET{LOSS_PER_STOCK, close * SL_PCT}
SET {QTY_TO_BUY, MAX_TXN_RISK_AMT / LOSS_PER_STOCK}
SET {TOT_POT_LOSS, QTY_TO_BUY * LOSS_PER_STOCK}
SET {STOCK_COST, QTY_TO_BUY * close}


ADD COLUMN SL_PCT_1 {stop loss percentage}
ADD COLUMN LOSS_PER_STOCK {potential loss per stock}
ADD COLUMN TOT_POT_LOSS {total potential loss}
ADD COLUMN round (QTY_TO_BUY) {max quantity of stock to buy}
ADD COLUMN round (STOCK_COST) {total cost of stock}
]



Please note that the filter does not take account of trading costs or commissions.

Hope you find it useful.

mshivalu
11 posts
msg #121396
Ignore mshivalu
8/26/2014 7:36:06 PM





Caspian101
3 posts
msg #121393
- Ignore Caspian101
modified

8/25/2014 4:16:19 PM

An important part of being a successful trader is not risking too much of your portfolio on any one transaction. A rule of thumb that I have seen is don't stand to lose any more than 2% of your overall portfolio value on a trade.
=========================================================================================

That's an interesting filter. Thanks for posting it.

novacane32000
331 posts
msg #121419
Ignore novacane32000
8/30/2014 7:44:43 PM

Great filter ! Thanks for putting in the explanations for each line.

StockFetcher Forums · Filter Exchange · A filter to manage the amount that you risk in each trade<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.