Conditional Order Types

Let us know your likes and dislikes, or what you'd like to see next. We listen!

Conditional Order Types

Postby Jaded » Tue Jun 28, 2011 5:49 pm

I'm not quite sure how this would be implemented, but I was thinking I would want to do the following:

If the following evaluates to true:
low < ( ref(low,-1) * 1.01 ) and
high > ( ref(low(-1) * 1.01 )

then set a sell limit order:
ref(low,-1) *1.01

else use the default sell order type.

Just thinking out loud. Does this make sense.. my example might not, but the idea is that it would be good to have a "exit strategy" sell order type, but also a conditional sell order type if a condition is met. Maybe there is a way to do this already?
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm

Re: Conditional Order Types

Postby Overload » Tue Jun 28, 2011 7:00 pm

I believe your example can be done by entering a Limit Order for the Exit on the Order Types tab, and then entering a Limit Price of:

if(low < ref(low,-1) * 1.01 and
high > ref(low,-1) * 1.01,
ref(low,-1) *1.01,
99999)

An Exit Limit Order operates as an alternative to the Exit String. So a Limit Order will be triggered if the conditions within the if() statement are true. If the Limit Order does not trigger, the position can still exit on an EOD basis if the conditions of the Exit String are true. In that case, the position will exit as a Market Order at the next day's opening price.

Notice in the if() statement that I entered your Limit Price if the conditions are true, but entered 99999 if the conditions aren't true. This basically creates a Limit Price that can never be hit, so the Limit Order is not filled.

Hopefully this gets you pointed in the right direction, but let me know if you have questions on this.

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

Re: Conditional Order Types

Postby Jaded » Tue Jun 28, 2011 7:13 pm

I think that is exactly what I was looking for.. wasn't sure if I could use an if statement inside of an order rule. Thanks for the info!
Jaded
 
Posts: 151
Joined: Mon May 14, 2007 6:49 pm


Return to Comments and Suggestions