GTCLimit is a static variable and cannot change

Questions directed to our Support Team. Responses can be expected within 24 hours.

GTCLimit is a static variable and cannot change

Postby mandelmus » Sat Jan 12, 2013 6:14 am

For the GTCLimit() expression, I am able to enter a fixed value, an optimizable value (e.g., @percent), and a basic formula (e.g., ((high-low)/low)), but, as soon as try to use a moving average of those values (i.e., mov((high-low)/low,20,simple)), an error pops up saying ...

---------------------------
Error in Exit String
---------------------------
Parameter 1 in formula GTCLimit is a static variable and cannot change from one day to the next.:
Expression: GTCLimit( mov((high-low)/low,20,simple))


If GTCLimit() accepts "(high-low)/low" (which changes from one day to the next), shouldn't it also accept the moving average expressions? Is there a work-a-round which allows me to use a moving average expression within GTCLimit()?
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: GTCLimit is a static variable and cannot change

Postby Overload » Sat Jan 12, 2013 10:22 am

Actually, GTCLimit, and all the other GTC formulas, do not allow variables that change from one day to the next. Originally we allowed only a hard-coded number, but this became problematic in some custom formulas where the value was either a parameter or a value that was calculated via a variable. But the message you saw is true, and it is across the board. Percentage values entered in the GTC formulas cannot change from one day to the next. Enhancing this to allow dynamic values from one day to the next is already on the list of future enhancements.

For now, the only option is to use a Limit Order Exit on the Order Types tab. That will allow you to create a dynamic Limit Price that changes from one day to the next, and the end result is basically identical to a GTCLimit.

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

Re: GTCLimit is a static variable and cannot change

Postby mandelmus » Sat Jan 12, 2013 12:44 pm

I need the strategy to exit either a specified % gain or the close of the same day.

Here is what I am using now:
Entry String: $daysheld >= 0 or GTCLimit(1.35)
Exit Order Type: Market: Close

This arrangement exits at the open of the following day:
Entry String: $daysheld >= 0
Exit Order Type: Limit: $entryprice * 1.35

If I switch the limit order to a market order, StrataSearch exits with a 35% gain the following day regardless of the price ... is that a bug?
Switch Limit order to Market order:
Entry String: $daysheld >= 0
Exit Order Type: Market: $entryprice * 1.35

Is there a way to set up the Limit Order Exit so that I can enter and exit on the same day?
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: GTCLimit is a static variable and cannot change

Postby Overload » Sun Jan 13, 2013 10:56 am

I need the strategy to exit either a specified % gain or the close of the same day.

While this is already on the list, for now you can have a Limit Order exit on an intraday basis, or default to an exit at the next day's open price. However, keep in mind that even if you exit at the next day's open, in StrataSearch you can still enter a position with that cash on the day of the exit.

If I switch the limit order to a market order, StrataSearch exits with a 35% gain the following day regardless of the price ... is that a bug?
Switch Limit order to Market order:
Entry String: $daysheld >= 0
Exit Order Type: Market: $entryprice * 1.35

No, that is working as expected. A Market order exits at exactly the price you specify. You specified a 35% gain, so that is what it will exit at.

Is there a way to set up the Limit Order Exit so that I can enter and exit on the same day?

No, not if you are using a Limit Order.

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

Re: GTCLimit is a static variable and cannot change

Postby mandelmus » Sun Jan 13, 2013 7:17 pm

Overload wrote:
If I switch the limit order to a market order, StrataSearch exits with a 35% gain the following day regardless of the price ... is that a bug?
Switch Limit order to Market order:
Entry String: $daysheld >= 0
Exit Order Type: Market: $entryprice * 1.35

No, that is working as expected. A Market order exits at exactly the price you specify. You specified a 35% gain, so that is what it will exit at.
Pete


So, in this arrangement, StrataSearch does not wait for the price to rise 35% in order to exit, it just exits at that close + 35% regardless of the symbol's actual price ... is that correct?
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: GTCLimit is a static variable and cannot change

Postby Overload » Mon Jan 14, 2013 10:01 am

Yes, that's correct. A Market Order executes at the specified price regardless.

This allows you to specify an exit at the Close Price on the day of the signal versus an exit at the next day's Open Price. You could also do something like buy and sell at another symbol's prices to simulate buying and selling one symbol while evaluating another. And, you could even implement something like a Black and Scholes options pricing algorithm to simulate buying and selling options based on an evaluation of the underlying symbol.

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


Return to Technical Support

cron