MM stop loss not working and meaningless

360 views
Skip to first unread message

EURGBP

unread,
Feb 25, 2012, 10:35:03 AM2/25/12
to Adaptrade Builder
for example in EURUSD
weekly chart
{
EasyLanguage Strategy Code
Population member: 14365
Max bars back: 1

Created by: Adaptrade Builder version 1.2.3.1
Created: 21-Feb-2012 23:31:15

Compatible with TradeStation 6 or newer

Price File: C:\downloads\!adaptrade\EURUSD10080-ndd.csv
Build Dates: 03-Jan-1999 to 04-Apr-2004

Project File: C:\downloads\!adaptrade\eurusd-weekly-09.gpstrat
}

{ Strategy inputs }
Inputs: MMStopSz (31.00),
NBarExS (18);

{ Variables for entry and exit prices }
Var: EntPrL (0),
EntPrS (0);

{ Variables for entry and exit conditions }
Var: EntCondL (false),
EntCondS (false),
ExCondL (false),
EndofSess (false);

{ Entry prices }
EntPrL = H;
EntPrS = L;

{ Entry and exit conditions }
EntCondL = true;
EntCondS = true;
ExCondL = true;
EndofSess = false;
If DataCompression >= 1 and DataCompression <= 4 then
EndofSess = time = SessionEndTime(0, 1);

{ Entry orders }
If (MarketPosition = 0 or EndofSess) and EntCondL then begin
Buy next bar at EntPrL stop;
end;

If (MarketPosition = 0 or EndofSess) and EntCondS then begin
Sell short next bar at EntPrS stop;
end;

{ Exit orders, long trades }
If MarketPosition > 0 and EndofSess = false then begin

If ExCondL then
Sell next bar at market;
end;

{ Exit orders, short trades }
If MarketPosition < 0 and EndofSess = false then begin

If BarsSinceEntry >= NBarExS then
Buy to cover next bar at market;
end;

SetStopLoss(MMStopSz);

SetExitOnClose;

SetStopLoss(MMStopSz); = 31 USD or 3 PIPS

666 25-Dec-2011 1.298280 25-Dec-2011 1.295650 1.298590 Short $223.00
$71.00 $328,636.00
667 01-Jan-2012 1.285770 01-Jan-2012 1.271880 1.286080 Short $1,349.00
$71.00 $329,985.00
668 08-Jan-2012 1.269230 08-Jan-2012 1.269540 1.269540 Short ($71.00)
$71.00 $329,914.00
669 12-Feb-2012 1.311630 12-Feb-2012 1.314180 1.311320 Long $215.00
$71.00 $330,129.00
670 19-Feb-2012 1.320090 19-Feb-2012 1.319780 1.319780 Long ($71.00)
$71.00 $330,058.00






not considering how price moves later
3 pips is not enough in case 01 jan 2012
sell stop happened at price 1.285770
but 1 min chart shows that after that price moved up for 26 pips and
only then moved down, thus stop loss occured
so ab considers only open high low and close prices, but not what
happens inside,
this is useless utterly :(

EURGBP

unread,
Feb 25, 2012, 10:35:55 AM2/25/12
to Adaptrade Builder
anyone made working strategy with this software at all?

Michael R. Bryant

unread,
Feb 25, 2012, 4:40:16 PM2/25/12
to adaptrad...@googlegroups.com
You're strategy is using a fixed dollar stop via the SetStopLoss command.
This is a very common type of stop used in EasyLanguage code and in
strategies in general. The stop is relative to the entry price and is fixed
in size. It's implemented the same way in Builder as in TradeStation and
will trigger intra-bar, not just on the high or low. I recommend you look up
the SetStopLoss command in the TradeStation or MultiCharts users guide if
you're unfamiliar with it. Also, it's described in the user's guide for
Builder. If the size of the stop is not appropriate for your strategy, you
can change it to any size you want within Builder prior to building the
strategy. And, of course, there are two other types of protective stops
available in the program.

Mike Bryant

EURGBP

unread,
Feb 25, 2012, 5:11:04 PM2/25/12
to Adaptrade Builder
that is what I say AB is not considering intra day bars
take a look here http://goo.gl/Jm403
and any stoploss size has the same problem
% and ATR% MM have awful strategies and drawdowns, and profit factor
is never more than 1.12
idea of manually picking fixed $ MM is quite dreadful, you are saying
AB made strategy and now it is time to mend it


On Feb 25, 9:40 pm, "Michael R. Bryant" <m...@BreakoutFutures.com>
wrote:

EURGBP

unread,
Feb 25, 2012, 5:16:19 PM2/25/12
to Adaptrade Builder
AB cannot possible know how price moves every single tick or even 1
minute bars. because it has no info of that, only 1 week bars highs
lows
it assumes that once sell stop happened, then price will go only down,
but it does not work like that, price often goes up and down around
sell stop price 5-10 times, and distance can be 10 pips or 150 pips
and all that happens within minutes



On Feb 25, 10:11 pm, EURGBP <benalma...@gmail.com> wrote:
> that is what I say AB is not considering intra day bars
> take a look herehttp://goo.gl/Jm403

Michael R. Bryant

unread,
Feb 25, 2012, 7:42:02 PM2/25/12
to adaptrad...@googlegroups.com
Of course. If you need your strategy to respond to intra-bar dynamics, you
need a smaller bar size. I've tried to be pretty clear about that in the
user's guide. Sorry if it wasn't as obvious as I thought, but Builder does
not do "look-inside bar" testing. The problem has nothing to do with the
strategies but with your attempt to achieve look-inside bar testing when it
is not designed for that. If your strategy has to work on a tick-by-tick
basis, you should use tick data. Simple as that.

Mike Bryant

EURGBP

unread,
Feb 26, 2012, 12:13:58 PM2/26/12
to Adaptrade Builder

if builder does not look into smaller time-frames then any strategy
produced is a fantasy, not based on reality of price movements.
All MM out of the window then, and it does not matter either it is
%MM, ATR MM, or $ MM
This is why no matter what I cannot produce live strategy. I bet
others have the same issue


On Feb 26, 12:42 am, "Michael R. Bryant" <m...@BreakoutFutures.com>
wrote:

Mark Knecht

unread,
Feb 26, 2012, 12:33:30 PM2/26/12
to adaptrad...@googlegroups.com
On Sun, Feb 26, 2012 at 9:13 AM, EURGBP <benal...@gmail.com> wrote:
>
> if builder does not look into smaller time-frames then any strategy
> produced is a fantasy, not based on reality of price movements.
> All MM out of the window then, and it does not matter either it is
> %MM, ATR MM, or $ MM
> This is why no matter what  I cannot produce live strategy. I bet
> others have the same issue
>

I'm sorry, who ever you are, that you're having so many problems.
However IMO your assertion here is simply not based on reality. The
strategy is based upon whatever data you give it. Nothing more,
nothing less. Assume we're not speaking of some demonstrable bug in
Builder then it's accurate as far as that data goes. The same strategy
inside of TradeStation, given the same data, should and most of the
time does produce the same results.

If you want to enable the Look-inside-bar-back-testing within
TradeStation you are free to do that. Let's assume you are building
based on 1 minute data but enable LIBBT accurate to 1 tick. If you
want the strategy to be developed to that accuracy then provide
Builder with 1-tick data. You'll get the same results. (Again,
assuming no demonstrable bug in Builder or TradeStation)

Now, as an aside and speaking as just another user and from my own
perspective only, I'd like to note that (to me) you seem quite
frustrated and your submissions are coming off (again, to me) as
basically mad & upset. If that's not how you're feeling then please
reconsider how you're presenting your problems here and likely you'll
get more & better responses. If you *are* frustrated and mad, then
maybe this list isn't the best place to act out and you'd do better
working with Mike or someone else off list.

Good luck conquering Builder. There's a lot to learn and a lot of
promise. It's not perfect yet but it's improving and I expect in the
long run it'll be a great tool to have in your toolbox.

Cheers,
Mark

EURGBP

unread,
Feb 26, 2012, 12:49:26 PM2/26/12
to Adaptrade Builder
And my strategies are based on weekly charts.


On Feb 26, 12:42 am, "Michael R. Bryant" <m...@BreakoutFutures.com>
wrote:

EURGBP

unread,
Feb 27, 2012, 9:09:49 AM2/27/12
to Adaptrade Builder
I ll ask you a very simple question: did AB produce a strategy that
you use successfully in real life trading?


On Feb 26, 5:33 pm, Mark Knecht <markkne...@gmail.com> wrote:

Keith

unread,
Feb 27, 2012, 9:12:46 AM2/27/12
to adaptrad...@googlegroups.com
Yes it has. However they must be refreshed from time to time, they do not last forever

Sent from my iPhone

Mark Knecht

unread,
Feb 27, 2012, 9:30:17 AM2/27/12
to adaptrad...@googlegroups.com
On Mon, Feb 27, 2012 at 6:09 AM, EURGBP <benal...@gmail.com> wrote:
> I ll ask you a very simple question: did AB produce a strategy that
> you use successfully in real life trading?
>
>

To date, no, AB hasn't produced anything I'd actually trade. In fact,
for whatever reason, and apparently there isn't one, it's been far
worse for me since the most recent updates 2-3 month ago. A year ago
it seemed to converge on answers that were more interesting. For the
last few months it hasn't provided anything of real interest to me.

My work is typically with low minute charts - 1,2,3,5,8 minute data, etc.

My interest in AB is really long term. I purchased it, and I think
it's got a lot of potential and promise over the next few years, but
to clearly answer your question, no, it hasn't produced anything I'd
actually trade.

Now, none of that addresses you taking your frustrations with AB out
on a public list. Speaking for myself only I hope you'll try to be
more constructive in your posts vs just whining. If there's something
you really don't like or are mad about then take that up with Mike
privately. I hope you'll use this list in a constructive way lest I'll
simply tell my email client that you're posts should go to /dev/null
and I won't read them. Of course, whether you care about that is up to
you.

With best regards,
Mark

Michael R. Bryant

unread,
Feb 27, 2012, 12:08:27 PM2/27/12
to adaptrad...@googlegroups.com
That's the fundamental problem. You need to go to a smaller bar.

Since this is a public forum, it's worth making a few general comments about
look-inside bar testing. Many traders believe that look-inside bar testing
will always improve back-testing accuracy. Not true. Look-inside bar testing
only affects back-testing results when there are multiple entries and/or
exits on the same bar. Once the trade is past the first bar, it has no
effect whatsoever.

Fifteen years ago, when intraday data was hard to come by and expensive, it
was common for traders to develop day trading systems on daily bars. Each
trade took place in its entirety on one bar of data. There was no
look-inside bar testing, and everyone had to worry about the so-called
"bouncing tick" problem. If the stops were too tight, the strategy
back-testing results were meaningless.

Today, intraday data is easy to come by. There is no longer any good reason
to design a strategy that enters and exits on the same bar. Aside from being
unnecessary, such a strategy is basing its entire logic on one bar of data.
Even with look-inside bar testing, there's simply not enough information in
one bar of data to give reliable trading signals. In effect, if a strategy
uses only one bar (or just a few bars) of data for its trades, it's most
likely fitting the noise, rather than the signal. Such a strategy is
unlikely to be reliable. I'd go as far as saying that the "average number of
bars in trades" metric can be used as a measure of trade quality; the larger
the number, the higher the trade quality. A strategy with an average number
of bars of 1 would have the lowest quality.

This admonition applies equally to intraday systems designed on daily bars,
to strategies generated on weekly or monthly data, and to intraday
strategies on intraday data where the number of bars in trades is just a few
bars.

Mark Knecht

unread,
Feb 27, 2012, 6:24:58 PM2/27/12
to adaptrad...@googlegroups.com
On Sat, Feb 25, 2012 at 7:35 AM, EURGBP <benal...@gmail.com> wrote:
> for example in EURUSD
> weekly chart
<SNIP>

> this is useless utterly :(
>

EURGBP,

You complain a lot about what Builder creates but haven't provided
anything much for us to look at. I don't work with weekly charts much,
but they do have their place in the overall scheme of things. What is
it about this model that wouldn't work for you? This took less than 10
minutes to create so I don't suggest it's production ready but at
least it's weekly bars.

In sample - 1901 - 1988
OOS - 1989 to present & at least it was profitable

Clearly, the idea of trading fixed position sizes over such a range of
prices makes no sense to me, but maybe you can play with the model in
TradeStation or Builder and complain about something we can duplicate
here.

- Mark

INDU-Weekly-1.gpstrat

EURGBP

unread,
Feb 27, 2012, 6:52:05 PM2/27/12
to Adaptrade Builder
Thanks, I've accepted now this fundamental quantum measurement
problem, and will try to relax :)


On Feb 27, 5:08 pm, "Michael R. Bryant" <m...@BreakoutFutures.com>
wrote:
Message has been deleted

Rick

unread,
Mar 5, 2012, 5:56:56 AM3/5/12
to Adaptrade Builder
Hi EURGBP - Was the code generated by AB? I do not understand what
the
conditions for entry are exactly based on. Are they based on some
internal calculations of the program that set conditions for entry
and
exit to true or false? It looks something like that from the code. Is
this then a black-box type of thing?

EURGBP

unread,
Mar 6, 2012, 6:53:25 AM3/6/12
to Adaptrade Builder
AB tends to do trades on 1 bar, it does not matter if it is 1H 4H 1D
or Weekly bars.
basic strategy is sell stop low of prev bar and buy stop prev bar
high,
profit factor is sexy = 12 to 14 :)
but problem is that price moves inside the bar
and AB MM is not adequate for this

Rick

unread,
Mar 6, 2012, 9:09:27 AM3/6/12
to Adaptrade Builder
"AB tends to do trades on 1 bar, it does not matter if it is 1H 4H 1D
or Weekly bars."

This is normal. Ut is the base timeframe. All systems do that.

"basic strategy is sell stop low of prev bar and buy stop prev bar
high, profit factor is sexy = 12 to 14 :)"

hmm...this sounds too simplistic to me...

"but problem is that price moves inside the bar and AB MM is not
adequate for this"

This is a problem only if you use small stops. Can you specify your
own stops? You may want to try 2 x ATR or something along these lines.
IMO sound strategies should incorporate exits. I'm playing with the
demo version of price action lab these days, This one works with stops
only. For example, If you are trading 4H GBPUSD then you know how many
pips is a reasonable stop and target. You won't go for 5 pips with 4H
bars. Probably 50 pips is the right size. What I want to say to you is
that MM depends on timeframe. Also I'm very skeptical about walk-
forward testing. I think finding startegies that are profitable when
tested in many markets has better potential than wft.

I just figured out that price action lab looks at real price action
patterns only and not at derivatives of price. This is what I like.
> > > this is useless utterly :(- Hide quoted text -
>
> - Show quoted text -

Michael R. Bryant

unread,
Mar 6, 2012, 1:41:13 PM3/6/12
to adaptrad...@googlegroups.com
There's no reason why the strategies created by Builder should enter and
exit on the same bar. In all the thousands of strategies I've created with
it, that's the least likely scenario in my experience. You just need to
change your settings and build metrics to avoid that. I don't know what kind
of settings you're using, but it should not be difficult to look at the
build metrics and see why they result in those kinds of strategies. For
example, do you have a high weighting for the number of trades, a small
target for the average bars in trades, a small average trade size target,
etc?

At the risk of repeating myself, strategies that enter and exit on the same
bar should be avoided for statistical reasons. Such strategies are likely
just fitting the market noise, rather than the trend. Only if the trades
extend over at least a few bars are you likely picking up any useful market
information. Bar-to-bar changes are just noise.

Mike Bryant


-----Original Message-----
Subject: Re: MM stop loss not working and meaningless

Mark Knecht

unread,
Mar 6, 2012, 1:54:12 PM3/6/12
to adaptrad...@googlegroups.com
On Tue, Mar 6, 2012 at 10:41 AM, Michael R. Bryant
<m...@breakoutfutures.com> wrote:
> There's no reason why the strategies created by Builder should enter and
> exit on the same bar. In all the thousands of strategies I've created with
> it, that's the least likely scenario in my experience. You just need to
> change your settings and build metrics to avoid that. I don't know what kind
> of settings you're using, but it should not be difficult to look at the
> build metrics and see why they result in those kinds of strategies. For
> example, do you have a high weighting for the number of trades, a small
> target for the average bars in trades, a small average trade size target,
> etc?
>
> At the risk of repeating myself, strategies that enter and exit on the same
> bar should be avoided for statistical reasons. Such strategies are likely
> just fitting the market noise, rather than the trend. Only if the trades
> extend over at least a few bars are you likely picking up any useful market
> information. Bar-to-bar changes are just noise.
>
> Mike Bryant
>

Mike,
Overall I agree. For day trading I wouldn't want to enter & exit on
the same bar.

QUESTION: Would you apply the same restriction to weekly bars?

Note that if I had a weekly strategy created y Builder that bought
Monday morning at the open and closed Friday afternoon at the close
I'd likely rewrite it by hand to run on something like 5 minute bars,
buying at or near the open on Monday and closing sometime late
Friday, but that's just me.

Thanks in advance,
Mark

Michael R. Bryant

unread,
Mar 6, 2012, 2:51:03 PM3/6/12
to adaptrad...@googlegroups.com
I think it's relative to scale. Over several years of weekly bars, the bar-to-bar changes are probably not significant relative to the visible trend on the chart. Similar to what you're saying, if I wanted my trades to last about a week, I'd use nothing larger than daily bars. Granted, if you really want to enter on Monday and exit on Friday, there's no way currently to force Builder to do that on daily or smaller bars. However, I'd probably try restricting the build set to the day-of-week indicator plus a few others, add a target of 5 for the average bars in wins, and see what I found.

Mike Bryant


-----Original Message-----
Subject: Re: MM stop loss not working and meaningless

On Tue, Mar 6, 2012 at 10:41 AM, Michael R. Bryant

Mark Knecht

unread,
Mar 6, 2012, 2:58:53 PM3/6/12
to adaptrad...@googlegroups.com
Mike,
To force Builder to enter on Monday and exit on Friday I simply
choose weekly bars and force an end-of-day exit. Builder creates a
strategy with a bunch of 1-bar trades. However they are one bar trades
and as such probably subject to that same sort of curve fitting that
could happen with any other 1-bar trade system I guess.

I then bring the weekly system over to TradeStation, verify similar
results, and then rewrite the strategy to use weekly data for all
indicator calculations but actually have 5 minute data to make the
trades. This can be done with either 2 data streams on the chart or
using ELOO (5-minute chart + code for a weekly PSP) or ADE methods
methods where I add ADE transmission to the Builder strategy and
receive the trade requests on a 5 minute chart. (I prefer the former)

The real point being that I'm making 1-bar trades in the Builder
time frame, but not necessarily in the trading time frame.

Cheers,
Mark

Mark Knecht

unread,
Mar 6, 2012, 3:19:02 PM3/6/12
to adaptrad...@googlegroups.com
Or possibly I set the build requirements to favor 1 bar trades, I
don't remember... :-)

Michael R. Bryant

unread,
Mar 6, 2012, 4:55:26 PM3/6/12
to adaptrad...@googlegroups.com
The only potential problem with that approach is that, as I suggested, the results you get with 1-bar trades may very well be just fitted to the noise. If you can verify that they're not, then fine, but I would view any such strategy skeptically.

Mark Knecht

unread,
Mar 6, 2012, 5:18:49 PM3/6/12
to adaptrad...@googlegroups.com
Yeah, bothers me also.

1) How would one verify it isn't.

2) I used all weekly data for the $INDU from 1/1/1901 to present, so
about 90 years. Still for weekly data that was only about 5000 bars.

That work led me to a weakness in how I view results in Builder in
that the prices have changed massively over all that time. From 20 to
14000. Much if not most of the money was made from 1990 to present.
However Builder isn't strong when trying to review how well a strategy
works at different time periods when the prices & returns vary so much
in absolute terms. Don't know what you can do about that or whether
it's even important to most users. I suspect it isn't.

That said the exercise leads me to renew a request which has to do
with filtering. My real use for a strategy like we've been discussing
is not necessarily to trade it but rather to use it as a filter for
other strategies. I.e. - if I have weekly and daily strategies that
are both trading long, then I use that info as a filter and only trade
my 1 minute strategy long. If they trade short then I only trade my 1
minute strategy short.

I know you've stated that one of these days you're looking at some
multi-data-stream enhancements, but those don't work (AFAIK) for
advanced charts. (Tick, Kase, etc.) However some sort of trade
direction filter input, supplied as an external indicator or read by
Builder from another Builder strategy, could be used between two
charts using ELOO methods (GlobalDictionary) and might be a better
solution in the long run.

Just a thought,
Mark

Keith Brightfield

unread,
Mar 6, 2012, 5:36:56 PM3/6/12
to adaptrad...@googlegroups.com
Seem like Mike's idea about creating synthetic data could work for you on this problem. 
 
Since you say that most of the relevant time period is concentrated in the 1990 to present time period, you could create multiple copies of that specific period after randomizing that data("synthetic data")  using the process Mike discusses on his BreakoutFutures web site. 
 
You could make enough synthetic data to have a good database for analysis.
 
a snippet from that:
 
The Breakout Bulletin
The following article was originally published in the December 2010 issue of The Breakout Bulletin.
Is Scrambled Data Suitable for Strategy Testing?
Different traders will often disagree on what constitutes a good trading strategy. However, everyone generally agrees that trading strategies should be robust. What does robust mean when it comes to algorithmic or systematic trading strategies? Generally speaking, I'd say a robust trading strategy is one that is insensitive to variations in the market. These variations might include market noise -- that is, anything other than the signal that constitutes the tradable part of the market data -- as well as variations in a broader sense, such as changes in cycle length, volatility, trending behavior, and so on. The more robust a strategy is, the greater the likelihood that it will hold up in the future when the market changes, as markets inevitably do.
One common technique to build robust strategies is to test the strategy over multiple markets. For example, a strategy that performs well over corn, crude oil, E-mini S&P, and T-bonds is probably pretty robust. However, even if you specialize in one particular market and prefer to focus solely on that market, a variation in this approach can still be used. I wrote an article several years ago about creating synthetic price data. The basic idea, developed by Chande,1 is to randomly select price differences and use them to reconstruct a synthetic price series based on the price changes from the original series. Chande refers to this technique as data scrambling.

EURGBP

unread,
Mar 7, 2012, 8:34:48 AM3/7/12
to Adaptrade Builder
>
> This is a problem only if you use small stops. Can you specify your
> own stops? You may want to try 2 x ATR or something along these lines.
> IMO sound strategies should incorporate exits. I'm playing with the

why then AB sets

{ Strategy inputs }
Inputs: MMStopSz (31.00),
NBarExS (18);

MM = 31 Dollars ~ 3 Pips?

why does AB that and thinks it is a valid strategy?

Rick

unread,
Mar 7, 2012, 9:31:23 AM3/7/12
to Adaptrade Builder
"How would one verify it isn't."

If the return of the AB strategy beats the average return of n random
strategies. where n is large enough, using the same data, then it may
not be random. For example, you can compare the strategy return to a
startegy that buys at the open of a bar and sells at the close after n
bars, n = 1,2,3 ...,10. You then average the returns for all n and you
compare to the AB startegy.
> > Mark- Hide quoted text -

Michael R. Bryant

unread,
Mar 7, 2012, 5:20:25 PM3/7/12
to adaptrad...@googlegroups.com
It's up to you to set a reasonable range for the stop sizes. You do that on
the Strategy Options tab.

Mike Bryant

-----Original Message-----
From: adaptrad...@googlegroups.com
[mailto:adaptrad...@googlegroups.com] On Behalf Of EURGBP
Sent: Wednesday, March 07, 2012 5:35 AM
To: Adaptrade Builder

Subject: Re: MM stop loss not working and meaningless

>

Reply all
Reply to author
Forward
0 new messages