You can buy stock directly from a company, that's a very old fashioned way to do it. You might get paper stock certificates.
You can't just think up something without knowing anything about how the market works. Learn about markets first then see if you can come up with the process.
A friend and I have come up with a way to possibly have a computer make stock purchases and sales for maximum benefits at extremely repative rates. Would it be illegal to create a program like this?!? We're only in high school and don't have that much knowledge in this area, but we have read you can buy stocks directly from a company, is this true? This seems like a too good to be true situation which is why we are questioning the legality and possibility.