Skip to content
Back to formatted view

Raw Message

Message-ID: <1461340996.8091.283.camel@brian-rcg>
Date: 2016-04-22T16:03:16Z
From: Brian G. Peterson
Subject: Exit Order By Current Position Info
In-Reply-To: <571A42B2.2000806@vodafone.it>

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