{
EasyEmini
A simple short-term e-mini breakout system to illustrate the use of
Monte Carlo simulation for position sizing.
System: Buy at a fraction of yesterday's range from yesterday's high. Hold
1 day then look to exit on the first profitable open. Use a fixed money
management stop (nominally $1000 in the e-mini).
WARNING: This system looks ahead one day to the next day's open to decide whether
to exit the open position. Consequently, the system never executes on the last bar
of data on the chart. This means that the entry order for the next day will not
appear in the TradeStation Tracking Center.
ATTENTION TRADESTATION 2000i USERS
This system includes a call to function MonteCarlo, which performs Monte Carlo
simulation for position sizing. MonteCarlo only works in TradeStation 2000i
because it uses built-in function Random, which is new to 2000i. I have
commented out the call to MonteCarlo so that this system will work properly for
TradeStation 4.0 users. If you are a TradeStation 2000i user, you can download
function MonteCarlo for free from my web site (address below). Remove the
comment braces {..} from the call to the line below that begins "Value1 = ...".
This will enable the call to MonteCarlo.
The MonteCarlo code records the profits and losses from the trading system and
generates random sequences of the trades. For each sequence, it
calculates the return and drawdown assuming a fixed percent of the account is
risked on each trade. The output is the probability that with a given
account size and risk percentage you can meet given rate of return and drawdown
goals. For example, it might calculate the probability that you can achieve
a rate of return of 50% with 30% drawdown by risking 10% on each trade.
I have developed a version of MonteCarlo with additional functionality and
several input and output options that will work with either TradeStation 2000i
or 4.0. This version can be purchased on my web site.
Copyright 2001 Breakout Future
www.BreakoutFutures.com
mrb@BreakoutFutures.com
}
Input: ASize (30000), { account size, $ }
RetGoal (50), { rate of return goal, %}
DDGoal (30), { max closed out trade drawdown, % }
RiskPer (10), { percentage risk per trade }
EntFrac (0.75), { multiple of prior day's range for entering }
MMStop (1000), { money management stop, $ }
NRand (1000); { number of random sequences }
Var: EntPr (0), { Entry target price }
XitPr (0), { mm stop exit price }
TrRisk (0); { trade risk, $ }
TrRisk = MMStop;
{ Entry conditions }
EntPr = H + EntFrac * (H - L);
If C > C[1] then
Buy next bar at EntPr Stop;
{ Exit conditions }
Exitlong("MMStop") next bar at EntryPrice - MMStop/BigPointValue stop;
If BarsSinceEntry >= 1 and open of next bar > EntryPrice then
ExitLong("ProfOpen") next bar at market;
{ Perform Monte Carlo analysis: MonteCarlo only works in TradeStation 2000i }
{Value1 = MonteCarlo(ASize, RetGoal, DDGoal, RiskPer, TrRisk, NRand); }