StockFetcher Forums · Filter Exchange · Trade Planner Filter Display<< 1 2 >>Post Follow-up
TheRumpledOne
6,362 posts
msg #40778
Ignore TheRumpledOne
1/30/2006 12:51:53 AM

Fetcher[
/* Trade Planner Filter Display */

/* For the record, I got this idea from the SFO Magazine Feb 2006, "Manage Your Money..." by Jaime Johnson.

I added a few "goodies" of my own. */

set{ iAccountSize , 25000 }
set{ iPercentRisk, .02}
set{ iMarginMult , 1}
set{ iMaxDrawDownPct, .05}
set{ iEntryPrice , close}
set{ iProtectiveStop , 0}
set{ iAutoStopFactor , .01}
set{ iTargetPrice , close + .5}
set{ iAutoTargetOffset , 1}

/* enter your Upper Limit criteria */
set{UpperLim , High 5 Day High}

/* enter your Lower Limit criteria */
set{LowerLim , Low 5 Day Low}

set{ Dynamic_Range , UpperLim - LowerLim }

set{ xFib4 , Dynamic_Range * .618 }

set { xPriceTarget1 , LowerLim + xFib4 }

set{ xProtectiveStop , LowerLim - iAutoStopFactor }

set{AcctxMar, iAccountSize * iMarginMult }

set{ xTradeRisk , AcctxMar * iPercentRisk}

set { xShareRisk , iEntryPrice - xProtectiveStop }

set { tShares , xTradeRisk / xShareRisk }

set { aShares , AcctxMar / iEntryPrice }

set { xShares , min( tShares, aShares ) }

add column xShares
add column xPriceTarget1
add column xProtectiveStop

/* ONCE YOU MAKE SURE YOUR INPUTS ARE CORRECT YOU CAN COMMENT OUT THE FOLLOWING COLUMNS */

add column iAccountSize
add column iPercentRisk
add column iMarginMult
add column iMaxDrawDownPct
add column iEntryPrice
add column iProtectiveStop
add column iAutoStopFactor
add column iTargetPrice
add column iAutoTargetOffset
add column tShares
add column aShares

Sort column 5 descending

/* enter your price/volume criteria/market */

close > 20

avg volume(30) > 1000000

MARKET IS NASDAQ
]



Plan your trades. Trade your plan.

How many times have you heard/read that?

How many times have you said it yourself?

How many times have you actually done it?

The TRADE PLANNER FILTER DISPLAY plans your trade for you.

The TRADE PLANNER FILTER DISPLAY tells you how many shares to trade based on your account size, risk percent and margin multiplier. Tells you where the protective stop should be and where you should take profit.

You have to fill in the input variables in the set statements to match your portfolio. Input variables start with "i".

I wrote the original for TradeStation and converted (most of) the code into SF filter code.

There is still work to be done on this filter display.

MAY ALL YOUR FILLS BE COMPLETE.





guru_trader
485 posts
msg #40780
Ignore guru_trader
1/30/2006 1:29:55 AM

Ohhhhh, you beat me to the punch ... I was about to post my own version on Friday! I'll post it later this week.


TheRumpledOne
6,362 posts
msg #40785
Ignore TheRumpledOne
1/30/2006 9:30:20 AM

Fetcher[
/* Trade Planner Filter Display */

/* For the record, I got this idea from the SFO Magazine Feb 2006, "Manage Your

Money..." by Jaime Johnson.

I added a few "goodies" of my own. */

set{ iAccountSize , 25000 }
set{ iPercentRisk, .02}
set{ iMarginMult , 1}
set{ iMaxDrawDownPct, .05}
set{ iEntryPrice , close}
set{ iProtectiveStop , 0}
set{ iAutoStopFactor , .01}
set{ iTargetPrice , close + .5}
set{ iAutoTargetOffset , 1}

/* enter your Upper Limit criteria */
set{UpperLim , High 5 Day High}

/* enter your Lower Limit criteria */
set{LowerLim , Low 5 Day Low}

set{ Dynamic_Range , UpperLim - LowerLim }

set{ xFib1 , Dynamic_Range * .236 }
set{ xFib2 , Dynamic_Range * .382 }
set{ xFib3 , Dynamic_Range * .500 }
set{ xFib4 , Dynamic_Range * .618 }
set{ xFib5 , Dynamic_Range * .764 }

set { xPriceTargetR1 , LowerLim + xFib1 }
set { xPriceTargetP1 , UpperLim + xFib1 }

set { xPriceTargetR2 , LowerLim + xFib2 }
set { xPriceTargetP2 , UpperLim + xFib2 }

set { xPriceTargetR3 , LowerLim + xFib3 }
set { xPriceTargetP3 , UpperLim + xFib3 }

set { xPriceTargetR4 , LowerLim + xFib4 }
set { xPriceTargetP4 , UpperLim + xFib4 }

set { xPriceTargetR5 , LowerLim + xFib5 }
set { xPriceTargetP5 , UpperLim + xFib5 }


set{ xProtectiveStop , LowerLim - iAutoStopFactor }

set{AcctxMar, iAccountSize * iMarginMult }

set{ xTradeRisk , AcctxMar * iPercentRisk}

set { xShareRisk , iEntryPrice - xProtectiveStop }

set { tShares , xTradeRisk / xShareRisk }

set { aShares , AcctxMar / iEntryPrice }

set { xShares , min( tShares, aShares ) }

add column xShares
add column xProtectiveStop

/* enter what Target(s) you want to see */


add column xPriceTargetR1
add column xPriceTargetP1

add column xPriceTargetR2
add column xPriceTargetP2

add column xPriceTargetR3
add column xPriceTargetP3

add column xPriceTargetR4
add column xPriceTargetP4

add column xPriceTargetR5
add column xPriceTargetP5


/* ONCE YOU MAKE SURE YOUR INPUTS ARE CORRECT YOU CAN COMMENT OUT THE FOLLOWING

COLUMNS */

/* COMMENTED OUT
add column iAccountSize
add column iPercentRisk
add column iMarginMult
add column iMaxDrawDownPct
add column iEntryPrice
add column iProtectiveStop
add column iAutoStopFactor
add column iTargetPrice
add column iAutoTargetOffset
add column tShares
add column aShares

COMMENTED OUT */


Sort column 5 descending

/* price/volume/market criteria */

close is between 1 and 5

volume > 1000000

market is NASDAQ

]



I loaded up all the fib projection/retracement targets.

Just remove the ones you don't want to see.

Most traders use Fib2 and Fib4.

MAY ALL YOUR FILLS BE COMPLETE.


johnp
17 posts
msg #40786
Ignore johnp
1/30/2006 9:59:44 AM

This looks similar in nature to a program I posted at the end of "Money management question:" Forum. I plan on updating it and and making comparisions/incorporations of "Trade Planner Filter Display"



TheRumpledOne
6,362 posts
msg #40830
Ignore TheRumpledOne
1/31/2006 9:17:36 PM

Fetcher[

/* Trade Planner Filter Display - Simple */


set{ iAccountSize , 25000 }
set{ iPercentRisk, .02}
set{ iMarginMult , 1}
set{ iMaxDrawDownPct, .05}
set{ iEntryPrice , close}

set{ iShares, 0 }
set{ iProtectiveStop , 0}

set{ iTargetPrice , 0}
set{ iRewardRatio , 2}

set{ xMaxDollars, iAccountSize * iMarginMult }


set{ xTradeRisk, xMaxDollars * iPercentRisk }

set{ xSharesToBuy , xMaxDollars / iEntryPrice }

set{ xShareRisk , xTradeRisk / xSharesToBuy }


set{ xProtectiveStop , iEntryPrice - xShareRisk }

set{ xtp, xShareRisk * iRewardRatio }
set{ xTargetPrice , xtp + iEntryPrice }


add column xSharesToBuy
add column xProtectiveStop
add column xTargetPrice



/* ONCE YOU MAKE SURE YOUR INPUTS ARE CORRECT YOU CAN COMMENT OUT THE FOLLOWING

COLUMNS */

add column iAccountSize
add column iPercentRisk
add column iMarginMult
add column iMaxDrawDownPct
add column iEntryPrice
add column iProtectiveStop
add column iTargetPrice
add column iRewardRatio
add column xMaxDollars
add column xTradeRisk
add column xShareRisk
add column xtp



Sort column 5 descending

/* price/volume/market criteria */

close is between 1 and 5

volume > 1000000

market is NASDAQ
]



This is a simpler version.

The filter calculates your protective stop based on your risk per trade.

The target price is the entry price plus twice the risk for a 2:1 reward/risk ratio. Of course, you can change the inputs.

This Filter is for long entries.

MAY ALL YOUR FILLS BE COMPLETE.



TheRumpledOne
6,362 posts
msg #40831
Ignore TheRumpledOne
1/31/2006 9:19:26 PM

Fetcher[


/* Trade Planner Filter Display - Simple */


set{ iAccountSize , 25000 }
set{ iPercentRisk, .02}
set{ iMarginMult , 1}
set{ iMaxDrawDownPct, .05}
set{ iEntryPrice , close}

set{ iShares, 0 }
set{ iProtectiveStop , 0}

set{ iTargetPrice , 0}
set{ iRewardRatio , 2}

set{ xMaxDollars, iAccountSize * iMarginMult }


set{ xTradeRisk, xMaxDollars * iPercentRisk }

set{ xSharesToBuy , xMaxDollars / iEntryPrice }

set{ xShareRisk , xTradeRisk / xSharesToBuy }


set{ xProtectiveStop , iEntryPrice - xShareRisk }

set{ xtp, xShareRisk * iRewardRatio }
set{ xTargetPrice , xtp + iEntryPrice }


add column xSharesToBuy
add column xProtectiveStop
add column xTargetPrice



/* ONCE YOU MAKE SURE YOUR INPUTS ARE CORRECT YOU CAN COMMENT OUT THE FOLLOWING COLUMNS */


/* commented out

add column iAccountSize
add column iPercentRisk
add column iMarginMult
add column iMaxDrawDownPct
add column iEntryPrice
add column iProtectiveStop
add column iTargetPrice
add column iRewardRatio
add column xMaxDollars
add column xTradeRisk
add column xShareRisk
add column xtp

commented out */

Sort column 5 descending

/* price/volume/market criteria */

close is between 1 and 5

volume > 1000000

market is NASDAQ
]



Whoops! Left all those debug columns in!


AugustBag
13 posts
msg #40883
Ignore AugustBag
2/2/2006 1:12:40 AM

Hi TRO

Thank you for sharing the Trade Planner Filter Display with us. There are some intermediate constants that are unused (or did I miss something?). I'm specifically refering to "iMaxDrawDownPct", "iShares", "iProtectiveStop", and "iTargetPrice".

You computed "xSharesToBuy", "xProtectiveStop", and "xTargetPrice' without using those intermediate constants. Is there another use for them in a more complex version of the Trade planner Filter Display? Also, I wonder how one would use iMaxDrawDownPct in a trade.

Sorry for the dumb questions, but I'm new to this and haven't quite got the hang of generating filters in StockFetcher.

Thanks again.



TheRumpledOne
6,362 posts
msg #40930
Ignore TheRumpledOne
2/2/2006 9:58:02 PM

"Thank you for sharing the Trade Planner Filter Display with us. There are some intermediate constants that are unused (or did I miss something?). I'm specifically refering to "iMaxDrawDownPct", "iShares", "iProtectiveStop", and "iTargetPrice".

You computed "xSharesToBuy", "xProtectiveStop", and "xTargetPrice' without using those intermediate constants. Is there another use for them in a more complex version of the Trade planner Filter Display? Also, I wonder how one would use iMaxDrawDownPct in a trade.

Sorry for the dumb questions, but I'm new to this and haven't quite got the hang of generating filters in StockFetcher.

Thanks again. "

Yes, some are used in the TradeStation version and some are for future use.

iMaxDrawDownPct is the maximum amount ( expressed as a percentage of your total portfolio amount) you want one trade to drain your account.

So 2% of $100,000 is $2,000.00

If one trade is losing $2,000.00, you EXIT THE TRADE IMMEDIATELY AND TAKE THE LOSS BEFORE IT BECOMES WORSE.... that's called TRADING otherwise you are HOPING it will go back up.

MAY ALL YOUR FILLS BE COMPLETE.


AugustBag
13 posts
msg #40956
Ignore AugustBag
2/3/2006 6:19:32 PM

MaxDrawDownPct is the maximum amount ( expressed as a percentage of your total portfolio amount) you want one trade to drain your account.

So 2% of $100,000 is $2,000.00

If one trade is losing $2,000.00, you EXIT THE TRADE IMMEDIATELY AND TAKE THE LOSS BEFORE IT BECOMES WORSE.... that's called TRADING otherwise you are HOPING it will go back up.
----------------------------

Thank you. I have not seen the term "drawdown" used that way. I'm paper trading now and using $10,000 as my capital. 2% of that is $200 which I consider my maximum loss per trade (downside). To determine the number of shared to buy, I subtract my potential entry price from my stop loss price and divide that into $200. Also, since I want to limit each trade to a maximum of 10% of my capital ($1,000), I divide $1,000 by the potential entry price to get the number of shares to buy and I select whichever calculation is lower.

Investopedia definition of drawdown is slightly diferent. I never could quite understand it or how it could be used by a trader. I think you have cleared much of it up for me. Anyway, here is the quote from the Investopedia Dictionary:

Drawdown
What does it Mean? The peak to trough decline during a specific record period of an investment or fund. It is usually quoted as the percentage between the peak to the trough.

Investopedia Says... Basically a drawdown is from the time a retrenchment begins to when a new high is reached (because you won't know the valley until the new high is reached).

Thanks again, I have learned a lot from you and several other of the posters in these Forums.


nikoschopen
2,824 posts
msg #40980
Ignore nikoschopen
2/4/2006 3:44:06 PM

Drawdown: A Good Measure?

As a description of an aspect of historical performance, drawdown has one key positive attribute: it refers to a physical reality, and as such it is less abstract than concepts such as volatility. It represents the amount by which you are less well off than you were; or, put differently, it measures the magnitude of the loss an investor could have incurred by investing with the manager in the past. Managers are obliged to wear their worst historical drawdown like a scarlet letter for the rest of their lives. However, this number is less straightforwardly indicative of manager quality as is often assumed. The seeming solidity of the drawdown statistic dissipates under closer examination, due to a host of limitations which are rarely explored sufficiently when assessing its significance as a guide to the future performance of an investment.

The first is that, all other things being equal, drawdowns will be greater the greater the frequency of the measurement interval. The maximum drawdown will be greater on a daily time series than on a weekly one, and weekly will be greater than monthly. Investments that are marked to market daily, such as managed futures, may thus appear at a disadvantage to less frequently valued investments (e.g. hedge funds).

The second is that the maximum drawdown will be greater for a longer time series, so that managers with longer track records will tend to have deeper maximum drawdowns. This effect would have perverse consequences if the raw maximum drawdown were used to measure quality across the board, as, in general, managers that have survived longer have given evidence of professional competence through overcoming such adversities.

In order to make drawdown a more informative statistic, we must correct for track record length, measurement interval and volatility; we must take account of the error as well as making sure that we understand the nature of the return generating process (i.e. that it is reasonably parametric). Though some analysts correct for some of these factors, the conventional cursory use of drawdown as a statistic fails most or all of these tests, making it worse than useless.

Source: http://www.turtletrader.com/drawdown.html


StockFetcher Forums · Filter Exchange · Trade Planner Filter Display<< 1 2 >>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 2016 - 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