Sie sind auf Seite 1von 14

TradeStation Resources

by Mark David Johnson (a.k.a. OpusTrader)

This PDF is designed to provide you access to many useful resources that are scattered all across
the TradeStation Forum and Wiki.

First section:
Tips and tricks that will make learning to code in EasyLanguage easier.
https://www.tradestation.com/wiki/pages/viewpage.action?pageId=20504 HOT
Product
Second section: Release!
Reading & understanding TradeStation performance report
plus proper steps for back-testing and developing successful strategies.
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=84601

Now you can easily back test any trading


Third Section: Equity vs. Risk Principle every trader needs to know. ideas. No Easy Language required!
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816
Watch the Free Trading Video at this link:
Fourth Section: FREE TRADING VIDEOS http://www.customizedtrading.com/TradeStation
At least a dozen of them scattered throughout the web site. _Add_Ons/TradeStation_Backtesting_Strategy
Many on this page: http://www.customizedtrading.com/TradeStationAddons

I offer the following services:


► EasyLanguage Tutoring:
For traders in the process of learning EasyLanguage programming.
Having a personal tutor is a much faster approach to learning EasyLanguage then using the public
Forum posting process. An important added benefit is you are not posting your private code or ideas
on the public Forum to get the answers you need to your EasyLanguage questions.

► Customized Trade Station Programming Services:


For those traders with no interest in learning EasyLanguage programming.
We meet on a private webinar where you will show me want you want. Once we are clear on the
specs. I will do the custom programming work for you.

► Advanced TradeStation Add-Ons:


For traders looking for advanced TradeStation indicators and/or strategies.
I have personal designed and programmed over 200 custom indicators, and over 50 custom strategies.

Many FREE TRADING VIDEOS available in this section of the web site
http://www.customizedtrading.com/TradeStationAddons

For more details please visit: www.CustomizedTrading.com


Contact me at: Staff@CustomizedTrading.com
EasyLanguage : EasyLanguage Programming Tips & Tricks - Make Your EL
Coding Easier and More CPU Efficient

This page last changed on Jun 02, 2009 by 28848.

Seems that people new to Tradestation & EasyLanguage have to dig hard to find many of the
Tips & Tricks that make EasyLanguage programming easier.

Here are many Tips & Tricks I have found over the past three years,
some from the TradeStation's Forum but too long ago to give specific credit to the original contributor.

If you're not familiar with a command, look it up in the Wiki search or in the TS user guide (TradeStation
Platform - Help Menu - Select option TradeStation Help)
reading about the EasyLanguage commands is part of the learning process to understand coding.

Refer to all the hyperlinks listed below

• EasyLanguage Strategy Coding Template - Many Tips & CPU Load Reduction Tips Too
• EasyLanguage Strategy Coding Template - Multiple Time Frame Strategy
• Reading & Understanding the TradeStation Preformance Report
• Risk Management and How to Minimize Your Account Drawdowns
• Setup - Saving Indicator Settings with correct Line Style, Color, Scaling, etc.
• Setup - Saving Strategy Settings with Strategy making them the Automatic Default settings
• Setup - Strategy & Indicator Attribute Options
• Tips - Code Inline - A Listing of Hyperlinked Inline Code Functions
• Tips - Code Inline - Average
• Tips - Code Inline - Bollinger Bands
• Tips - Code Inline - Highest
• Tips - Code Inline - Hourly Ribbon on a 5 Minute Chart
• Tips - Code Inline - MRO using an Array (by xygeek)
• Tips - Code Inline - Standard Deviation (by Goose)
• Tips - Code Inline - Stochastics (by Solidus)
• Tips - Code Inline - T3Average
• Tips - Code Inline - Williams %R
• Tips - Code Inline - XAverage (by goose) & XAverage of an Array (by xygeek)
• Tips - Coding - 2D Array Sort (by xygreek & goose)
• Tips - Coding - Alert when Strategy and TradeManager become mis-matched
• Tips - Coding - Array Lookback
• Tips - Coding - Building Indicators that work on both Charts & Radarscreen
• Tips - Coding - Calculate Daily NetProfit
• Tips - Coding - Calculate PositionProfit Per Contract & PositionProfit Per Entry when using Multiple
Scaling-In Type Entries
• Tips - Coding - Chart Just Reloaded
• Tips - Coding - Correlation Study with Workspace & Indicator
• Tips - Coding - Current Price plus Daily High & Low on an IntraDay Chart
• Tips - Coding - Daily NetProfit Calculation
• Tips - Coding - Decimal Place for Symbol (by Goose)
• Tips - Coding - During Trade Profit & Loss Displayed On Subgraph Indicator
• Tips - Coding - Holidays, Early Closings, Number of Trading Day Before Month End (by Climer511)
• Tips - Coding - Individual Long & Short Trade Counters and Number Bar Counters
• Tips - Coding - IntraDay Long Trade Counter & Short Trade Counter plus Last Trade Direction

Document generated by Confluence on Aug 19, 2009 16:21 Page 1


• Tips - Coding - Multiple Entries and-or Reversing Entry Strategies
• Tips - Coding - Number Bar in Trade Which Is Accurate When Using Multiple Entries
• Tips - Coding - Profit & StopLoss Combined into a Cantilever Dynamic Trailing Stop
• Tips - Coding - Pyramiding Entries plus Controlling with Scaling-Out Exits
• Tips - Coding - Scaling In and Scaling Out (Pyramiding) Multiple Entries & Exits
• Tips - Coding - Tracking High & Low Reached While in a Trade
• Tips - CPU Load Reduction - A List of Coding Suggestions to Reduce CPU Load
• Tips - CPU Load Reduction - By Using BarStatus(1) = 2 Command
• Tips - CPU Load Reduction - Draw Trendlines & Text On Chart Only For Last 7 Days
• Tips - CPU Load Reduction - During Strategy Optimization (by goose)
• Tips - CPU Load Reduction - Executing Code One Time On First Bar Of Chart
• Tips - CPU Load Reduction - If Using LastBarOnChart Command
• Tips - CPU Load Reduction - Time Slicing To Run Code Every "x" Seconds
• Tips - CPU Load Reduction - When Using TradeStation Position Variables
• Tips - First Bar of Each Chart
• Tips - First Bar of Each New Day
• Tips - First Bar of Each New Month
• Tips - First Bar of Each New Session
• Tips - First Bar of Each New Week
• Tips - First Bar of Specific Day of the Week or Specific Day of the Month
• Tips - First Bar of Today Only or Yesterday Only
• Tips - IntraDay Chart Calculation of Daily High, Low, Open & Close
• Tips - IntraDay Chart Calculation of Monthly High & Low
• Tips - IntraDay Chart Calculation of Weekly High & Low
• Tips - New Session Mid-Day
• Tips - Specific Day of the Week or Specific Day of the Month
• Workaround for command - BarsSinceEntry
• Workaround for command - BarsSinceExit
• Workaround for command - BarStatus(1) = 0 Process Code On First Tick Of Each New Bar

Document generated by Confluence on Aug 19, 2009 16:21 Page 2


TradeStation Forum - How to Read & Understand a Performance Report

No New Private Messages


You are logged in to the forums as OpusTrader

Most Recent Forum My Forum Advanced Forum


| TradeStation Wiki | Posts
| Subscriptions
| Forum Help | Quick Forum Search Go | Search

Home > Support > All Forums > Strategy Trading & Money Management >
How to Read & Understand a Performance Report

2 Pages 12

Next Page

Author Topic

OpusTrader Posted - 01/06/2009 00:18:46

Reading & Understanding TradeStation Preformance Report


2097 Posts
plus
Proper Steps for Backtesting and Developing a Successful Trading Strategy

If you find this posting useful then add a comment so it does not get buried into the archives.

In order to understand a strategy preformance, you must review many numbers from a performance report. Other
numbers not covered here are useful but this is a good starter course.

I will base this on a scalping strategy here is the attached Performance Report.

Attachment:DATA/20090106002201TF scalper.xls 22016 bytes

This scalper strategy trades the eMini Futures, this specific report is on 5 min chart for TF (Russell)

Here is how I read the preformance report

Step 1 - Historical Backtesting on in-sample data


Several vital setup steps:
(a) go to Format Symbol and give TS a starting and ending date to backtest a given time block of historical dates called the
"in-sample data". It is a good idea to reserve "out-of-sample data" which is a date range you do not use for bactesting in
Step 1 but will use during BackTesting on "out-of-sample data" during Step 2.

(b) You MUST go to "format strategy" and then select "properties for all" button select "general" tab and enter the
commissions and slippage (as realistic as possible or fudge too high if you are not sure), if this step is skipped the
backtesting performance report is meaningless.

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=84601 (1 of 11)8/19/2009 2:16:43 PM


TradeStation Forum - How to Read & Understand a Performance Report

(c) Another item to set for your final report is under "properties for all" "general" tab, bottom left section called "Back-
testing resolution". When backtesting TS uses the OHLC so the larger the bar the more distorted the backtesting
performance report can be. By checking the "Look-Inside_Bar Back-testing" and then selecting the smallest time frame
available for your chart style then the backtesting will use that selected OHLC resolution. This will make the computer do
ALOT more work and can really slow it down big time but for this one final preformance report you must do this to get a
more accurate preformance report so you must use "Look-Inside_Bar Back-testing" to improve the accuracy of the
backtesting preformance report to use for the follow analysis.

First, I look at how many times does the strategy trades in this report. To reduce backtesting error where error is defined
by [ error = 1 / Sqrt(NumberTradesInTest) ] you want at least 400 trades to reduce the margin for error to 5% in your
backtesting results.

I also look at how many times does the strategy trades on one chart in one day. The reason the more often a strategy
trades the more profit it can generate.

Attached example traded 397 trades in the last 3 1/2 months, averaging 5.3 trades per day.

Second, I look at the Avg Trade Amount. It needs to be large enough that slow order fills and/or larger than normal
slippage does not kill the profitability of the strategy.

Attached example Avg Trade Profit is $162.32 (with correct commissions and slippage being subtracted from the
performance report)
55% of the time this strategy trades 1 contract
35% of the time this strategy trades 3 contracts
10% of the time this strategy trades 5 contracts

Third, I like to see a Profit Factor & Ratio Avg Win-Avg Loss both above 1.5 with the percentage wins above 45%

This strategy had a Profit Factor of 1.83


This strategy had a Ratio Avg Win-Avg Loss of 2.28 (2.28 means breakeven is around 28% Winning Trades)
Percentage Winning Trades was 44.58%

Fourth, I look at the trade list specifically the run-up and drawdowns column to see how many trades made money and
how much money before trade was exited at what amount in relation to the run-up and drawdown. I want to know if
managing the trades will generate more profits. The example used shows good percentage of trades made a lot higher
profits than automated exit point.

Fifth, I also look at the three DD number and I like to see the largest number at 15% or less of the Total Net Profit and the
Max DD at 5% or less of the Total Net Profit (these numbers tell about the drawdown risk level during your trades). (NOTE:
Just below DD amount is a percentage figure this number is meaningless unless you enter your trading account balance
into the "Properties for All" found within "Format Strategy". The percentage number I am referring too above is of the Total
Net Profits for the strategy.)

Total Profit - $64,440


Peak to Valley DD - $8,960 is 13% of Total Profit
Close to Close DD - $7,120 is 11% of Total Profit
Max DD - $3,420 - 5% of Total Profit

Sixth, Looking at the Largest Losing Trade on the report I like 5% or less of the Total Net Profit figure

Largest Losing Trade that occurred - $2,580 is 4% of Total Profit

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=84601 (2 of 11)8/19/2009 2:16:43 PM


TradeStation Forum - How to Read & Understand a Performance Report

Seventh, I review the Length of time in trade. Does the time in trades comply with the Golden Rule "cut your losses
quickly and let your profits run". Why look at these ? If a strategy is built using only profit exits (no real loss exits) it might
have a nice looking report but will show a screwed up ratio in the avg number of bars.

Avg bars per Trade 5.17 bars


Avg bars per winning trade 7.24
Avg bars per losing trade 3.51 bars

It does comply with the Golden Rule, see how it cuts losses quickly an avg of 3.5 bars and lets profits run an avg of 7.2
bars.

What does this all mean ?


It has passes the historical backtesting on in-sample data.

What next?

Step 2 - Backtesting on Out-of-Sample Data


In Step 1 under setup we covered setting commissions and slippage and look-inside-bar back-testing which must be used
during every step.

For this example lets say you used 3 years of "in-sample data" for your backtesting period but did NOT including the most
recent year of data to use as your "out-of-sample data". Now go into format symbol and change the date range to include
ONLY the "out-of-sample data" date range that was NOT used during Step 1 Backtesting on in-sample data". This is
referred to as testing out-of-sample data. Now review all the above on the out-of-sample data performance report. The
closer it preforms to the Step 1 performance report the more robust the strategy, this would suggest the results were not
from curve fitting and you have a good chance of having a viable strategy. This Out-of-Sample Date Range Test is much
MORE important than the backtesting step for finding a successful strategy.

Robustness, quoted from Perry J. Kaufman "Practically speaking, a robust trading strategy is one that produces
consistently good results across a broad set of parameter (input) values applied to many different markets tested for many
years."

If the strategy fails during this "out-of-sample data" Test, do NOT optimize using your reserved out-of-sample data, this
would defeat this vitally important step in strategy development.

One caveat if your strategy is capitalizing on a certain market condition like the current volatility and then you out-of-
sample data test a non volatile date range, it may not perform well yet Step 3 Live Forward Testing could prove to be
successful since we are still in a volatile market. You must understand why your strategy works and under what market
condition is preforms well and what market conditions where it does not preform well.

Step 3 - Live Forward Testing on the Simulator Account


Next step is live forward testing on the simulator account. In this step you want to verify that the live data feed entries and
exits are similiar to historical entries and exits. After a day of using live data trades save the Live trade list. Now reload this
same chart so the strategy recalculates based on the historical for this same day. Record the historical trade list and
compare the live entries and exits to the historical entries and exits. Are they the same ? or at least similiar? Do you
understand the differences and the impact your "Live Data" test says about your strategy?

Only by monitoring the program daily can performance be seen under real "live" market conditions. Continue Live Forward
Testing on the simulator until you are comfortable your strategy works on live data before you move on to the next step.
Real time results will often be less profitable than your historic results but the key issue is does the real time testing show
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=84601 (3 of 11)8/19/2009 2:16:43 PM
TradeStation Forum - How to Read & Understand a Performance Report

you have a profitable strategy that is worth trading?

Step 4 - Real Live Trading Execution


Now your ready to trade but since your trading a brand new strategy with real money start with a significantly reduced
position sizing risk of 1/4 of 1% of your account equity at risk per your stoploss point per trade until you have verified
everything is working properly within your new strategy during live order executions.

As soon as you can live trade your strategy and make money then slowly over time begin to increase your position sizing
risk upward from 1/4 of 1% toward 1% at this point stay at 1% until you have several weeks to months of consistent
trading preformance. Continue to increase toward using 3% of your account equity at risk per trade (3% is a suggested
maximum).

Perry J. Kaufman quote:


"In the development of a system or trading philosophy, each person must settle on the combination of risk,
reward, and opportunity that best suits him or her. There is no best combination."

Trading Risk Management


"A trading system alone will not assure success without proper risk control, beginning with individual trades, extending to
diversification of markets, and continuing until a portfolio of different trading strategies is created. Every trading style has
losing streaks that will ruin an investor who begins trading at the wrong time without adequate capital; therefore the
size of the position, the markets to trade, and when to increase or decrease leverage become important for financial
survival." by Perry J. Kaufman

To get additional information about Trading Risk Management read this posting

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816

Risk Reduction using Correlation Tools


https://www.tradestation.com/Discussions/Topic.aspx?Result=1&Topic_ID=81369

OpusTrader Posted - 01/06/2009 00:28:21

2097 Posts

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=84601 (4 of 11)8/19/2009 2:16:43 PM


TradeStation Forum - Equity vs Risk Every Trader Needs To Know

No New Private Messages


You are logged in to the forums as OpusTrader

Most Recent Forum My Forum Advanced Forum


| TradeStation Wiki | Posts
| Subscriptions
| Forum Help | Quick Forum Search Go | Search

Home > Support > All Forums > Strategy Trading & Money Management >
Equity vs Risk Every Trader Needs To Know

2 Pages 12

Next Page

Author Topic

OpusTrader Posted - 10/16/2008 10:09:42

Discretionary Traders Number One Enemy


2097 Posts and
Many Traders Do Not Know About It.

"A trading system alone will not assure success without proper risk control, beginning with individual trades, extending to
diversification of markets, and continuing until a portfolio of different trading strategies is created. Every trading style
has losing streaks that will ruin an investor who begins trading at the wrong time without adequate capital; therefore
the size of the position, the markets to trade, and when to increase or decrease leverage become important for financial
survival." by Perry J. Kaufman

This image shows trading account drawdown percentages and what percentage gain is required to return your trading
account back to the amount prior to the drawdown.

What percentage drawdown are you willing to have in your trading ?

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (1 of 15)8/19/2009 2:17:42 PM


TradeStation Forum - Equity vs Risk Every Trader Needs To Know

Want smaller drawdowns ? - read on.

Learning risk control from a Coin Toss example

Simply because a coin only has two outcomes - heads or tails,


everybody knows the odds of a coin toss is 50 / 50.

With large numbers of Coin Tosses, results match the theoretical 50 / 50 outcome.

But most Traders commonly fall right into the Risk Trap of thinking each coin toss
will tend to alternate from heads to tails and then back to heads again.

Reality proves this only happens about 30% of the time.

So what happens the other 70% of the time ?

Exploring the Reality for an Actual 100 Coin Toss Exercise

Take out a coin,


On paper number from 1 -100
Make 100 actual coin tosses.
Recording each of the 100 coin tosses as Heads or Tails.

These next three images are a real recorded 100 coin toss event
Page1

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (2 of 15)8/19/2009 2:17:42 PM


TradeStation Forum - Equity vs Risk Every Trader Needs To Know

Page 2

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (3 of 15)8/19/2009 2:17:42 PM


TradeStation Forum - Equity vs Risk Every Trader Needs To Know

Page 3

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (4 of 15)8/19/2009 2:17:42 PM


TradeStation Forum - Equity vs Risk Every Trader Needs To Know

The ACTUAL results showed a 14% spread instead of the expected 50 / 50 split.

This next image shows the long lossing streaks that occurred in this ACTUAL coin toss sample

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (5 of 15)8/19/2009 2:17:42 PM


TradeStation Forum - Equity vs Risk Every Trader Needs To Know

The next image is critical to understand trading risk, it shows the trading account drawdown percentage that results from
lossing streaks using different percentage of account equity at risk per trade and the single critical element you must
control is what percentage of account equity you risk on each trade you take. That is a most important aspect to your
trading success.

Traders the important part to understand from this posting is every strategy WILL have lossing streaks that most likely
will be bigger than you might think. If you risk too big of a percent of equity on each trade you make your guaranteed
given enough time trading to hit the Risk of Ruin event (in other words -> your account being busted).

I would not presume to suggest what another trader should risk. I do suggest to trade from an informed stand point of
the relationships between position sizing, account equity at risk per trade and drawdowns. What I am saying it this
posting is pick the maximum drawdown percentage your willing to suffer. Look at your strategies consecutive lossing
steaks increase that by a safety margin and then use the chart to pick the percentage account equity at risk that will
keep you under the drawdown level YOU have chosen.

Number One Worst Enemy Of Traders

Uncontrolled Risk from making large equity risking trades. Trading is not swinging for the fence home run while racking
up a long string of strike outs. Controlling risk is the only way to stay in the trading game for the long haul.
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (6 of 15)8/19/2009 2:17:42 PM
TradeStation Forum - Equity vs Risk Every Trader Needs To Know

Critical Key to Successful & Long Term Profitable Trading

Taking a profit from a very large number of extremely small percentage of equity risking trades. Keeping you account
equity at risk per trade in the range from 1/2% to max of 3% . This equity at risk percentage per trade is not talking
about the margin/buying power used to get in the trade it is the amount at equity at risk before your trade position hit
your stoploss. If you do not have a very clearly defined stoploss on every trade, then look out your headed toward
experience a Risk of Ruin experience.

Bottomline
1- Pick the maximum drawdown percentage your willing to suffer.
2- Look at your strategies consecutive loses then increase that number by a safety margin.
3- Next use the chart to pick the percentage account equity at risk that will keep you under the drawdown level YOU
have chosen.

Low Risk Trading Strategy (from Van Tharp)


A Low Risk trading strategy is a strategy with a long-term positive expectancy that's traded at a equity percentage risk
level to allow for the worst possible occurrence in the short term without the Risk of Ruin drawdown so that you are able
to realize the long-term positive expectancy / profits from your strategy.

For more information about

Reading & Understanding TradeStation Preformance Report


&
Proper Steps for Development of a Successful Trading Strategy

Read this posting

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=84601

optionswings Posted - 10/16/2008 10:39:07

Excellent comprehensive report OpusTrader! Will review more closely and see if there is anything to add.
1870 Posts
-OS

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=81816 (7 of 15)8/19/2009 2:17:42 PM

Das könnte Ihnen auch gefallen