[R-SIG-Finance] Quantstrat: Creating a custom function to track closed orders

Edward Wilson edward.wilson at hotmail.co.uk
Sun Jan 15 06:06:31 CET 2017


Hi all,


I have a strategy which involves multiple entry/exit levels that can be enabled/disabled dynamically depending upon the fills of the other entry/exit levels in the strategy (along with some other variables).


The way I would like to achieve this is to have a state machine to control the states of each entry/exit Level which can then be checked within my custom rule signal function. At the moment, I'm planning to call the state machine from within the applyRules function if ruleOrderProc returns some closed orders, and pass in the order label as the identifier.


My question is: Is this the best approach, or maybe there is is a better way to achieve this result built into quantstrat already?


Many thanks

Ed Wilson


	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list