I don't think there are any backtesting sites. I think
backtesting comes only with certain trading platforms. I use
Tradestation and love the backtesting capabilitiies it offers.
Especially since I have the option of creating my own strategies
with the TS Easy Langauage programming capability. TD Ameritrade
aso has backtesting capability, but I am not familiar with it, but
I believes that other members might be.
I use a custom session time in TS set to end at 3:59 PM and the
following code to exit EOD:
SetExitOnClose;
P.S. I have also tested other session end times for the last 5
minutes of the regular session for the SRS 15 min system and
find that 3:59 PM is the optimum time for EOD exit.
The SetExitOnClose statement does not work for automated trading
at regular session end time of 4:00 PM, but works fine for custome
session times ending before 4:00 PM.
if CurrentBar > 1 then
begin
if time < 946 then
begin
if Open <= Close[1] then
begin
GapIsUp = False;
// Print ( " CurrentBar ", CurrentBar, "
GapIsUp ", GapIsUp);
end;
if Open >= Close[1] then
begin
GapIsDn = False;
// Print ( " CurrentBar ", CurrentBar, "
GapIsDn ", GapIsDn);
end;
if Open > Close[1] then
begin
GapIsUp = True;
GapUpBar = BarNumber;
GapUp = Open - Close[1];
// Print (" CurrentBar ", CurrentBar, "
GapIsUp ", GapIsUp, " Open ", Open, " Close[1] ", Close[1], " GapUp
", GapUp);
end;
if Open > Close[1] then
begin
GapIsUp = True;
GapUpBar = BarNumber;
GapUp = Open - Close[1];
// Print (" CurrentBar ", CurrentBar, "
GapIsUp ", GapIsUp, " Open ", Open, " Close[1] ", Close[1], " GapUp
", GapUp);
end;
if Open < Close[1] then
begin
GapIsDn = True;
GapDnBar = BarNumber;
GapDn = Close[1] - Open;
// Print (" CurrentBar ", CurrentBar, "
GapIsDn ", GapIsDn, " Open ", Open, " Close[1] ", Close[1], " GapDn
", GapDn);
end;
end;
end;
if GapIsUp then
begin
if CurrentBar > 1 and CurrentBar < GapUpBar +
FastLength then
begin
x = FastLength -(FastLength -(CurrentBar -
GapUpBar));
for i = 0 to x
begin
GapUpSum = GapUpSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, "
GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, "
Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
for i = x + 1 to FastLength - 1
begin
GapUpSum = GapUpSum + Close[i] + GapUp;
// Print ("2", " CurrentBar ", CurrentBar, "
GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, "
Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
FastAvg = GapUpSum / FastLength;
// Print (" FastAvg ", FastAvg);
GapUpSum = 0;
end;
if CurrentBar > 1 and CurrentBar < GapUpBar +
SlowLength then
begin
y = SlowLength -(SlowLength -(CurrentBar -
GapUpBar));
for i = 0 to y
begin
GapUpSum = GapUpSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, "
GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, "
Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
for i = y + 1 to SlowLength - 1
begin
GapUpSum = GapUpSum + Close[i] + GapUp;
// Print ("2", " CurrentBar ", CurrentBar, "
GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, "
Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
SlowAvg = GapUpSum / SlowLength;
// Print (" SlowAvg ", SlowAvg);
GapUpSum = 0;
end;
end;
if GapIsDn then
begin
if CurrentBar > 1 and CurrentBar < GapDnBar +
FastLength then
begin
x = FastLength -(FastLength -(CurrentBar -
GapDnBar));
for i = 0 to x
begin
GapDnSum = GapDnSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, "
GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, "
Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
for i = x + 1 to FastLength - 1
begin
GapDnSum = GapDnSum + Close[i] - GapDn;
// Print ("2", " CurrentBar ", CurrentBar, "
GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, "
Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
FastAvg = GapDnSum / FastLength;
// Print (" FastAvg ", FastAvg);
GapDnSum = 0;
end;
if CurrentBar > 1 and CurrentBar < GapDnBar +
SlowLength then
begin
y = SlowLength -(SlowLength -(CurrentBar -
GapDnBar));
for i = 0 to y
begin
GapDnSum = GapDnSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, "
GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, "
Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
for i = y + 1 to SlowLength - 1
begin
GapDnSum = GapDnSum + Close[i] - GapDn;
// Print ("2", " CurrentBar ", CurrentBar, "
GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, "
Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
SlowAvg = GapDnSum / SlowLength;
// Print (" SlowAvg ", SlowAvg);
GapDnSum = 0;
end;
I thought some might be intersted in this. As is usually pointed
out in system results summaries posted by Matt and Steve the
results assume all trades at $100,000 each (actually the trades are
rounded down to the nearest 5 shares). These are the results for
those trades since July 2007 (same as posted on 4/21/2009 update)
compared to what the results would be if net profits were
reinvested in the trades. If you thought the $100,000 trade results
were awesome, wait until you see these results. If anyone would be
interested in the TS code I developed to generate these
results, please send me a PM.
Tradestation has a series of patches for various versions to
load to fix the recent problems. I installed the patch last night
and have not had any problems today.
As mentioned in a post earlier today and several weeks ago here
is the first of a series of posts I plan to make to share my
experience in developing mechanical systems for the 3X ETF's
recently introduced this past November (BGU/BGZ, ERX/ERY, FAS/FAZ,
TNA/TZA). I have primarily been working with 15 min charts but plan
to look at other time frames once I finish with the 15 min systems.
The first and relatively simple strategy I've tested is a SMA
crossover long/short strategy without exiting at EOD using the
following Easy Language code in TS:
inputs: MALength1 (10), MALength2 (20);
if average (close, MALength1) > average (close, MALength2)
then
Buy ( "LE" ) next bar at market ;
if average (close, MALength1) < average (close, MALength2)
then
SellShort ( "SE" ) next bar at market ;
If you are interested in learning Easy Language, send me a PM
with any questions about this code. So far, I have not found it
that difficult to learn but I have a limited background in a few
programming languages which might make it a litlle bit easier for
me to learn. I have always found programming to be exciting once
you put together a set of codes and get a successful run of the
program after sometimes frustrating debugging work. In my opinion,
programming is about the only advantage we slow thinking humans
have over computers because the computers only do what they are
programmed to do. Whether you have any programming experience or
not, I would think that Easy Language might not be a bad one to
learn since it is only designed to process market trade data and
nothing else. When I post the more complicated codes for the other
strategies I've been working with I'll add comments to explain the
code.
Assumptions for optimizing the srategies are $0.01/share
commission, no slippage, and $10,000 trades rounded to the nearest
1 share
A 15/70 SMA crossover strategy used since inception through
today would have resulted in a net (closed equity) profit of
$36,820 and mark-market (open equity)profit of $36,071
(360% return in a little over 4 months). If I attached the image
files correctly you should be able to see other data and and equity
curve graph to get a better feel for the performance.
If you decide to use this strategy, please keep in mind that
compared to other systems on the blog the backtested interval is
limited at only 4+ months and would only be optimal in a similar
future market. I would expect for example that the parameters could
change signifcantly when the next bull market is confirmed and has
a slow recovery. For me to get comfortable with the limited data, I
backtested over 1, 2, 3, & 4 month periods and discoverd that
the optimum parameters start getting pretty close after only 2
months of data. I would expect some slight changes in future months
until we see the end of the bear market. I'll retest and advise
accordingly.
In some of my earlier testing about a month ago I compared EMA
and EOD systems and found the SMA without EOD exit to be the most
profitable. I haven't compared these with another months worth of
data, but plan to do so. To date I have spent only a few hundred
hours working on these with about 20 hours on weekends and 2 to
4 hours after work each day for at least a couple of months.
It has been an incredible experience and learning opportunity for
me so far.
Some of the strategies I've been testing involve as many as 4 to
5 parameters and take more than 24 hours to run a single
optimization. I'm waiting on my new quad core computer system to
help speed up the process up a bit. More to follow..
I have been working on several systems over the last couple of
months while data was being accumulated since the recent inception
of the 3x ETFs. For a 15 min FAS sytem a 15/70 SMA cross works
nicely without exiting at EOD. I don't have the data in front of
me, but I believe the return on FAS was 347% in 4+ months. I have a
few other intersting strategies to share as well that apply
multipliers to moving averages intended to look at trading only
with strong moves up or down. More to follow after end of March
when I'll backtest again to see if the optimium parameters are
holding up. I'll even post the Easy Language code for these for TS
users. FAS/FAZ as you might expect have been the most profitable
systems from what I've tested, but I've also been working with
ERX/ERY, BGU/BGZ, and TNA/TZA.
A friend of mine told me about a tip he learned to actually
writie down trading rules for my trading style. I only swing trade
as I have a full time job, so these rules may change when I retire
and start day trading full time. For now these simple rules ensure
that my trades are entirely objective and completely take out any
emotion based trades I might otherwise make which are always
tempting. Others may find them useful. Here are a few of them:
1. Never place an order without first determing how much loss I
am willing to risk. To accomplish this I always send a sell order
with at an appropriate stop at the same time I send a buy order
using OSO (order sends order) type orders.
2. Never place an order assuming the the equity will move in a
certain direction. Wait for the move, then place the order. To do
this I use buy stop orders above resistance trendlines or above
support trendlines after a bounce off support. As per rule No.1
above, buy stop orders are placed with sell stop orders with the
initial stop placed just below the resistance trendline or just
below the support trendline depending on where I get in. In the
case of symmetrical triangles or other situations with uncertain
potential direction, I place both buy and sell short stop orders
above and below the triangle respectively with initial stops just
inside the triangle.
3. Never give up profits on a winning trade. To do this I move
stops at least up to break even as soon as possible and maintain
tight stops as long as the trend continues. If I get stopped out in
a channel trend I can always get back in at the bottom of the
channel off support.
4. After a nice profit reward yourself. I'm taking part of
last weeks profits to buy a high end laptop trading system.
These trading rules below should help your swing trading
efforts yield more profits. By following some trading rules,
your trading approach will be far superior to any trading method
without rules. The objective for all of us is to maximize
gains while minimizing losses along the way. Successful
trading requires discipline, and these guidelines will help you in
your quest for profitability.
1. Emotional control is at the heart of good
trading.
Controlling yourself allows the ability to think
clearly at each moment, resulting in success as a trader.
2. Cut losses with the most strict
discipline.
We must preserve capital at all times. Losing is
part of trading, but opportunity cost is to be considered when
hoping for a losing position to reverse course. If your trade
reverses and violates support, get out and be willing to
re-enter. This will save you from big losses and you can
always re-enter if the stock crosses the entry price again.
3. Make good decisions and winning will take
care of itself.
Focus on how you play the game and not on the
scoreboard. Trade with discipline and follow your game plan.
4. When you lose, don't lose the lesson!
Forget the names but remember the events. Those
who don't remember the past are doomed to repeat it. Make
mistakes with composure and character, without blaming others, and
don't dwell on mistakes.
5. When in doubt, get out.
Scrutinize your positions at all times, each day, and
you will not be left holding a stock without reason. Be
willing to change direction at any time, because your flexibility
as an individual investor is a big advantage which should be
embraced!
6. Keep your risk/reward profile in check.
Profits can exceed losses even if the number of losing
trades is greater than the number of winning trades. Always
properly manage money, size positions accordingly, obey stops, and
protect profits. This will keep you in the game!
7. Avoid scheduled news.
We are unable to foresee breaking news, but scheduled
news we can step aside from. Scheduled news includes interest
rate announcements, corporate earnings announcements, and various
daily economic releases. Remember to trade only when you've
got the best of conditions.
8. Consider your account size for
appropriate trading.
An account that is too small magnifies the effects of
each trade, which keeps us from thinking rationally. Trade
with the attitude that the next trade will simply be 1 of the next
1000 trades you will make.
9. Get a charting program that allows you to
build watch lists, sort stocks, and draw trendlines.
This is essential to learning. Price action and
volume are vitally important in finding good
chart
patterns.
10. Scale out of winning positions as they
work for you.
This achieves two goals: taking some off the
table and keeping you in the game. If your trade reverses,
you took some profit at good spots. If the move continues,
you are still on board for the ride.
11. Don't dig yourself into a hole early in
the day or in your career.
Be willing to observe the market and make an informed
decision. Missed money is better than lost money, so wait
patiently for the best opportunities to arrive.
12. Trade with a blend of anticipation and
confirmation.
Balancing these two will mean that you adopt a system
of "if this happens, I will do that." Wait for your pitch!
13. Beware of your trading process following
a winning streak.
After a win streak, be extra disciplined! Many
will make money in the market, but discipline is required to KEEP
it. Stay on your guard at all times!
14. Evaluate your results at least monthly.
Monitor your P&L, your win/loss ratio, and the
relationship between your biggest wins and worst losses.
Reviewing these results helps you continually improve your
understanding of the markets and yourself.
15. Finally (perhaps most important), always
be patient.
Long-term patience will keep your confidence and
optimism high, and short-term patience will help you wait for the
best trades. Success doesn't come easy, and rarely are
fortunes made overnight. Be willing to pay your dues and put
in the work in order to achieve your goals.
I have started work on developing mechanical system trading
strategies for the new triple ETFs. Initial work and plan is based
on the following concepts:
Only long positions are taken on the bull and short (inverse)
ETFs (this will allow the use of different parameters in uptrending
versus downtrending patterns and avoids availability issues for
shorting) This may result in open positions on both at the same
time.
Long postions are only entered after the price or short period
moving average crosses over a long period moving average
Positions are exited upon decreasing short period moving average
and/or with trailing stop and re-entered when the short period
average increases (the exit won't wait until the short period
average crosses back over the long term moving average) Using a
short period moving average crossover of the open and close
averages will also be looked at as well as a crossover of high and
low averages (pretty intersting so far testing this option on BGU
and BGZ)
End of day exits will be compared to continuing postions until
exit points above are reached
Simple and exponential averages will be compared and
optimized
Only 15 min interval data will be used initially
Systems will be optimized monthly with backtesting on a prior 2
- 3 month period as opposed to long term backtesting to refelect
recent market activity and trends
Initial results look favorable for BGU and BGZ
I am not a professional programmer, but have experience in
programming, and I am qucikly learning the Easy Language
codes used in Tradestation trading platforms. I'll provide the
codes as I complete each set of triple ETFs for review. Hopefully,
the result will be one set of codes that would apply to all the
ETFs with different quantities for moving average periods and
possibly trailing stop percentage to optimize for each.
A few observations so far: May result in up to 10 trades in
a day on occasion and that winning trade percentage should be in
the 30% to 40+% range with significantly higher profits on winning
trades than losses on losing trades. Equity performance graphs
could be quite choppy, but will hopefully result in higher rates of
return.
In the meantime, any comments or thoughts on the concept woud be
appreciated.
If anyone would like to collaborate on this effort, please send
PM.
I'm also learning about scanning. I came up with ABK, ADRD,
FDML, MHLD, MGK, VBK on a simple high volume gain scan
tonight. Some of these appear to have recently broken out
on light volume and now starting to bounce off BO with good volume
after initial pullback. I've also worked with indicator crossover
scans and from these attempt to identify setup patterns, but
am curious as to what techniques typically work best for scanning
for setups. I found a nice setup on BC a few days ago with the
crossover scan that Matt kindly confirmed for me.
Matt/Steve,
Would you guys mind talking about pattern measurement examples
on watch list ideas on occasion in updates and/or newsletter?
It might be helpful to include a recommended stop in
the triggered list and even the untriggered list for those who
want to enter postions early where a stop can be determined such as
the current HIG bull flag opportunity with a stop at around 15 as
shown on the chart.
A rate of return calculation could also be useful in addition to
the G/L% data.
As a new trader I'd like to get some feedback on this potential
opportunity. Good breakout above resistance on moderate volume
(partial trading day), positive divergence and 0 crossovers on MACD
and TRIX with 20 crossover on 60 period stochastics. Any comments
would be appreciated.
The community is delayed by three days for non registered users.
Premium Content
mechanical systems summary sticky
Posted by cnaquin on 26th of May 2009 at 11:14 pm
Look under the subject tab. See the link to real time system charts there.
MDVN
Posted by cnaquin on 22nd of May 2009 at 11:19 am
BO on open with little pullback to get in. Nice so far.
I had same problem. TS
AU
Posted by cnaquin on 22nd of May 2009 at 10:28 am
I had same problem. TS just advised to disconnect and reconnect which worked fine for me.
I don't think there are
Backtesting Sites
Posted by cnaquin on 20th of May 2009 at 10:41 pm
I don't think there are any backtesting sites. I think backtesting comes only with certain trading platforms. I use Tradestation and love the backtesting capabilitiies it offers. Especially since I have the option of creating my own strategies with the TS Easy Langauage programming capability. TD Ameritrade aso has backtesting capability, but I am not familiar with it, but I believes that other members might be.
Carey
I use a custom session
End of day exits on TS
Posted by cnaquin on 20th of May 2009 at 10:25 pm
I use a custom session time in TS set to end at 3:59 PM and the following code to exit EOD:
SetExitOnClose;
P.S. I have also tested other session end times for the last 5 minutes of the regular session for the SRS 15 min system and find that 3:59 PM is the optimum time for EOD exit.
The SetExitOnClose statement does not work for automated trading at regular session end time of 4:00 PM, but works fine for custome session times ending before 4:00 PM.
Carey
Title: Gap Adjusted SMA Code Still
Gap Adjusted SMA's
Posted by cnaquin on 18th of May 2009 at 10:42 pm
Still no code, so let's try this:
inputs:
FastLength (5),
SlowLength (10);
variables:
FastAvg (0),
SlowAvg (0),
GapIsUp (False),
GapIsDn (False),
GapUpBar (0),
GapDnBar (0),
GapUp (0),
GapDn (0),
GapUpSum (0),
GapDnSum (0),
i (0),
x (0),
y (0);
FastAvg = AverageFC (Close, FastLength);
SlowAvg = AverageFC (Close, SlowLength);
if CurrentBar > 1 then
begin
if time < 946 then
begin
if Open <= Close[1] then
begin
GapIsUp = False;
// Print ( " CurrentBar ", CurrentBar, " GapIsUp ", GapIsUp);
end;
if Open >= Close[1] then
begin
GapIsDn = False;
// Print ( " CurrentBar ", CurrentBar, " GapIsDn ", GapIsDn);
end;
if Open > Close[1] then
begin
GapIsUp = True;
GapUpBar = BarNumber;
GapUp = Open - Close[1];
// Print (" CurrentBar ", CurrentBar, " GapIsUp ", GapIsUp, " Open ", Open, " Close[1] ", Close[1], " GapUp ", GapUp);
end;
if Open > Close[1] then
begin
GapIsUp = True;
GapUpBar = BarNumber;
GapUp = Open - Close[1];
// Print (" CurrentBar ", CurrentBar, " GapIsUp ", GapIsUp, " Open ", Open, " Close[1] ", Close[1], " GapUp ", GapUp);
end;
if Open < Close[1] then
begin
GapIsDn = True;
GapDnBar = BarNumber;
GapDn = Close[1] - Open;
// Print (" CurrentBar ", CurrentBar, " GapIsDn ", GapIsDn, " Open ", Open, " Close[1] ", Close[1], " GapDn ", GapDn);
end;
end;
end;
if GapIsUp then
begin
if CurrentBar > 1 and CurrentBar < GapUpBar + FastLength then
begin
x = FastLength -(FastLength -(CurrentBar - GapUpBar));
for i = 0 to x
begin
GapUpSum = GapUpSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, " GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, " Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
for i = x + 1 to FastLength - 1
begin
GapUpSum = GapUpSum + Close[i] + GapUp;
// Print ("2", " CurrentBar ", CurrentBar, " GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, " Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
FastAvg = GapUpSum / FastLength;
// Print (" FastAvg ", FastAvg);
GapUpSum = 0;
end;
if CurrentBar > 1 and CurrentBar < GapUpBar + SlowLength then
begin
y = SlowLength -(SlowLength -(CurrentBar - GapUpBar));
for i = 0 to y
begin
GapUpSum = GapUpSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, " GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, " Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
for i = y + 1 to SlowLength - 1
begin
GapUpSum = GapUpSum + Close[i] + GapUp;
// Print ("2", " CurrentBar ", CurrentBar, " GapUpBar ", GapUpBar, " GapUp ", GapUp, " GapUpSum ", GapUpSum, " Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
SlowAvg = GapUpSum / SlowLength;
// Print (" SlowAvg ", SlowAvg);
GapUpSum = 0;
end;
end;
if GapIsDn then
begin
if CurrentBar > 1 and CurrentBar < GapDnBar + FastLength then
begin
x = FastLength -(FastLength -(CurrentBar - GapDnBar));
for i = 0 to x
begin
GapDnSum = GapDnSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, " GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, " Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
for i = x + 1 to FastLength - 1
begin
GapDnSum = GapDnSum + Close[i] - GapDn;
// Print ("2", " CurrentBar ", CurrentBar, " GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, " Close ", Close, " Close[i] ", i, x, " ", Close[i]);
end;
FastAvg = GapDnSum / FastLength;
// Print (" FastAvg ", FastAvg);
GapDnSum = 0;
end;
if CurrentBar > 1 and CurrentBar < GapDnBar + SlowLength then
begin
y = SlowLength -(SlowLength -(CurrentBar - GapDnBar));
for i = 0 to y
begin
GapDnSum = GapDnSum + Close[i];
// Print ("1", " CurrentBar ", CurrentBar, " GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, " Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
for i = y + 1 to SlowLength - 1
begin
GapDnSum = GapDnSum + Close[i] - GapDn;
// Print ("2", " CurrentBar ", CurrentBar, " GapDnBar ", GapDnBar, " GapDn ", GapDn, " GapDnSum ", GapDnSum, " Close ", Close, " Close[i] ", i, y, " ", Close[i]);
end;
SlowAvg = GapDnSum / SlowLength;
// Print (" SlowAvg ", SlowAvg);
GapDnSum = 0;
end;
end;
Plot1 (FastAvg, "FastAvg");
Plot2 (SlowAvg, "SlowAvg");
Carey
Gap_Adjusted_SMA_Indicator.png This time with links that
Gap Adjusted SMA's
Posted by cnaquin on 18th of May 2009 at 10:40 pm
This time with links that will hopefully have the TS code.
Carey
Gap Adjusted SMA's
Posted by cnaquin on 18th of May 2009 at 10:36 pm
Here is my version of a gap adjusted simple moving average indicator and the TS Easy Langauge code to go along with it. Please note on the image that the dashed line is the gap adjusted SMA's and the solid lines are the regular SMA's. This particular image is of a gap on SPY using 6/12 regular and gap adjusted SMA's.
Please note that the code only works on a 15 min chart. If you want to modify the code for other time frames send me a PM and I'll walk you through the process. It is a simple matter of changing a few time related entries in the code. I'll also be gald to answer any other questions you might have.
Carey
SRS 15 Min System
Posted by cnaquin on 26th of Apr 2009 at 12:37 pm
I thought some might be intersted in this. As is usually pointed out in system results summaries posted by Matt and Steve the results assume all trades at $100,000 each (actually the trades are rounded down to the nearest 5 shares). These are the results for those trades since July 2007 (same as posted on 4/21/2009 update) compared to what the results would be if net profits were reinvested in the trades. If you thought the $100,000 trade results were awesome, wait until you see these results. If anyone would be interested in the TS code I developed to generate these results, please send me a PM.
Carey
Tradestation
charts tradestation
Posted by cnaquin on 24th of Apr 2009 at 10:10 am
Tradestation has a series of patches for various versions to load to fix the recent problems. I installed the patch last night and have not had any problems today.
Carey
FAS Mech System
Posted by cnaquin on 25th of Mar 2009 at 11:32 pm
As mentioned in a post earlier today and several weeks ago here is the first of a series of posts I plan to make to share my experience in developing mechanical systems for the 3X ETF's recently introduced this past November (BGU/BGZ, ERX/ERY, FAS/FAZ, TNA/TZA). I have primarily been working with 15 min charts but plan to look at other time frames once I finish with the 15 min systems. The first and relatively simple strategy I've tested is a SMA crossover long/short strategy without exiting at EOD using the following Easy Language code in TS:
inputs: MALength1 (10), MALength2 (20);
if average (close, MALength1) > average (close, MALength2) then
Buy ( "LE" ) next bar at market ;
if average (close, MALength1) < average (close, MALength2) then
SellShort ( "SE" ) next bar at market ;
If you are interested in learning Easy Language, send me a PM with any questions about this code. So far, I have not found it that difficult to learn but I have a limited background in a few programming languages which might make it a litlle bit easier for me to learn. I have always found programming to be exciting once you put together a set of codes and get a successful run of the program after sometimes frustrating debugging work. In my opinion, programming is about the only advantage we slow thinking humans have over computers because the computers only do what they are programmed to do. Whether you have any programming experience or not, I would think that Easy Language might not be a bad one to learn since it is only designed to process market trade data and nothing else. When I post the more complicated codes for the other strategies I've been working with I'll add comments to explain the code.
Assumptions for optimizing the srategies are $0.01/share commission, no slippage, and $10,000 trades rounded to the nearest 1 share
A 15/70 SMA crossover strategy used since inception through today would have resulted in a net (closed equity) profit of $36,820 and mark-market (open equity)profit of $36,071 (360% return in a little over 4 months). If I attached the image files correctly you should be able to see other data and and equity curve graph to get a better feel for the performance.
If you decide to use this strategy, please keep in mind that compared to other systems on the blog the backtested interval is limited at only 4+ months and would only be optimal in a similar future market. I would expect for example that the parameters could change signifcantly when the next bull market is confirmed and has a slow recovery. For me to get comfortable with the limited data, I backtested over 1, 2, 3, & 4 month periods and discoverd that the optimum parameters start getting pretty close after only 2 months of data. I would expect some slight changes in future months until we see the end of the bear market. I'll retest and advise accordingly.
In some of my earlier testing about a month ago I compared EMA and EOD systems and found the SMA without EOD exit to be the most profitable. I haven't compared these with another months worth of data, but plan to do so. To date I have spent only a few hundred hours working on these with about 20 hours on weekends and 2 to 4 hours after work each day for at least a couple of months. It has been an incredible experience and learning opportunity for me so far.
Some of the strategies I've been testing involve as many as 4 to 5 parameters and take more than 24 hours to run a single optimization. I'm waiting on my new quad core computer system to help speed up the process up a bit. More to follow..
I have been working on
faz
Posted by cnaquin on 25th of Mar 2009 at 03:30 pm
I have been working on several systems over the last couple of months while data was being accumulated since the recent inception of the 3x ETFs. For a 15 min FAS sytem a 15/70 SMA cross works nicely without exiting at EOD. I don't have the data in front of me, but I believe the return on FAS was 347% in 4+ months. I have a few other intersting strategies to share as well that apply multipliers to moving averages intended to look at trading only with strong moves up or down. More to follow after end of March when I'll backtest again to see if the optimium parameters are holding up. I'll even post the Easy Language code for these for TS users. FAS/FAZ as you might expect have been the most profitable systems from what I've tested, but I've also been working with ERX/ERY, BGU/BGZ, and TNA/TZA.
Writing Trading Rules
Posted by cnaquin on 23rd of Mar 2009 at 11:57 pm
A friend of mine told me about a tip he learned to actually writie down trading rules for my trading style. I only swing trade as I have a full time job, so these rules may change when I retire and start day trading full time. For now these simple rules ensure that my trades are entirely objective and completely take out any emotion based trades I might otherwise make which are always tempting. Others may find them useful. Here are a few of them:
1. Never place an order without first determing how much loss I am willing to risk. To accomplish this I always send a sell order with at an appropriate stop at the same time I send a buy order using OSO (order sends order) type orders.
2. Never place an order assuming the the equity will move in a certain direction. Wait for the move, then place the order. To do this I use buy stop orders above resistance trendlines or above support trendlines after a bounce off support. As per rule No.1 above, buy stop orders are placed with sell stop orders with the initial stop placed just below the resistance trendline or just below the support trendline depending on where I get in. In the case of symmetrical triangles or other situations with uncertain potential direction, I place both buy and sell short stop orders above and below the triangle respectively with initial stops just inside the triangle.
3. Never give up profits on a winning trade. To do this I move stops at least up to break even as soon as possible and maintain tight stops as long as the trend continues. If I get stopped out in a channel trend I can always get back in at the bottom of the channel off support.
4. After a nice profit reward yourself. I'm taking part of last weeks profits to buy a high end laptop trading system.
Carey
Swing Trading Rules
Posted by cnaquin on 23rd of Mar 2009 at 11:00 pm
Trading Rules for Swing Trading
These trading rules below should help your swing trading efforts yield more profits. By following some trading rules, your trading approach will be far superior to any trading method without rules. The objective for all of us is to maximize gains while minimizing losses along the way. Successful trading requires discipline, and these guidelines will help you in your quest for profitability.
1. Emotional control is at the heart of good trading.
Controlling yourself allows the ability to think clearly at each moment, resulting in success as a trader.
2. Cut losses with the most strict discipline.
We must preserve capital at all times. Losing is part of trading, but opportunity cost is to be considered when hoping for a losing position to reverse course. If your trade reverses and violates support, get out and be willing to re-enter. This will save you from big losses and you can always re-enter if the stock crosses the entry price again.
3. Make good decisions and winning will take care of itself.
Focus on how you play the game and not on the scoreboard. Trade with discipline and follow your game plan.
4. When you lose, don't lose the lesson!
Forget the names but remember the events. Those who don't remember the past are doomed to repeat it. Make mistakes with composure and character, without blaming others, and don't dwell on mistakes.
5. When in doubt, get out.
Scrutinize your positions at all times, each day, and you will not be left holding a stock without reason. Be willing to change direction at any time, because your flexibility as an individual investor is a big advantage which should be embraced!
6. Keep your risk/reward profile in check.
Profits can exceed losses even if the number of losing trades is greater than the number of winning trades. Always properly manage money, size positions accordingly, obey stops, and protect profits. This will keep you in the game!
7. Avoid scheduled news.
We are unable to foresee breaking news, but scheduled news we can step aside from. Scheduled news includes interest rate announcements, corporate earnings announcements, and various daily economic releases. Remember to trade only when you've got the best of conditions.
8. Consider your account size for appropriate trading.
An account that is too small magnifies the effects of each trade, which keeps us from thinking rationally. Trade with the attitude that the next trade will simply be 1 of the next 1000 trades you will make.
9. Get a charting program that allows you to build watch lists, sort stocks, and draw trendlines.
This is essential to learning. Price action and volume are vitally important in finding good chart patterns .
10. Scale out of winning positions as they work for you.
This achieves two goals: taking some off the table and keeping you in the game. If your trade reverses, you took some profit at good spots. If the move continues, you are still on board for the ride.
11. Don't dig yourself into a hole early in the day or in your career.
Be willing to observe the market and make an informed decision. Missed money is better than lost money, so wait patiently for the best opportunities to arrive.
12. Trade with a blend of anticipation and confirmation.
Balancing these two will mean that you adopt a system of "if this happens, I will do that." Wait for your pitch!
13. Beware of your trading process following a winning streak.
After a win streak, be extra disciplined! Many will make money in the market, but discipline is required to KEEP it. Stay on your guard at all times!
14. Evaluate your results at least monthly.
Monitor your P&L, your win/loss ratio, and the relationship between your biggest wins and worst losses. Reviewing these results helps you continually improve your understanding of the markets and yourself.
15. Finally (perhaps most important), always be patient.
Long-term patience will keep your confidence and optimism high, and short-term patience will help you wait for the best trades. Success doesn't come easy, and rarely are fortunes made overnight. Be willing to pay your dues and put in the work in order to achieve your goals.
3X ETFs Mech Systems
Posted by cnaquin on 19th of Jan 2009 at 02:01 pm
I have started work on developing mechanical system trading strategies for the new triple ETFs. Initial work and plan is based on the following concepts:
Only long positions are taken on the bull and short (inverse) ETFs (this will allow the use of different parameters in uptrending versus downtrending patterns and avoids availability issues for shorting) This may result in open positions on both at the same time.
Long postions are only entered after the price or short period moving average crosses over a long period moving average
Positions are exited upon decreasing short period moving average and/or with trailing stop and re-entered when the short period average increases (the exit won't wait until the short period average crosses back over the long term moving average) Using a short period moving average crossover of the open and close averages will also be looked at as well as a crossover of high and low averages (pretty intersting so far testing this option on BGU and BGZ)
End of day exits will be compared to continuing postions until exit points above are reached
Simple and exponential averages will be compared and optimized
Only 15 min interval data will be used initially
Systems will be optimized monthly with backtesting on a prior 2 - 3 month period as opposed to long term backtesting to refelect recent market activity and trends
Initial results look favorable for BGU and BGZ
I am not a professional programmer, but have experience in programming, and I am qucikly learning the Easy Language codes used in Tradestation trading platforms. I'll provide the codes as I complete each set of triple ETFs for review. Hopefully, the result will be one set of codes that would apply to all the ETFs with different quantities for moving average periods and possibly trailing stop percentage to optimize for each.
A few observations so far: May result in up to 10 trades in a day on occasion and that winning trade percentage should be in the 30% to 40+% range with significantly higher profits on winning trades than losses on losing trades. Equity performance graphs could be quite choppy, but will hopefully result in higher rates of return.
In the meantime, any comments or thoughts on the concept woud be appreciated.
If anyone would like to collaborate on this effort, please send PM.
Scanning
THQI - Thoughts?
Posted by cnaquin on 9th of Jan 2009 at 12:52 am
I'm also learning about scanning. I came up with ABK, ADRD, FDML, MHLD, MGK, VBK on a simple high volume gain scan tonight. Some of these appear to have recently broken out on light volume and now starting to bounce off BO with good volume after initial pullback. I've also worked with indicator crossover scans and from these attempt to identify setup patterns, but am curious as to what techniques typically work best for scanning for setups. I found a nice setup on BC a few days ago with the crossover scan that Matt kindly confirmed for me.
Matt/Steve,
Would you guys mind talking about pattern measurement examples on watch list ideas on occasion in updates and/or newsletter?
Watch List
Watch List Updated
Posted by cnaquin on 4th of Jan 2009 at 12:26 pm
A couple of suggestions for the watch list:
It might be helpful to include a recommended stop in the triggered list and even the untriggered list for those who want to enter postions early where a stop can be determined such as the current HIG bull flag opportunity with a stop at around 15 as shown on the chart.
A rate of return calculation could also be useful in addition to the G/L% data.
Thanks and Happy New Year
BC
Posted by cnaquin on 31st of Dec 2008 at 03:43 pm
Thanks and Happy New Year to all!!!!!!
BC
Posted by cnaquin on 31st of Dec 2008 at 03:32 pm
As a new trader I'd like to get some feedback on this potential opportunity. Good breakout above resistance on moderate volume (partial trading day), positive divergence and 0 crossovers on MACD and TRIX with 20 crossover on 60 period stochastics. Any comments would be appreciated.
BC
HL
Posted by cnaquin on 29th of Dec 2008 at 12:00 pm
HL (from the watch list) made a nice move today so far. I'm a new member and this was my first trade. Thanks for an excellent website.