GTCTrailStop with Limit Entry?

StrataSearch will find what you tell it to, but what should that be? Will the same criteria work across different Sectors? Different time periods? Here we discuss the ins and outs of OneClick Searches.

GTCTrailStop with Limit Entry?

Postby Jaded » Fri Jul 08, 2011 3:09 am

While I would love to use GTCTrailStop with a limit entry, it makes me think that doing so would produce an innacurate system.. is this correct?

I think I am seeing some good results in the oneclick due to buying with a limit and then using GTCTrailStop and have some trades executing intraday (on the first day). Does anyone have any insight into this, or is there not any way to use GTCTrailStop/GTCStop in an exit string unless its wrapped inside of a combined condition like ( $daysheld > 0 and (GTCTrailStop(25, UnLeveraged) ) so that way it does not produce intraday trades on the very first day.

I'm up for ideas on how to keep the 0-day GTCStop possibility, but I can't think of how it can be done with using a Limit Entry Order like ( close * 0.96 )

Edit - I am going to go ahead and test with the following exit string:
(( $daysheld > 0 and GTCTrailStop(25, UnLeveraged) ))

My assumption is that this will produce a lower-profitability system with no first-day intraday trades, but I can't think of any way to do this in Stratasearch with only EOD prices available.
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Overload » Fri Jul 08, 2011 8:50 am

I believe you're correct that you can't do an intraday entry and an intraday exit on the same day using EOD prices alone. There generally isn't enough information available to tell whether the high or low price would have been hit first. Granted, there are some cases where it can be extrapolated. If you have a scenario where the Open Price is also the day's High Price, and the Close Price is also the day's Low Price, you can get a pretty good estimate of the day's direction. But suppose you have a wide High/Low range and the Open Price and Close Price are the same. In this case, you'd have no way of knowing whether the High and Low prices were hit before your position was entered, or after. Thus, there is no way of identifying with any certainty when the intraday stop would hit.

I think your approach of only exiting with an intraday stop on Day 2 is the safer way to go.

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Sat Jul 09, 2011 11:30 am

Not sure what is happening, but I noticed when running a detailed analysis that I had some trades with 0-day holding periods, which means intraday trades.

This is the exit string:
$daysheld > 0 and GTCTrailStop(40, UnLeveraged)

Entry Order is a Limit order
Exit Order is:
if ( $daysheld > 0, $entryprice * 1.16, 99999 )


Any ideas how this would trigger an intraday sale on the first day?
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Overload » Sat Jul 09, 2011 4:30 pm

You're right. I'd forgotten that the stop/limit formulas aren't conditional like other formulas. Instead, they are actions, and they will be triggered regardless of where they are within the Exit String. In other words, you can't make it conditional based on $daysheld > 0.

I don't know of a way to launch an intraday stop or limit, beginning only on Day 2. There would be issues that would need to be resolved for that to be possible anyway. For example, would the high price from which a stop is triggered be from the Entry Price, or a price on Day 2?

In any case, these are the issues that arise when trying to squeeze too much intraday processing out of EOD prices. You might be better off using either an intraday entry, or an intraday exit, but not both within the same system.

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Sat Jul 09, 2011 4:45 pm

Overload wrote:I don't know of a way to launch an intraday stop or limit, beginning only on Day 2. There would be issues that would need to be resolved for that to be possible anyway. For example, would the high price from which a stop is triggered be from the Entry Price, or a price on Day 2?


Why not just re-check the exit string and exit order type each day, and evaluate the $daysheld in it from there.. It acts like it is only evaluating that when it is bought, and not even looking at it each day afterwards. I wouldn't think it would be too difficult to know if you bought a stock -at a certain limit- (that is the buy price that is recorded) and then use that price to determine if the stock will be sold intraday on following days based on what is in the exit string or exit order rules.

Maybe I don't make sense.. but it seems like it would be possible programatically, unless I am missing something.

Are you also implying that you cannot use a Buy Limit and a Sell Limit together, since this can trigger intraday and there is no way of knowing which one triggered in what order?
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Sun Jul 10, 2011 3:04 am

I came across another really weird issue, which I consider a fundamental flaw, unless I am mistaken.

All of the following refers to Long orders.

I just looked at my signals for 07/07/2011 (Portfolio Only) and see 5 BUY LIMIT orders and 1 SELL LIMIT order. The symbol "LEDS" is not in any of the Buy's.

Looking at signals for 07/08/2011 (Portfolio Only) , I see a SELL order for "LEDS" (buy date says 07/08/2011 @ $5.2416). It was not bought intraday, since it's not listed in the Buy signals for 07/08/2011.

Investigating further, I see that on 07/07/2011 , if I uncheck "Portfolio Only" and scroll down, I see "LEDS" being bought with a limit order of $5.456.

My question (and the problem) is that the stock was never bought in the portfolio, so how was it sold the next day? Is there some switch somewhere that I can change to make it only look at portfolio trades? I have everything set to Portfolio Only as far as I can tell.

Unchecking the "Portfolio Only" box shows me a list of about 150+ BUY LIMIT orders, which is why I need to rely only on the selections that were picked for the Portfolio.

Thoughts on what I can do, or is this something that needs to be fixed or revised?
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Overload » Sun Jul 10, 2011 9:21 am

First, as I'd mentioned, there isn't currently a way to turn intraday stops and limits on and off throughout the course of the holding period. If you turn on stops and limits, it is in place through the entire life of the position. There's no getting around that. But if you'd like, I'd be happy to enter a request for the ability to turn stops and limits on and off on various days.

As for your second issue, keep in mind that it isn't known on the prior day whether your limit order will be filled or not. When you have an entry limit order during back testing, StrataSearch will identify whether the highest ranked stock hits execution territory on the next day. If not, it will go on to the next stock, etc., until the portfolio is filled. But during live trading, StrataSearch can only show suggestions of which buy signals are highest on the ranking list. If some of those don't hit execution territory, you should move onto other stocks that do. It is important to keep your portfolio filled.

Relating this to your exact scenario, I'm guessing that there was at least one portfolio stock on 7/7/2011 that had a buy signal, but didn't hit execution territory. Because of that, StrataSearch moved on and bought LEDS into the portfolio as a replacement. That's why it wasn't flagged in the buy signals, but ended up being pulled into the portfolio upon execution.

In general, you will have a hard time trying to stick with a precise portfolio-only selection when using limit orders on your entry. There will be many cases where the price made it into execution territory but there was insufficient liquidity to execute your own trade. At the end of the day, StrataSearch will flag it as having executed even though you could not. For this reason, it's recommended you use the portfolio selection as a guide, but not a requirement.

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Sun Jul 10, 2011 12:22 pm

Overload wrote:But if you'd like, I'd be happy to enter a request for the ability to turn stops and limits on and off on various days.


That would be great to have and be able to use.

Overload wrote:As for your second issue, keep in mind that it isn't known on the prior day whether your limit order will be filled or not. When you have an entry limit order during back testing, StrataSearch will identify whether the highest ranked stock hits execution territory on the next day. If not, it will go on to the next stock, etc., until the portfolio is filled. But during live trading, StrataSearch can only show suggestions of which buy signals are highest on the ranking list. If some of those don't hit execution territory, you should move onto other stocks that do. It is important to keep your portfolio filled.

In general, you will have a hard time trying to stick with a precise portfolio-only selection when using limit orders on your entry. There will be many cases where the price made it into execution territory but there was insufficient liquidity to execute your own trade. At the end of the day, StrataSearch will flag it as having executed even though you could not. For this reason, it's recommended you use the portfolio selection as a guide, but not a requirement.


Hrmm.. This is going to be difficult then. Do you know of any trading platform that easily or programatically lets you enter in 150 price triggers that only send a buy limit order to the broker if/when a price is met ( but also cancel any remaining price triggers once 5 symbols total are held ) ? Like I said, this system I am working with can produce 150 buy limits a day, but usually only ends up hitting the limits on a fraction of those. It sounds odd, but I am pursuing this because this has the potential to be a very good system if I can figure out how to sort out this part of it.
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Overload » Mon Jul 11, 2011 8:39 am

There are a couple options I can think of. First, you might be able to find a broker with a platform that allows you to enter more limit orders than you're able to trade, but then just cancels them automatically if your portfolio is full (i.e. out of cash to buy more). I'm not aware of any brokers that offer this, but I also haven't looked into it very closely.

The second option is to start using an intraday trading platform that can enter limit orders for stocks that enter your limit territory. Following 150 unique stocks each day may be some work, but I'm sure there are some platforms out there that can handle it.

If you end up finding a method of execution for this system, please let me know. I'll be curious how you end up doing it.

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Mon Jul 11, 2011 11:33 am

Hi Pete,

I am looking for platforms now.. StrataSearch is amazing at finding trading systems, but it doesn't integrate with brokers (and probably shouldn't since that isn't the purpose of it right now). I'll let you know what I come up with. I am thinking of making some type of script to parse out the exported daily signals and automatically enter it into one of these platforms using the API or even parsing it into a simple CSV import format.

It will be interesting. I plan on trading with fixed equity with 5 stocks, so just waiting until the portfolio is full and runs out of money isn't an option right now.. I'll need to cancel any remaining triggers after I have determined that the portfolio consists of 5 stocks (either holding, or have buy orders issued for them).

Thanks for the help.. Any other suggestions on this would be great. I am still interested in being able to use GTCStop, GTCTrailStop, and exit limit orders with $daysheld parameters.
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Sun Jul 17, 2011 6:55 pm

I've come across another potential snag with testing limit orders with a oneclick, and intraday issues causing a problem with the oneclick logic.

Example (showing all trades, not just portfolio only):

Strategy #1 has a Buy Limit for AAPL at $10.55
Strategy #2 has a Buy Limit for AAPL at $12.35
Strategy #3 has a Buy Limit for APPL at $14.45

Naturally, I'd look at the highest ranking strategy, and issue a Buy Limit order for AAPL for $10.55 -- the problem is.. what if the low for AAPL for the day is $13.12 -- if that first limit order is never hit during the day, no trade never executes.

What I think StrataSearch is doing, is unknowingly moving on to the next strategy that has a limit order that is below the Low price of the day, so in this case, StrataSearch will just assume that we bought the stock when it crossed under $12.35, even though we would have never had a limit order for that amount, if we base our buy's on the ranking of systems.

So... my thinking is.. If there are multiple symbols across multiple systems, and they have limit orders.. Use the -HIGHEST- limit $ amount for the trade, to ensure that even our lowest ranking system will obtain this stock.. we can always set up trailing stops for buying stocks, but not if we never hit the limit.

What are your thoughts on this? I thought about re-ordering the systems in the signals, so that the systems will be ordered by their Entry Order Price string (assuming they all use close * #.## as a limit entry rule), but this doesn't seem optimal either... but might be the best thing for backtesting a worst-case scenario for the oneclick system.

Any ideas?
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Overload » Mon Jul 18, 2011 1:29 pm

I think there might be a flaw in your system design. I don't believe it makes much sense to have a Multi-System where orders are frequently entered on the same day, for the same symbol, at different limit prices. Obviously in live trading, it will select the first limit order that's hit and disregard the others. But this assumes you'll only enter a single position with each symbol. If you have the switch turned on to enter multiple positions in the same symbol, then you may end up with multiple entries at different prices.

As mentioned previously, there are problems that arise when backtesting intraday stop and limit orders. In particular, the liquidity may trigger certain trades in your back test that wouldn't have been attainable in live trading. Plus, StrataSearch will automatically fill your portfolio with positions that actually hit their limit price, although execution of such a mechanism isn't quite as easy in live trading.

The scenario with multiple limit orders placed on the same symbol at different limit prices is another issue where your back test will likely be different than what you can get in live trading. It's also a limitation of trying to use EOD prices to do intraday trading. In a nutshell, my recommendation is to use StrataSearch only as a guide. I would heavily test the system with a broker before entering live trades, just to see what other issues arise.

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Mon Jul 18, 2011 2:21 pm

Exactly my thoughts, and that is exactly what I am doing.. SS has no way of knowing when a limit was hit intraday.. which is all OK.. I was just perplexed when I saw some crazy results, and went digging for answers.

My multi-system did have strategies with different limit prices, which was the main issue. I am now restricting my strategies to only using the same % limit order (close * 0.##) , instead of a limit that was dynamically determined by the oneclick. Using the same limit order, I can now just keep the highest rank signal, and remove all of the duplicates from the other strategies.

Thanks for the info and suggestions :)
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Jaded » Tue Mar 06, 2012 2:42 pm

I'd like to bring up a suggestion for this. I realize that you can't use different entry limits in a multi-system, but I have an idea.

Could you make an option for GTC exit rules so that they are ignored on the same day a limit order was made? This way we could test out GTC exit rules on following days (after entry) and do not have the issue of a GTC rule being hit before the purchase was actually made.

Hopefully that makes sense. I am not sure where this option could be added, but it should end up at the strategy level I would imagine. Maybe even add it as an option to the GTC rules themselves just like we have leveraged,unleveraged.. I don't know.

Let me know what you think and if this is possible or if you will even consider it.
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: GTCTrailStop with Limit Entry?

Postby Overload » Wed Mar 07, 2012 9:39 am

I agree it would be nice to have conditional intraday stops, not just based on a second-day holding but maybe on a programmable condition. I'll think about this more and put it on the list.

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm


Return to OneClick Searches and Scoring

cron