Hi all,

I have searched high and low to find a proper way to implement entry and
exit logic that needs access to position or transaction info.

Here is a simple example of what I am trying to achieve:

Entry:
I want to go long when 1) the fastMA is above the slowMA AND 2) there is no
current long position AND 3) there has been at least 10 days since the last
exit transaction date.

TrailingStop:
I want to create a trailing stop and use column stop1 if today is entry day
and column stop2 if not

I have found an entry solution that works by creating a signal for
condition 1, create a rule for this signal where I override the ruleSignal
function, use the new ruleSignal function to get the transaction if exists,
evaluate conditions 2 and 3 and call addOrder.  This is far from ideal as
these are just two sample rules from a bigger strategy that uses pos/txn
info quite a lot, and the code is starting to feel extremely kludgy.  I
have yet to find a solution to the trailing stop.

Is there a better way to address this?

To give you context as to what level responsive to give:
1) I have gone through most of the underlying quantstrat code and have
a basic understanding of what is going on
2) I am a seasoned software engineer with quite a few languages under my
belt
3) I am an experienced trader
4) I have been studying R full-time for the last two months

Kind regards,

Justin Lilly
R 2.15.2, Windows 7, RStudio

	[[alternative HTML version deleted]]

