Replies: 2 comments
-
This is normal if you're doing a passive roll, but I assume that's not the case...a bit early to be rolling into Sept. I assume your current contract is June. If it's not, you probably will want to fix that (probably involves re-loading multiple & adjusted prices). As for the position, here is what will happen: Right now, your optimal instrument position is 2 (or more likely -2, but let's just say +2). Things look OK to pysystemtrade. If the optimal position changes to 3, you'll buy another June contract. Fine. If the optimal position changes to 1, you'll sell the June contract. Still fine. If the optimal position changes to 0...now you don't have any more June contracts to close, so you'll go short 1 June contract. Overall instrument position: 0, but you're short June, and long Sept. You've inadvertently put on a calendar spread, when you really just wanted to have no position. The situation should resolve itself when you roll to September. But that won't happen for a while. I'm not sure if you can fix this with a manual trade in pysystemtrade, because I don't think it allows you to specify the contract. You'd have to do some hacking, or convince Rob to add that feature. I've had a similar problem before, and I just did a trade directly with IB, then manually updated the positions in Mongo. With position data now in Arctic, I don't think that's even possible any more - I wouldn't even be tempted to try it. |
Beta Was this translation helpful? Give feedback.
-
You can specify the contract on a manual trade
…On Wed, 5 Apr 2023, 14:12 Todd Gibson, ***@***.***> wrote:
This is normal if you're doing a passive roll, but I assume that's not the
case...a bit early to be rolling into Sept.
I assume your current contract is June. If it's not, you probably will
want to fix that (probably involves re-loading multiple & adjusted prices).
As for the position, here is what will happen:
Right now, your optimal instrument position is 2 (or more likely -2, but
let's just say +2). Things look OK to pysystemtrade.
If the optimal position changes to 3, you'll buy another June contract.
Fine.
If the optimal position changes to 1, you'll sell the June contract. Still
fine.
If the optimal position changes to 0...now you don't have any more June
contracts to close, so you'll go short 1 June contract. Overall instrument
position: 0, but you're short June, and long Sept. You've inadvertently put
on a calendar spread, when you really just wanted to have no position.
The situation should resolve itself when you roll to September. But that
won't happen for a while.
I'm not sure if you can fix this with a manual trade in pysystemtrade,
because I don't think it allows you to specify the contract. You'd have to
do some hacking, or convince Rob to add that feature.
I've had a similar problem before, and I just did a trade directly with
IB, then manually updated the positions in Mongo. With position data now in
Arctic, I don't think that's even possible any more - I wouldn't even be
tempted to try it.
—
Reply to this email directly, view it on GitHub
<#1115 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCLPERKSUUWWEWTX6ECOZDW7VVSZANCNFSM6AAAAAAWT4KUJE>
.
You are receiving this because you are subscribed to this thread.Message
ID: <robcarver17/pysystemtrade/repo-discussions/1115/comments/5532168@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hi Everyone,
Long story short, I ended up with a situation where at a strategy level I have the right (optimal) size for an instrument, but not necessarily with the correct underlying contracts. For example I have two GBP positions but one is June contract the other Sept contract.
Does PST/stack handler correct this automatically, or should I fix this with manual trades?
Best,
Emre
Beta Was this translation helpful? Give feedback.
All reactions