Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to backtest buy today and sell tomorrow long strategy? #21

Open
ghost opened this issue Jun 21, 2016 · 0 comments
Open

How to backtest buy today and sell tomorrow long strategy? #21

ghost opened this issue Jun 21, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 21, 2016

I am trying to backtest this simple strategy of buying today and selling tomorrow or from n days but I dont know how to code the strategy in this package

strategy=iif(open>lag(open),1,iif(nextday,0,NA))

The above strategy is simple if yesterdays open price is less than todays open price then buy and sell the share next day.

The buy part I am able to code but how should I tell SIT to sell it the next day or after n days?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants