Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Any examples? #1

Open
ttodua opened this issue Jan 19, 2020 · 4 comments
Open

Any examples? #1

ttodua opened this issue Jan 19, 2020 · 4 comments

Comments

@ttodua
Copy link

ttodua commented Jan 19, 2020

Hi. Any examples of use?

@timothymarois
Copy link
Member

HI @ttodua

Thanks for your interest. I currently just started this package and haven't fully released its usage yet. I hope to have it ready this week. You're welcomed to contribute if you have any features you'd like to be part of it. In any case, feel free to reach out at any time.

@ttodua
Copy link
Author

ttodua commented Jan 20, 2020

Just wished an example php file, how to place order on i.e. SPY

@timothymarois
Copy link
Member

@ttodua Are you trying to buy/sell or just look at quotes?

@timothymarois
Copy link
Member

It's not complete yet, but functionality will be this:

$td = new TDAmeritrade();
$td->auth()->setClientId('CLIENTID');
$td->auth()->setRequestURI('REQUESTURI');
$td->auth()->setAccessToken('ACCESSTOKEN');

$td->orders()->create([
        'stock' => 'SPY',
        'qty' => 1,
        'side' => 'buy',
        'type' => 'market',
        'time_in_force' => 'day',
        'extended_hours' => false,
        // price only used if not using market
        'price' => null
    ]);

But at the moment this isn't functional, it will be in a few days after I get the authentication down. And I'll have the proper documentation written up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants