Alright I'll bite..... I'm very familiar with the VBBasket Example as I built a few bots starting with that code..... lvStocks.ListItems(intOrderCount).SubItems(1) is a row/column in the listview lvStocks... eg. it's an object in their program, the grid that you see... Unless you have replicated it in your program and named it lvStocks then I'm surprised your program will even run/compile without errors... Anyways, listen to these guys, you need to be very careful. A 500$ stop loss by your firm will NOT cap your losses @ 500$, you could easily lose 100X that if a few things go wrong. btw, check out this: http://sterlingfinancialsystems.com/documents/Documentation/Special_Test_Guide.pdf it's a guide for the demo mode, as different symbols will give you different behaviour. fill, partial, pending etc... - mnx
What advice? You said learn the language. Thatâs a no brainer. What do you think Iâm trying to do? Isnât the best way to learn something, is to do it? Well I donât understand. You say to learn the language first, but have given a few examples of people who you say are experts in coding, but blew out thousands of dollars in a few seconds. So whatâs your solution? Didnât they know their code? Iâm using the demo account. If that tests fine, why wouldnât it work on the real account? BTW I will be starting off trading 100 shares of a liquid stock like UYG or MSFT. I have been manually trading for awhile. I am a terrible trader and do all of the classic mistakes. I have no idea how to predict market direction. So I have 3 options. Keep doing what Iâm doing and probably loose more, try to finally get a automated system going that will take me out of the equation, or quit trading. Iâll bet youâll tell me to opt for number 3.
Thank you I have read that thread a few times. It seems itâs a little too advanced for me. Everybody over there is just concerned about how many quotes per second they can get and the different programming languages. Iâm just using VB6 now. I think that will be good enough for now. I will go get a book from the library tonight. I hit my daily stop loss once and it instantly closed all of my positions and locked me out for the rest of the day. So I still donât see how that wonât be my backstop, but Iâm trying to be careful here. I think I understand what you guys mean by losing thousands in a few seconds. When I was trying to do something with Tradestation, when I would backtest it, I would sometimes see that it would make repeated sells at the bid, for instance. I figured this out to mean it was sending the order with a price of 0 instead of the correct one. So instead it would fill it at the bid. It would then theoretically keep doing this on every tick until I ran out of money because of commissions. I know that the code doesnât always do what you think it will, thatâs why I have the demo account. BTW is there much difference between VB6 and VB Express 2008?. I have heard they change the code a lot, so Iâm just sticking with VB6 for now because that is what the examples are written in.
No, just doing it isn't always the best way to learn something. Would you learn how to defuse bombs by just doing it? How about surgery? Our advice was not to learn the language, it was to learn the language first. Let me point out one other thing. The reason you kept trying to put "Bid" for the price is that you saw " 'bid" in that line of code you pasted. What you don't realize is that the single apostrophe indicates a comment and anything after that is not read by the program. It's just the author of the program reminding himself that he's going to use the bid price. This is something you'd learn in the first 5 minutes of a VB class or book. And then you would have saved yourself 2 days of struggle with this problem. If I'm telling you what has happened to experienced programmers, doesn't it make you wonder what kind of damage a novice programmer might do? Or do you really believe that as a beginner you'd make less mistakes? You've already pointed out that the limitations of the demo platform. You can't test much more than basic functionality there. It can't test whether your program is making the decisions you expect. Eventually you will be forced to 'test' your code out live. Ain't Sterling great? Or option 4. Take a couple weeks, actually learn the basics of the language and potentially save some $ by avoiding some boneheaded mistakes. And I predict in the long run you will get to where you want to go a lot faster. Think of it as spending a couple days with a golf pro before you actually try to golf for the first time. You will be glad you did it. Your reasons for automating are great. The path you've chosen to your goal is risky and probably not even the fastest way there.
Yes I knew the apostrophe was to indicate comments, Iâm not that dumb. I didnât use bid for the price, I used every convievable variation of it as outlined in the Sterling manual. Obviously that didnât work. Your making it out like I just woke up today and decided to write a black box. Iâve read the manual and examples many times. I understand the basic logic of how code works. What I want to do I could have done in 5 minutes on Tradestation, so I thought with a little tweaking I could get it to work in VB. Gee, give me a break. Iâm sorry everything Iâve ever done in my life I have done on my own. I have no one else to ask. Yes I have 2 parents and siblings that love me, but I am the only one I know who has ever tried to do more than get a stupid job working for the Man. I am 24 and have tried trading, insurance, mortgages, vending machines, a kiosk store in a mall, and selling on eBay (700+ feedback, 100% positive). Yes I failed at just about everything and now have to deliver pizza, but at least Iâm trying. The odds are that I will fail at this as well, but at least I tried. I have learned the hard way that sometimes logic doesnât work, thatâs why I am inclined to trial and error, rather than reading a book. OK Iâll go get a book. BTW I have taken golf lessons from a top 100 teacher. Their good to have, but nothing can take the place of experience.
All I'm doing is offering you advice to get you where you want to go more quickly and without blowing yourself up. Sorry if I offended you.
Sorry to butt in, but Sandybestdog, I think your missing the point. Shreddog is not saying not to try to mess around with the example and such, but it will be a lot easier for you and a lot less headache if you get the basic down pat first and then tweak the code as you say, because things will be a lot clearer for you. I just started to automate some of my trading and I did the same thing you did, started with the examples and then tried to work backwards to figure out what was going on, and it was a painful road. Once I grabbed a book on vb and learned the basic did everything start to come together and now I am getting closer to get my application up and running. I still have a lot of questions and don't fully understand, but having the basics really helped, not saying this is going to make me avoid some costly mistakes but its sure gonna help . Didn't mean to hijack this conversation but I thought I just give my 2 cents.
Okay, I'll actually answer your question. In order to buy at the bid you need to know what the bid price is. Unfortunately sterling will not magically let you buy at the bid like wealthlab or whatever (though they should). In order to do that you have to register the symbol with the API and stream its quotes and save the price in some variable (or list like in their example). Take a look at the quotes example they give. On second thought, don't. Whoever coded that program should be fired. But it's probably the same guy who's in charge of updating sterling for the past few years. Talk about inefficient.... You know what, I'm in a giving mood since it's almost Christmas. I'll post up a simple VB example on how to load a list of symbols, use a hash table, display it in a flexgrid, and send an order out at bid/ask. This weekend. It's 2 am now. I'll even include some safeguard ideas for new years. Errr... unless I'm missing something and you can place an order at the bid without actually knowing what the price is?
There is only one example Sterling gives of using a limit price and that is in the Basket Example. Yes, looking down further at the code where you can buy at the bid, they basically send a request to capture the bid price. It is a lot of code to do that, so Iâm going to have to really go through it to understand it. I thought it was referencing the symbol from somewhere else and using some sub item that meant âbidâ or something like that. Iâll start reading my beginners VB book I got last night. Capturing prices, hash tables, flexgrids, - that seems beyond âfirst grade material that can be learned in 5 minutesâ Shredog. Maybe like 3rd grade, but certainly not 1st.