You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the feedback.
The function fCondition() is just a simple helper that creates a template condition that can be customized and attached to an order.
The supported condition types are the ones made available by IB and are listed here.
The way conditions can be attached to orders in TWS is demonstrated in this video.
Similar tasks can be accomplished with this package: here's an example of how to attach two conditions (Price AND Time) to an order:
# Condition 1: price of AAPL > 200cond1<- fCondition("Price")
cond1$conId<-265598Lcond1$exchange<-"SMART"cond1$is_more<-TRUEcond1$value<-200cond1$conjunction<-"a"# AND# Condition 2: time > Jul 6 15:00cond2<- fCondition("Time")
cond2$is_more<-TRUEcond2$value<-"20210706 15:00:00 EDT"# Attach to orderorder$conditions<-list(cond1, cond2)
great work with this package.
May I ask if it is possible to include more than one condition in your fCondition function?
For instance, in a trailing stop order, could it be possible to use a different trailing offset for say two or more given prices?...
say, I go long at $10 and, place a trailing stop 1% below. can one set a conditional second trailing stop at 0.5%, when price is above $11?
this could make your function very useful to adjusts offset values, when there is a strong trending, like explained here
The text was updated successfully, but these errors were encountered: