Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Buy on open and followed by selling on the close of the same bar #490

Unanswered
gansaihua asked this question in Q&A
Discussion options

Can I buy on open and followed by selling on close to simulate the rollover of futures?

You must be logged in to vote

Replies: 1 comment

Comment options

Unfortunately, that is not possible because it requires two transactions in one bar which is not supported (yet). I had hard time to implement strategies that require to buy at close and sell to next open or to buy at open and sell at the same bar close. I had to rewrite the whole logic of the broker to have order processing once before the Strategy.next, and then second order processing after the same Strategy.next call. I had to add also parameters when each trade to be executed (at current bar open, close or next open and/or N bars later, default 0), not like now: a default set for all trades. So, it is a bit complex and I don't think it will be supported any time soon.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /