Forum Replies Created
-
AuthorPosts
-
BenOsbornParticipant
Hi 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.
BenOsbornParticipantHi Slade, I’m sure it will come in handy over the coming months.
-
AuthorPosts