[R-SIG-Finance] Quantstrat Position Accounting System: Netting vs Hedging Systems

Ilya Kipnis ||y@@k|pn|@ @end|ng |rom gm@||@com
Sat Nov 7 23:40:37 CET 2020


Ayhan,

If I'm understanding correctly:

Are you familiar with order sets?

By defining a stop loss that works on a particular parent rule, that
should do the trick.

See this post:
https://quantstrattrader.wordpress.com/2014/08/18/a-hammer-trading-system-demonstrating-custom-indicator-based-limit-orders-in-quantstrat/

-Ilya

On Sat, Nov 7, 2020 at 4:12 PM Ayhan yuksel <ayhanyuksel78 using gmail.com> wrote:

> Dear all,
>
> In quantstrat, as described in package documentation, orders turn into
> transactions,  transactions turn into positions, positions turn into
> trades. And the underlying logic of how you define a position (using
> netting or hedging system) or a trade (flat-to-flat or FIFO etc)
> significantly affects the mechanics of money management rules (stop loss
> etc) and trade statistics (profit factor etc).
>
> For defining positions, the netting vs hedging systems are defined as
> follows:
>
> https://www.metatrader5.com/en/mobile-trading/iphone/help/trade/general_concept
>
> The original implementation of quantstrat is based on a netting system
> where after having a long position, each additional long trade increases
> the current position amount (unless you have a position limit) and the
> stop-loss/take profit is applied to the total position as a whole and not
> to the individual long trades separately.
>
> My question is that is there a way to apply stop loss and take profit to
> each opened trade independently, regardless of order side (long or short)
> and previous positions? If yes, would you provide an example of it?
>
> Best regards
> Ayhan
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list