Home › Forums › Trading System Mentor Course Community › Running Your Trading Business › TradeStation API
- This topic is empty.
-
AuthorPosts
-
July 13, 2022 at 3:31 am #102216Craig FisherKeymaster
If anyone is looking for an API for TradeStation, try contacting Harrison Cai:
http://www.harrisonprogramming.com/I found him to be very helpful and his product very sound to date. Thanks to Ben for finding him.
August 5, 2022 at 10:11 pm #114939ChrisThongParticipantDear All,
As you know I am trading a MOC system using TradeStation. I am not using the API (but will contact Harrison for more details). Hence, I am entering my order manually using the OSO order type, and that means I would enter orders with GTC and cancel those that not filled the next day. I have noticed the followings:
1. $ECPG which had a gap down and my order of 4/8/2022 from AB was $67.35 and it opened at $65.02. My order was filled at $67.35.
2. $ZWS which had a gap down and my order of 27/7/2022 from AB was $30.05 and it opened at $28.80. My order was filled at $30.05.Backtest coding is such that AB will buy either at the buy limit or open (whichever is lower). I am not complaining about TradeStation filling my orders at a higher price and this because it is merely executing my orders. My question is will this be eliminated by using the TradeStation API? If so, is it because the API put in the order based on the time set by user? Also, may I know which virtual server do you use?
Thank you and happy trading!
August 6, 2022 at 12:31 am #114994JulianCohenParticipantI’m not sure why Tradestation would not fill your price at the open? That seems very suspect behaviour to me….
August 6, 2022 at 5:26 am #114996Nick RadgeKeymasterChris,
It sounds like your orders are being executed in the pre-market. I would suggest you investigate how to change that so they’re executed during regular market hoursNick
August 6, 2022 at 9:19 am #114995BenOsbornParticipantHi Chris,
Just double check that you are selecting GTC and not GTC+. Pretty sure GTC+ puts you in the pre and post market.
I was lucky enough to catch $ECPG in both my systems. Using the API I was filled at $65.43 and $65.77.
Both orders would have been submitted when it opened below the limit price but obviously they were back in the queue.
I think IB is different to TradeStation in that it doesn’t reserve your capital if you enter a limit order. As TradeStation does, you can’t have the API enter your limit orders straight away (unless you have less orders than available margin). What I got Harrison to do for the TradeStation API is that it watches the price for each potential order and only submits the limit order when price is at the limit price or x distance from it. That way your capital is only reserved at that point in time and you can have more potential orders. I may be wrong but I don’t think those with IB have the capital reservation issue.
I have mine set to enter the limit order when it hits the limit order price. I occasionally don’t get filled but not so much that it is an issue and would change it. Most of the times when I don’t get filled it is because there is some lone order for 100 shares or something 10 cents below where all of the other orders. Price never really properly traded there in my view and I wouldn’t have got filled no matter what.
I use chart VPS. Although I have an issue occasionally when accessing from ipad and PC. TradeStation doesn’t like the scaling between different screen sizes and will crash. Has happened to me 4 times since late March. I just make sure that I don’t open it from another device during market hours just in case. If it does you just need to reload the template and it is all there. Don’t have an issue with speed or memory.
August 6, 2022 at 9:29 am #114997BenOsbornParticipantCase in point is THFF. My limit order was $45.15. There was some lone trade just below but as you can see price never really traded anywhere near there. Most aren’t this obvious. I think I need to add in some volume or turnover filters because I had 3 of these last session that don’t look like they have a lot of volume.
August 8, 2022 at 11:44 pm #114940ChrisThongParticipantThank you for the input!! Also, my apologies that I got it wrong in that the entry price is the open price. For those that use TradeStation, it shows you the limit price and the filled price. In my initial post, I was looking at limit price instead of filled price. I have amended my records. My apologies for this.
Ben, how do you get the list of traded price for a ticker in TradeStation? Something like Time & Sale report from IB. I ask this because the picture that you uploaded appears to be the time and sale report.
August 9, 2022 at 11:21 am #115004BenOsbornParticipantFor that one I go to the Day Trader workspace. There is a window called Matrix. Right click, go to columns and then add the volume column and save the workspace.
You can also add the Matrix to a blank workspace and it will have the volume enabled but I like the Day Trader workspace as my executed orders are at the bottom and I can just click on the ones I want to see. It also brings up the candle chart in a number of timeframes so you can see how price moved to your order.
August 25, 2022 at 9:49 am #114941ChrisThongParticipantFirstly, I would like to thank Ben and Craig for sharing the contact of Harrison. I bought the API from him and testing it tonight’s session.
Ben and Craig, may I know what setting have you set for the OrderActivationDistPct? the default is 0.
August 25, 2022 at 10:10 am #115011BenOsbornParticipantHi Chris,
I have mine set at 0.
August 25, 2022 at 10:12 am #115012BenOsbornParticipantYou probably know this but in case you forgot, you can’t use MOC orders if testing on a SIM account. You have to make sure it is set to close the order just before market close.
August 25, 2022 at 9:07 pm #115013Craig FisherKeymasterI don’t have that setting Chris.
August 25, 2022 at 10:46 pm #115014ChrisThongParticipantThanks Ben. I am testing it in Simulation and have the exit set to with time = 15:59:55. Just need to remember to change it to “1” when I go live.
August 25, 2022 at 10:46 pm #115015ChrisThongParticipantThis is interesting!
August 25, 2022 at 10:52 pm #114942ChrisThongParticipantAlso, I am keen to know what would it do if I set it to 0.5. Does it means, I will get more fills? By doing this, I may deviating from my system’s plan.
For other readers, it is a setting that the developer made so that users can set the percentage when the limit will be placed in the market. Setting “0” means limit order will be placed when the last traded price is >= the limit order. It works in percentage so, 0.5 is 50% means the order will be sent when the last traded price is within 50% of the limit order. I hope I get it right with the explanation.
-
AuthorPosts
- You must be logged in to reply to this topic.