[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Metastockusers] Re: Simple System, BUT... How Do I Avoid Gaps When Testing?



PureBytes Links

Trading Reference Links

Yes, I was hoping someone would suggest that. Guess what? That's
exactly how I wrote the formula at first! No delay on the buy order
and everything. Exactly how Joe suggested.

Here's the REAL problem. If you set it up like Joe suggested, for some
odd reason, the Enhanced System Tester does not allow back to back buy
and sell orders for two consecutive days. 

Remember, you can actually have two orders on the same day. An order
to sell an existing position on the open, (because yesterday's close
was below the typical price) and a buy order to establish a new
position, (because yesterday's close was below the typical price) if
the stock can trade up today through the Typical price +.05.

BUT... The following day you can have the exact same situation,
because again, the stock closed below the Typical Price. When this
occurs, (for some odd reason that I can't understand), MetaStock's
System Tester issues a new buy order but fails to submit an order to
sell the existing position on the open. Hence, if the buy order
triggers, which does happen quite often, you are now long two hundred
shares! Remember, I'm only trading one hundred shares at a time in
this test. There should never be a time when more than 100 shares are
held long.

Try it yourself both ways. If you set it up like I described, you can
either look in the Orders section after the test completes or plot the
trades on the chart. There's never more than 100 shares held at a time
and you can see back to back (two consecutive bars) where both a buy
and sell order are submitted and executed.

Set it up like Joe suggested (like I had it originally) and there is
never a time when two consecutive bars have both a buy and sell order
executed, which results in holding multiple 100 share lots.

Is this a glitch in the Enhanced System Tester? 
Is there a different way to write the formula to prevent this?
Anyone have any idea why this is even happening?

It has me scratching my head because I can't understand why two
consecutive bars can have both buy and sell orders one way the formula
is written, but not the other way. 

It should work perfectly the way Joe suggested. But it doesn't!



--- In Metastockusers@xxxxxxxxxxxxxxx, "Joe J." <jojab@xxxx> wrote:
> Yes, in looking at it rather quickly, what you need to do is
something like this on your buys:
> 
> ref(c,-1) < ref(typical(),-1)
> AND
> open <= ref(typical(),-1)+.05
> 
> Change your entry delay to zero because you are buying on the
current bar (but basing the decision on the prior bar).
> 
> Good Trading,
> 
> Joe J.
> 
> 
> -----Original Message-----
> From:	jnick99@xxxx [mailto:jnick99@x...]
> Sent:	Wed 12/17/2003 8:04 PM
> To:	Metastockusers@xxxxxxxxxxxxxxx
> Cc:	
> Subject:	[Metastockusers] Simple System, BUT...  How Do I Avoid Gaps
When Testing?
> 
> I'm rather new to system testing, so I created a simple (Long Only)
> system test in MetaStock 8.0 (EOD) to examine how the Enhanced
System
> Tester recreates and tests systems. 
> 
> This system is very simple and is very similar to price crossing up
> through a moving average line. I'm using end of day data and it only
> goes long. 
> 
> The system buys if today's close is below the "Typical Price" and
then
> trades up through it on the next bar (day). (The "Typical Price" in
> MetaStock is simply the (H+L+C)/3). 
> 
> The "Typical Price" also called the "Pivot Point" was discussed in
the
> February, 2000 issue of "Technical Analysis of Stocks &
Commodities".
> 
> So, the idea with this system is: If today's close was indeed below
> the typical price, (which of course isn't known until after the
close)
> the system then places a stop-limit order to buy if the stock can
> trade up through this level "The Typical Price" + .05 on the next
bar
> (day).
> 
> If the stock never trades up to this level then of course the order
is
> cancelled. New parameters (Typical Price) will then be calculated
for
> the next days orders. 
> 
> If the buy order is filled the system holds the long position as
long
> as the close of the day is above the Typical Price value. If the
close
> falls below the Typical Price, the system enters a sell order on the
> next bars open.
> 
> So, the parameters for a buy order and a sell order are identical.
> Which means it's entirely possible to have both a buy order and a
sell
> order in place at the open. 
> 
> The sell order sells an existing position on the open,(because
> yesterdays close was below the "Typical Price"). 
> 
> The buy order buys a new position, (because yesterdays close was
below
> the "Typical Price")if the stock can trade up during the day through
> the "Typical Price".
> 
> SIMPLE. Right?
> 
> Buy if the stock shows strength. Sell when it shows weakness. Buy
> again when it shows strength
> 
> Only problem I'm having is if the stock gaps up the next day on the
> open. Some days it gaps up and keeps going higher. This results in
my
> limit price never being attained and the order is cancelled. Which
is
> exactly what should happen. BUT... Some days the stock gaps up and
> then trades lower the rest of the day which triggers my limit
order. I
> don't want the system to buy as the stock is falling. Which is
exactly
> what happens.
> 
> Here's the system:
> 
> GENERAL
> Order Bias: Long Orders
> Portfolio Bias: Single
> Position Limit: Limit number of simultaneous positions to 2 
> 
> BUY ORDER
> Formula: C < Typical() 
> Order Type: Stop Limit
> Limit or Stop Price: Typical()+.05
> Entry Size: Use Default Size (100 shares)
> Expiration: Good for Day
> Strategic Delay (Bars): Tick: 0  Minutes: 0  Day: 1
> 
> SELL ORDER
> Formula: C < Typical()
> Order Type: Market
> Limit or Stop Price: n/a
> Entry Size: Use Default Size (100 shares)
> Expiration: Good for Day
> Strategic Delay (Bars): Tick: 0  Minutes: 0  Day: 1
> 
> When you click on New Simulation and select the system, the first
box
> that appears is to add securities. So far I am just testing one
stock,
> symbol URBN. Daily price data, 500 periods.
> 
> Click "Next" for System Testing Options. 
> Trading: 
> Points Only Test: NOT checked
> Initial Equity: 10,000
> Default Size: Number of Units 100
> 
> Portfolio:
> Long
> 
> Results:
> Not a "quick Test"
> 
> Click "MORE" and select the Trade Execution tab
> Trade Price:
> Realistic Market Prices: NOT checked
> Buy Price: Open
> Sell Price: Open
> Delay Order Opening: 0 bars
> 
> That's all there is to it. Because I'm using a Stop-Limit order in
the
> Buy order formula it doesn't use the Open price but uses my limit
> price instead. The Sell order uses the Open on the next bar.
> 
> Only thing I can't make it do is not buy on a Gap up.
> 
> Anyone have any suggestions ?
> 
> 
> 
> To unsubscribe from this group, send an email to:
> Metastockusers-unsubscribe@xxxxxxxxxxx
> 
> 
> 
> 
> 
>   _____  
> 
> Yahoo! Groups Links
> 
> 
> *	To visit your group on the web, go to:
> 	http://groups.yahoo.com/group/Metastockusers/
> 	  
> *	To unsubscribe from this group, send an email to:
> 	Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
<mailto:Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
?subject=Unsubscribe> 
> 	  
> *	Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .


To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/Metastockusers/

To unsubscribe from this group, send an email to:
 Metastockusers-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/