[R-SIG-Finance] Exit Order By Current Position Info

Brian G. Peterson brian at braverock.com
Fri Apr 22 18:03:16 CEST 2016


On Fri, 2016-04-22 at 17:26 +0200, Diego Peroni wrote:
> Hello,
> 
> I'd like to integrate my strategy creating a Stop Loss Order that must 
> be sent to the market if my current Open Position reach N points up 
> (profit).
> 
> So this rule must evaluate: Open Price Position, Side Position and Quantity.
> 
> Which is the best way to add this behaviuor to my strat?
> In which component do I have to work?
> In case does exist a working example?


Work through the luxor examples that replicate Tomasini.

The takeprofit examples are luxor.5.strategy.ordersets.R and
luxor.6.paramset.takeprofit.R

Fundamentally, you need ordersets and chained orders.  We covered all of
this in great detail in our quantstrat seminar a few years ago at
R/Finance:

http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf

don't cut and paste code out of the slides.  The demo scripts are
updated to adjust for changes in R and the required packages, the slides
are obviously static.

Regards,

Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list