logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
chestnut  
#1 Posted : Monday, November 17, 2008 9:50:05 AM(UTC)
chestnut

Rank: Member

Groups: Registered, Registered Users
Joined: 11/10/2008(UTC)
Posts: 22

I am seeing something odd in the Enhanced System Tester and curious if anyone else is seeing this...

I have developed a model and fed the Enhanced System Tester a series of stocks to run and compare. I told it I want each investment to default to a $50,000 position. Well, when I look at the ACTUAL trades in the output, they are NOT $50,000 orders! In most cases I am getting something like $45,000-$47,000. But never $50,000. Weird! Why?

I thought at first it might be defaulting to some rounded "block" size, but , no, the position details clearly show the simulator is calculating an exact number of shares (e.g. 723 shares, or 437 shares, etc.). Then I thought maybe it was using some price other than what I told it to use (which is the Open price), but, no, it is correctly selecting the open price on the day of interest. Lastly, I thought it was running out of money in my simulated account, but I inflated that to $1M and still get the same thing!

So I am baffled.... Why is $50,000 not $50,000 in this simulator? Any one have any ideas?

Thanks!

Justin  
#2 Posted : Monday, November 17, 2008 12:59:57 PM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

There are a couple factors to consider. The number of shares that can be purchased are determined on the Signal bar, not necessarily the bar where the trade is executed. So for example if the system calculates that you can buy 1000 shares and the next day the price drops, you would end up purchasing 1000 shares but at a lower cost, meaning you would not be putting the 50,000 into that position.

Commissions are also factored into the trade price, though if this is set to "points per transaction" this would be minimal. If this was "points per unit" this could take quite a bit more equity away from the trade.
chestnut  
#3 Posted : Monday, November 17, 2008 2:20:19 PM(UTC)
chestnut

Rank: Member

Groups: Registered, Registered Users
Joined: 11/10/2008(UTC)
Posts: 22

OK, thank you for the quick response.

That is indeed what is happening. I have the commissions set to zero, so that was not a problem. But... I am using a trick to buy at the Open, and the simulator is picking up the price of the PRIOR day's open when it calculates the number of shares. A bit strange, because the output report CORRECTLY lists the price of entry as today's open, but the number of shares calculated is clearly based off yesterday's open. Odd but that's what is happening.

Justin  
#4 Posted : Tuesday, November 18, 2008 9:59:00 AM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

It's possible that the formula could be rewritten slightly to buy at the open but still calculate the shares purchased based off the point that the trade is actually executed. We would likely need to take a look at the formula to know exactly how to handle it. You can post it here, or if you prefer you can email formulas @ equis.com. If you do send the email, please make sure to point out the behavior you are noticing (i.e. figuring out the # shares the day prior to the trade executing) and what you would ideally like the formula to do.
chestnut  
#5 Posted : Tuesday, November 18, 2008 10:37:48 AM(UTC)
chestnut

Rank: Member

Groups: Registered, Registered Users
Joined: 11/10/2008(UTC)
Posts: 22

Thanks for the help, Justin.

I am fine to share the formulas here; I'll just leave out portions that I want to keep private. But I can give the basic architecture:

I am playing with a simple "buy on gap down" model. I want to buy at the Open if the stock has gapped down and met a series of other criteria. Then I want to sell that same day at the close unless a stop has been reached. My first problem was getting the System to allow me to buy and sell on the same day, as it kept wanting to buy one day (at open) and sell the next (at close). Searching this forum over the weekend, I found the following trick works:

I defined a function that triggers a buy signal under my specific conditions. It looks at the prior closing price, sees if the open has gapped down by an amount I plug in there:

Function "Enter":
(OPEN<=Ref(C,-1)*(1-{gap down})) AND
(other conditions are met; these I'll keep private...)

Then I set up a System Tester as follows:

System Buy Order
Ref(Fml( "Enter"),+1)
with Strategic Delay set at +1 Day

System Sell Order
Set to sell at the close unless a Stop is reached; no Strategic delay

So as you probably recognize, it is looking ahead a day at the Open to decide whether to buy, then delaying a day to make the execution. Whereas the sell order is happening without a Strategic delay. And bingo, both the buy and sell happen on the same day.

I am guessing the reason the Cost Basis is off is because I am looking ahead a day, so part of the simulation is picking up the Open price on the day I look, rather than the target day. But as I mentioned previously, it still seems odd that the output correctly identifies the true open (and buy) price for the execution, but the math calculating the number of shares reverts back to the incorrect open price the prior day.

I'm game for a different approach if it will solve the problem of buying at the open and selling at the close the same day *and* has the number of shares in the resulting profit calculations.

Thanks!

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.