Automated trading with Interactive Broker and ProRealTime – NOW AVAILABLE
Forums › ProRealTime English forum › ProOrder support › Automated trading with Interactive Broker and ProRealTime – NOW AVAILABLE
- This topic has 129 replies, 28 voices, and was last updated 5 months ago by Morpheous.
Tagged: futures, IB, interactive broker, proorder
-
-
08/16/2023 at 2:34 PM #219181
Dears,
I have few questions regarding futures trading with PRT/automated systems via InteractiveBrokers.
- what happens if I have open position during futures expiration day? will it be closed automatically by exchange at certain time during that day? is there a way to avoid that, so position is moved automatically from current to the next contract?
- are there major differences in how PRT script works for futures trading vs. how it works for cfds with IG? I noticed for example that when my system generates a stop order for long position entry and current price is all of the sudden higher than my stop-level then IG treats it as “market” order and opens position immediately. while in the same case with futures trading it completely stops the automated system, so I have to restart it, anyway I basically miss the entry. do you have same experience? and if so, can you maybe tell about other major differences you figured out? or maybe somebody knows where to find summary of such differences?
- if I understood correctly, IB allows to trade only one automated system on particular instrument/contract and also does not allow long and short position at the same time for the same instrument/contract. so do I have to open 4 accounts if I want to trade 4 systems? let’s say 2 for long entries only, 2 for short entries only.
aprreciate very much your experiences and feedbacks
regards
justisan
08/16/2023 at 5:35 PM #219197Hi there justisan,
- The position will be closed “somewhere” after the expiration. You should not let it go that far. If you have longer term trades you could be in bad luck. This is theoretically the same for manual trading.
Notice that you can start a new system for the new contract weeks ahead. The price you will get is not the best but for longer term trades this can be diminished (says me). - You should not attempt a System made for PRT-IG on PRT-IB at all. The whole behavior is totally different at various levels (like how the price changes), including your own example.
I am afraid that the list of differences is too long and complicated to explain. Sorry about that. - Yes, you need to open an account, although it can be subaccounts. Max 5 are allowed for total accounts under your name. Maybe if you sign up as an organization (thus not as a private person) this is different. Btw, it is an IB restriction, not PRT.
Regards,
Peter1 user thanked author for this post.
08/16/2023 at 6:34 PM #219201Hi Peter,
By any chance, do you know how does it look like to manage these sub-accounts? Are they accessible from one single PRT instance or do we need to open multiple PRT instances if it is even possible?
Thanks
08/16/2023 at 11:50 PM #219232Hello Kuma,
They show as different accounts and allow / require the opening of the several PRT instances. This is what you want, I would say ?
but
In IBKR is is a little different, because in there you have the Mobile App, and in there you have the choice to switch between the several accounts belonging to the main account, or sum them all together with the total net value for the day and all, and list the individual trades (positions) as how the main account with its sub accounts has them. This is really slick and neat.
Notice that you can use PRT and IBKR in parallel, and trade on either side (app) and all integrates smoothly. This counts for IB’s desktop app (Trader WorkStation – TWS) as well. In the evening I always have IB’s Mobile App on the phone open because it shows all in compact form on e.g. the dinner table (tell your wife that it makes money for her hobbies) and I always have it open in the car just the same. Trading with the Mobile App is something else, as it times out for that after 30 minutes or whatever it is, and it is quite clumsy to login again for trading (don’t attempt that during driving). So this is about monitoring and that never expires for log in. Switching between the sub accounts goes like a breeze (tap the account number which brings forwards a pull down and tap the account to want to monitor – including the choice for “all”).Managing the accounts regarding regular confirmations it is you with entering your passport number and sometimes full data is a regular pain. This may include the separate authorizations for trading CBOE etc. etc. which is for US markets something which looks exaggerated to us, but needs to be confirmed on a regular basis. Not a really big deal if you have one account, but with 5 you can count on sudden “pop ups” before you can continue either platform say 4 times per year per account and for 5 this means something like each month and it really disturbs and distracts. These things happen for TWS’ Desktop app as well, so if you use that alongside, all doubles. Subscriptions for TWS and Mobile data ? it costs relatively nothing but it is screens and screens and screens of which you will never remember where to enter what and how.
And Yes, notice that if you want to use your phone with real time (monitoring) data, it requires subscription data for each sub account, never mind it costs relatively nothing (like USD 2 for Nasdaq per month).Net – don’t laugh – it is too much of a distraction to desire for a next sub account. It really is too much of a hassle to a. create one and b. manage it throughout time. If you compare this to PRT-IG and know that all can be done with just one account infinitely (for number of Systems per Instrument), the IB environment is a disaster. Also, I never see any “confirmation” screens for IG. Not on the PRT side (unless I miss them in the midst of the IB stuff) and most certainly not on the IG side of the matter. You can well say that the IB stuff is overly “American” to know it is you, it is still you and whether it is still you who did not change status for Pro vs Private. I know with eyes closed what to answer for all these screens and fields, but if you would open 4 subaccounts to your main account today, you will go screamingly mad. Promise !
🙂
PS: On the upside again : when you have a sufficient amount of trades in an account, it costs totally nothing on the PRT side of things. Data subscription on the IB side remains, but remember that this is only for monitoring real time data; viewing your phone with 15 minutes delay may also work for you. And if it does, using PRT with IB costs completely nothing no matter you have 5 accounts. But have a sufficient amount of trades (each trade (In and Out separately) brings a credit of 1 euro).
1 user thanked author for this post.
08/17/2023 at 12:13 AM #219233Thanks for your valuable input (as usual).
08/18/2023 at 10:32 AM #219291hi Peter,
thanks for all your feedbacks. I am still curious about maybe some 2-3 major differences which you (or other participants in this forum) were discovering in how PRT scripts works while transiting from cfd with IG to futures with IB trading. I was approaching PRT team with similar request, they were telling “yes there are diffences”, but they were not able or not willing to tell which ones. I am interested in major “technical” differences, like one described by me above (at least from my view significantly different treatment of “buy … at … stop” command by IG vs by IB). it’s pain to discover them in live trading if they are not “visible” in the backtest.
thanks a lot and regards
justisan
08/19/2023 at 4:15 AM #219324Hi again justisan,
The largest differences *are* visible in the Backtest. Just try it. That is, if you get anything running for comparison because Contract Sizes are already different. Fractions are not allowed in IB. The translation of value per point to a price difference plainly works different (and wrongly in IB I say) (so try to scale in IG and when it works to the same in IB and you can’t get it done without adjusting the program and you won’t even know why you are doing it, although eventually it will work (because all is relative to each other)). Try Forex (CFD on both sides) and have a bad week in accomplishing it. Or, try Forex and notice that Backtest in IB works different than Demo in IB but the same in Live (but different to IG “of course”).
I mention global stuff and this list alone is quit some longer but already sufficient to not even want to work with both at the same time.Then what’s not visible with backtesting. This list is endless but additionally never stops growing (for me). This is about how Systems get killed by PRT because of broker anomalies. I think I can cough up 20 or more reasons at IG’s. But also 10+ for IB where the reasons are very different.
When you’d have something running for IG then under IB it won’t run because with IB the broker (IBKR) disappears at Reset time (at a not-at-all fixed time around 6:30 (Amsterdam) thus in the morning when all is just alive (though ETH)). Nothing of that kind in IG and thus also no provisions made by you (dead times) but also no provisions made by PRT because they just don’t have the experience. In general PRT can’t deal at all with disappearing brokers and because they can’t (they lack the intelligence I dare say) they kill your System from the server. In IG this may happen a dozen times per week, and with IB maybe close to that, but for very different reasons. In IB most can be captured by you by avoiding certain type of trades, in IG you can get there quite well too but with different solutions because different events to tackle.
Your program code – meant to be one version – is totally unreadable by now and full of mistakes because redundant. And make a fresh copy and reapply all the changes ? undoable.
With IG there’s the hell of them pausing your stops because at e.g. CPI/PPI/FED times all gets volatile and they will manually control all so they have time to hedge. I have examples of “slippage” (between large quotes) of more than two minutes.There’s also the most crucial “grey area” which is visible with backtesting but which is out of your control. This is mainly about the CFDs indeed, but still not with the CFDs as the real reason. Take Forex as the example; in IB just equal to the Spot thing, in IG no way. For this reason no average can be set up under IG that will work for IB. All works out differently by miles. This expresses in everything. No real volume data in IG and what’s derived is fake because it is IG trading with herself meanwhile (hedging your trades).
This is all so various that I better just stop typing. But stuff like the inordinate “ETH” which IG applies because she trades on with her own community (which is you and me) without volatility, tearing down daily etc. averages again.And you know, I still told nothing because nothing in the above is explained content-wise; it’s all just saying that “it” is so. Not how.
PS: And Yes, you also have the stuff you found out the hard way already, like differences in how to invert a trade, trailing by PRT command not possible in IB and some more functional differences, btw always related to what the broker allows for. And this is part of the pain – it is not always exactly clear what the broker allows for and I recall myself reasoning (in sessions of an hour) with PRT support what could be going on at stuff not working out or failing in error.
Have fun ! and start with deciding for one of them only. For me this is IB which is already because the performance of the Systems won’t change because of hedging changes by IG (of strategies and such) and thus IG influences the performance of your System throughout time – ah, that is a difference in another category. 🙂
Peter2 users thanked author for this post.
08/19/2023 at 4:44 AM #219325“avoiding certain type of trades”
Hi PeterSt,
Could you please elaborate on this? I certainly have experienced little, but some interference from my broker IG, not enough to yet be concerned. Predominantly I operate scalps and small swings on 1 min TF but am taking a run-up at the size I will soon be trading. So far I have taken the approach ‘Better to deal with the Devil you know than the one you don’t’
Regards,
CC
08/20/2023 at 4:00 AM #219355Predominantly I operate scalps and small swings on 1 min TF but am taking a run-up at the size I will soon be trading.
When you exceed 5M per trade and do this (IIRC) with a frequency of once per ~ 20 minutes or more, IG will deal with your order manually.
😉
In order to stay OnTopic : With IB the limit is (USD) 6M anyway, unless you arrange more with them explicitly, or have the Pro status of a certain type. Notice that the Pro status with IG is worth nothing much (if you ask it you’ll get it). With IB this is all more regulated.1 user thanked author for this post.
08/20/2023 at 4:18 AM #219356Got it. Thanks Tom Hougaard…I mean PeterSt
08/20/2023 at 4:28 AM #219358Haha. Well, I only responded to that dealing with the devil, because this is about how to avoid him finding you. Similar would be avoiding Set Stop nLoss. But a better answer to your question related to the “avoiding certain type of trades” would be :
Avoid Pending Orders (Limit or Stop) which change too frequently (like each 5 seconds) because IB cannot deal with them soon enough, often, and it is PRT again choking on that. Thus, as soon as the processing of the order takes longer than the TimeFrame depicts, there will be another Pending Order while the previous one is still pending (no pun). IG does not bothered with this lag, that I ever saw. In IB you must avoid the orders at the higher frequency. You can see the order labels in grey when they are pending for processing at the Broker.
2 users thanked author for this post.
08/29/2023 at 5:20 PM #220024hi Peter,
back from short holidays and now reading your amazing collection of differences IG/cfd vs IB/futures – thanks a lot! even knowing that cfd in general is not a fair/free market so far I was quite ok with them and trading with IG. but got upset since beginning of this year because so frequently I started to face situations where IG all of the sudden temporarily sets sometimes big and sometimes huge “minimum distances” for stop entry orders (also widening temporarily minimum stop exit orders) – which simply stops my automated systems and restarting does work for some time. I figured out that they do it in front of some major economic data realeases etc, and come back to “normal” conditions some 15-30min after the data release. what kind of “market” is that 😀 they basically are “telling” me (I mean – all of us) at which price I can enter the market and at which not… I was writing to IG and talking to some folks there, but the replies were… I better do not comment them, anyway they were no help at all. I can imagine why IG does it and anyway I have to count on that they will continue like this. so that was one of my major motivations to switch to futures trading, avoiding such deliberate manipulation. yet your comments about PRT+IB are not encouraging either 😀 I will anyway give a try, and maybe with time also PRT/IB will work better together.
regards
justisan
1 user thanked author for this post.
08/29/2023 at 11:57 PM #220039Some (odd) news, just thrown into a random – though related – topic …
I think some people may have noticed that lately (4-5-6 weeks ?) it has been quite all right with thrown out systems under PRT-IG ?
I had none, while otherwise several per week – sometimes many on a day.
So what happened ?The department / representing people from IG in the Netherlands disappeared to Sweden.
The “Sweden” as such doesn’t tell me much, but the “disappeared” all the more. So notice that I know the person throwing out my orders (indirectly because PRT can’t deal with their manipulation) told me himself in person (under 4 eyes – no even as “a secret” – he just explained how it all works).
So he and his (relatively small) gang disappeared from Holland, where they pulled the strings from within the exchange floor (suited for this all) in Amsterdam.Please : if someone has better data to override my speculations regarding this, don’t hesitate to elaborate.
So indeed it’s speculation because it doesn’t seem coincidence that since that department has moved (which department really pulled those strings !) nothing weird happened. Zero.On an other note I deem it sad that IG disappeared from Holland, because they arranged for very nice meetings/seminars which in retrospect seemed unique. Or just were unique because nothing of that kind exists any more that I know of. Those who attended know that quite some bit could be learned from the insights, if looked through the commercialities.
Thank you N.C. !
09/29/2023 at 12:12 PM #221797dears,
while transiting my strategies from IG on CFDs to IB on futures I was recently facing below difference between how both treat exit stop orders:
I have code which places “sell” order with stop right at the moment when long entry is triggered, e.g.:
sell at initialstoploss stop // exit A
and then afterwards, depending on conditions which appear on the market/price development / this order has to be adjusted/increased to let’s say to breakeven level:
if onmarket and conditionsmet then
sell at breakevenlevel stop // exit B
endif
what IG with CFDs does: it replaces stop A by stop B
what IB with futures does: it keeps the first exit order and places a second stop order – with the consequences that it requires/reserves addtional margin: this kicked me out immediately out of the trade due to unssuficient cash on the account.
well, I have approx 2x the amount in the account of the margin required to keep a position overnight, but it was abviously not enough 😀
Of course I could increase the amount, but in fact I am looking for solution – and ask the forum for support – how to code those stops so they are replacing each other like they do with IB on CFDs
appreciate very much any support and exchange of your experiences
regards
justisan
09/29/2023 at 12:58 PM #221800justisan,
Can you try to be more specific, please ?
I think that what you literally tell can not be happening for real because there would be no cumulating means in order. Thus, if possible, can you try to add up those “means” which would lead to a larger margin requirement ?You could also consider “thinking error” as in your example I don’t see fixed orders – only pending. Thus, they’d require re-putting each bar, meaning that you’d put them both together which obviously (?) is not the intention.
All I know is this, possibly related to your experience :
If you are 1000 Long and want to invert the position to Short within the same bar – meaning with one command like SellShort 2000 – or otherwise with net the same result in that one bar – hence Sell 1000 followed by SellShort 1000 – then this requires 2000 from your margin; The br0ker only receives the net result which is (-)2000 while it starts off with you being 1000 Long. The solution to this is have the Sell (or ShellShort) 1000 in one code-call (= bar) and the SellShort for the short-1000 in the next code call.Can I be correct that it is something in this realm that bothers you ?
-
AuthorPosts