Home › Forums › Trading System Mentor Course Community › Running Your Trading Business › Finding New Ways of Messing Up Trade Execution
- This topic is empty.
-
AuthorPosts
-
June 2, 2021 at 12:45 am #102125GlenPeakeParticipant
The following is related to my monthly R1000 rotational system.
My system uses a MAX Position of 5.
Last night it was time to rotate. I use RealTest to generate the CSV Order file, which includes the both Sell/Buy orders.
There are 5 Sell orders and 5 new Buy orders.
I load the CSV into my R1000 SmartAPI and send the orders to TWS…. I can see both Buy/Sell orders listed in TWS….. all good.
I login this morning to check all my orders… and see that there is a mixture of weird BUY/SELL orders…. e.g. some of the BUY orders executed successfully only to then see the position reversed and sold several seconds after the BUY was executed.
5 of my original SELL orders went through only to see 1 of the position ‘bought back’???? WTF?
Of the 5 new BUY orders, (only) 3 positions were executed successfully…. then 2 of those BUY orders were then reversed and SOLD off…. WTF?
The positions were being re-bought/re-sold about 10 seconds after executing…..
(My other systems executed via SmartAPI all OK overnight…. so the issue I was experiencing seemed isolated to just my R1000 rotational).
I had a quick look through the SMARTAPI logs to see if there was something there that would provide clarity….. I then spotted the following and it immediately clicked as to what probably happened.
2021-06-01 23:30:13,745 DEBUG : [5] – [API–Advanced Logging] Maximum Allowed Fill is : 5
2021-06-01 23:30:13,746 DEBUG : [5] – [API–Advanced Logging] current Filled Amount is : 8Typically I would manually set my SELL orders directly via TWS…. i.e. for my NDX or ASX100 rather then via the SmartAPI. (This is so I can navigate any margin issues in my cash account, by getting the SELL orders executed and then set my BUY orders to be sent via the SmartAPI 1minute after the market opens etc).
However last night I had available funds to cover any margin issues in my cash account, so I decided to send all BUYs/SELLs together via SmartAPI.
As this system uses a MAX Position of 5, within the SmartAPI I have set MAX Positions Allowed of 5…
I had forgotten to up the MAX Position value to 10, to account for the 5 additional Sell orders…..:silly: this apparently sent the SmartAPI a curve ball (understandably) and when the Max Positions of 5 was exceeded, the SmartAPI tried to ‘manage’ the situation by ‘reversing’ some the executed orders. :blush:
Oh well…. no harm done, I’ll just place the outstanding orders again tonight…..
Just thought I’d share in case others encounter a similar situation….
June 2, 2021 at 1:50 am #113349TrentRothallParticipantAh… that is a trick to avoid! A few expletives were spoken i bet!
June 2, 2021 at 2:21 am #113351GlenPeakeParticipant….haha… perhaps 1 or 2 expletives….. lol…..
June 2, 2021 at 8:06 am #113352JulianCohenParticipantNice one Glen….That’s a gold star on the wall for sure
June 2, 2021 at 9:25 am #113356GlenPeakeParticipantROFL… Gold star indeed…
I figured you might get a laugh reading about it
June 3, 2021 at 5:37 am #113360JulianCohenParticipantI think I might be able to beat you in this one Glen.
I use RT to produce my scans on my VPS so I thought I’d speed things up bit and changed the import start date for the data file. I accidentally made it a few days too short for the indicators so yesterday it produced an incorrect scan. The correct scan should not have had BBBY and actually would have lost about 0.05% Instead I dropped 2.5%
And today’s scan has all of them in it as shorts !! AMC, KOSS, BBBY, PETS GULP!
Gulp by the way is my thoughts on the matter, not a stock
June 3, 2021 at 5:47 am #113372GlenPeakeParticipantYeah… That really sucks. Talk about shooting yourself in the foot… Trading is tough enough without the added self inflicted pain.
I think you can have the GOLD medal with that ‘neat trick’ you just pulled, I’ll just have to settle for the Silver medal this week Julian….
June 3, 2021 at 6:38 am #113373JulianCohenParticipantHopefully we can call this a draw and not carry on with the competition
-
AuthorPosts
- You must be logged in to reply to this topic.