Forum Replies Created
-
AuthorPosts
-
BenOsbornParticipant
In early March I decided to close the remaining trades in the BWTT and move the capital to my MOC systems. This was because the version of WTT had been cobbled together prior to joining the Mentor program from what I could find on internet chat forums, trying to piece together the code myself and throwing in some over optimisation of irrelevant parameters. In short, it wasn’t robust. I may revisit it again sometime in the future, putting into practice the knowledge I have gained here.
From the beginning of March until 28 March I was trading a live MOC system on the Russell 2000 whilst I worked on getting an API type solution developed for Tradestation. This was ready for me to start testing this week. I tested on SIM Monday and then moved to live testing Tuesday as some of the features (such as the MOC orders) do not work on SIM. This week has been a lot of late nights (US opens at 9:30pm here) making sure the system was running, orders were entering etc and early mornings (3:20 am for me) ensuring unfilled orders were cancelled, MOC orders were in place etc.
On Tuesday when I moved to live testing of the API I moved to trading a combined MOC system. I should buy a lotto ticket as pure luck saw me start trading the combined system live on a day where I got an 11% return. Will continue testing with the late nights and early mornings next week to make sure it continues to run as it should.
No problems with ChartVPS so far.
March 2022 Performance
US
BWTT + 0.21% (17.58% drawdown) (discontinued early March)
MOC RUT – 6.7% (discontinued late March)
Combined MOC +9.1% (started late March)ASX
Growth Portfolio -0.31% (7.26% drawdown)BenOsbornParticipantSlow week for me this week. I only had 21 fills, which is less than half the last two weeks.
Observations for this week:
– Three trades didn’t close in time for one session. The orders tried to send one second after market close. There were 10 other orders that filled that day that did close in time though. Closed on in aftermarket trading, on in pre-market the next day and one when the market opened.– I had a partial fill in one session. Unlike Interactive Brokers, Tradestation does not recognize the partial fill to send an OSO order to close just prior to market close. Managed to close in aftermarket trading.
The problem with closing in aftermarket, pre-market or the following day is that Tradestation seems to reserve that available margin / capital and I can’t use it in the next session, even though the trades are closed. This means that the next session I can only have a max of 37 trades. This presents an opportunity cost. What if the 3 trades that I couldn’t enter were the ones that triggered (it has happened before)?
To try and mitigate this I have changed my OSO orders to send the order to close 5 seconds prior to market close. This does come with its own costs. More often than not I end up with a worse price than 2 seconds before or the MOC orders in the backtest. Although I only have limited data to test at this stage. Either way there is a trade off.
All this will hopefully be irrelevant soon as the API type solution is progressing. I have put it on my VPS this morning to start testing it next week. To say I’m excited about this is an understatement!
I am trying ChartVPS for my VPS as I needed more RAM to run it than what Speedy Trading Servers offered (unless I went for their Mega VPS). I have heard that they are good but I will wait and see over the coming month.
BenOsbornParticipantHi Paul,
This is what I have in my watchlists in Norgate Updater. These all appear automatically in my Amibroker Watchlists in the filter and under watchlists.
Is that what you meant?
BenOsbornParticipantChris Thong wrote:Hi Ben,I am building a MOC system for R1000 universe. I will be trading with TradeStation platform as I cannot access margin with IB. Would you mind sharing the details of the API and how much it costs?
Hi Chris, it is still being programmed at the moment but it is expected to cost a few thousand dollars. The features so far are those above.
Happy to discuss it more with you when it is finished if you like and put you in touch with the programmer.
BenOsbornParticipantAnother week and the MOC system ran pretty much as expected with the following observations:
– As previously noted, there is some slippage compared to the Market on Close order prices in the backtest and the price I can get 2 seconds prior to market close. Sometimes it is in my favour but overall against me. Nothing I can really do about this until my API type solution is ready.
– I have had one instance where a position was entered live where the Norgate Data in AmiBroker shows that price did not reach that level, so it wasn’t in the backtest results.
– I had one instance where there was a price spike down at the open. My order was at the low and didn’t get filled but it did in the back test.
The other drama I had this week was a computer glitch that took me hours to resolve. My computer just kept scrolling down or sideways whenever I opened something. Finally got it resolved, had entered 35 out of 40 orders and ran out of available margin. Realised that in my haste I had forgot to adjust my capital in the exploration and the quantities were all wrong! Finally adjusted all the orders and entered the remaining 5 orders 20 mins before the market opened. After all that the market went straight up from the open and nothing triggered for the session.
After many hours over the last couple of weeks I finished my spreadsheet combining the two systems over the last 17 years to get an idea of the combined gains, losses, drawdowns, number of orders etc on a daily, monthly and yearly basis.
It is not often that the system is fully invested. It is a mean reversion system that enters on a buy limit. It has me thinking is there an opportunity to develop a momentum type moc system that takes advantage of days where price just runs from the open and there are very few entries for the mean reversion system. Something that I will look at.
The other thing that I am thinking about is when to put the rest of my capital into this system. I probably have about 65% in at the moment. I have done a fair bit of testing and run it for 3 weeks now. I feel comfortable with the system but I know that I can be optimistic about things and I’m trying to take a balanced approach to ensuring everything is working as it should and not just getting excited about trading if that makes sense.
BenOsbornParticipantCraig Fisher wrote:Quote:In many cases, my backtest shows 1 less share than what the exploration did the day before.Floor can be used in the exploration position size calculation instead of Round which should help.
Thanks Craig, that did the trick.
BenOsbornParticipantMy MOC system pretty much ran as it should this week with the following observations:
– In many cases, my backtest shows 1 less share than what the exploration did the day before. Has anyone else come across this?
– As I am using TradeStation, my orders to close are market orders submitted 2 seconds prior to the market close (automatically triggered when the buy order is triggered). There is some slippage compared to the Market on Close order prices in the backtest. Nothing I can really do about this at the moment.
– I have had one instance where a position was entered live where the Norgate Data in AmiBroker shows that price did not reach that level, so it wasn’t in the backtest results.
– I also had one position enter a few seconds prior to market close and the sell order didn’t trigger in time before market close. Not too much I can do about this at the moment. I closed out in after hours trade not too far away from the last price.
Overall, I was happy with how it worked from a technical perspective this week. Will probably add some more capital next week.
I have a programmer working on an API type solution at the moment which should address a couple of the problems above.
The current features are that:– Orders are entered for each system via a csv from the Amibroker output
– Once 40 positions are triggered (unless capital and margin are exhausted earlier) the remaining orders will be cancelled
– Orders that haven’t been triggered will be canceled 30 mins (user input) prior to market close
– Open positions can be set to be closed with a MOC order or OSO order that closes with a market order 2 seconds (user input) prior to market close
It still looks like there will be some drawbacks due to how TradeStation calculates available margin / capital. Also, it means that because of how it will need to run to get around this it will require a bit more computing power. Fine for my home PC but probably means I will need to look at a more upgraded VPS plan. Will wait and see once it is complete anyway. Beggars can’t be choosers!
Does anyone who uses the IB API or any other API have any thoughts on useful features that I may have missed? Any suggestions are appreciated.
BenOsbornParticipantGot spanked by the market last night but all in all I am pretty happy as (after my order entry f up on Friday) everything worked as it should. All orders closed just prior to the market close.
Spent a lot of my long weekend combining daily system results in a spreadsheet and noticing that a good touch up from the market every now and then is not uncommon so I am not bothered in the slightest with the results from one day.
BenOsbornParticipantWell 30 positions triggered last night however I have to own up to a very embarrassing mistake.
When I re-created the the order template from sim account to my live account, I forgot to change the order that closes the position to a sell!
2 seconds before the market closes a sell order is meant to be sent to close my positions. The default when you create an order is buy and I forgot to change this to sell so two seconds before the market closed all my open positions wanted to buy more!
Now I have been sitting here in the after hours market closing out positions where I can to at least get my margin under the overnight margin requirements (which I have). 15 positions to go with 15 more orders waiting to be picked up.
Lesson learned, double check your orders closely!
BenOsbornParticipantThe first night I had no entries trigger (which was confirmed as correct with a backtest) and the second night I had 3 entries trigger.
One of the entries worked correctly and the position was closed at the close of the market. The other 2 entries closed immediately after opening. I’m not sure why this happened as everything appeared to be entered correctly. Will enter on my live account tonight anyway to see if it was just a problem on Sim.
I also spoke with a Tradestation programmer this morning who is confident he can program me something that will enter orders from the Amibroker output (rather than me manually entering every order) and get around the Tradestation limitations on order numbers (as each buy limit order reduces available capital). Similar to the Chartist IB API in a way I expect. Fingers crossed anyway.
BenOsbornParticipantHi Chris,
Margin of 100 means that you are using no margin. Is that what you were intending?
40 positions at 5% would equate to 200% of your equity, meaning that you would need at least some margin available (overnight margin at least). Margin would need to be set at 50 to simulate this.
(Note: I am fairly new to the program so happy to be corrected if I have misunderstood this)
Regards,
BenBenOsbornParticipantAs IB has declared me a poor Australian, I can’t access their day trade leverage and have gone down the Tradestation path for my MOC system.
I am locked and loaded for tonight’s US session to test the system and that I have entered my orders correctly. Craig has been kind enough to guide me through the process of entering OSO orders to close any positions that are triggered prior to the market close.
I have only entered them on Sim tonight to make sure I have entered the orders correctly. I am not worried about the result tonight, only that everything works as it should. If all works out I will then test on my live account tomorrow. In saying that, I am not really worried about the result for any one night as I have done plenty of testing that shows I have a good probability of being profitable in a 3 to 6 month period. Just push the button.
Their are a few drawbacks trading with TradeStation compared to using the API with IB. I am currently looking into whether there are other solutions to this.
I have also been looking at Alpaca Markets (thanks for the info Hendrik), but as you need to used an API coded with Python this is sort of on the backburner at the moment. I am interested in learning other programming languages so have started an online python course on the side to learn the basics. However, I want to make the most of my time with Nick and Craig for the period of the program so that won’t be my focus at this point in time. I figured the best option would be to start with Tradestation and evaluate other opportunities that may take more of my time in the future.
BenOsbornParticipantInspiring stuff!!!
BenOsbornParticipantHi Hendrik,
I have run into the same problem as you with IB and leverage. I am in the process of developing a MOC system and was considering Tradestation.
I wouldn’t mind having a chat with you about Alpaca, how you have found them, any challenges, how difficult it has been to get the API running, does it do what you want, drawbacks etc (my coding experience is pretty much limited to this program but I am not afraid to give it a go).
If you are happy to message or chat my skype address is benosbornmac or my email address is [email protected].
Nice results on your MOC strategies.
Cheers,
BenBenOsbornParticipantGreat to hear Rob, I’m really looking forward to it.
-
AuthorPosts