<PAGE>

EXHIBIT 10.4

               SECOND AMENDED AND RESTATED STOCK PLEDGE AGREEMENT

         THIS SECOND AMENDED AND RESTATED STOCK PLEDGE AGREEMENT (the "Pledge
Agreement") is made as of December 15, 2003, by and between FIRST NATIONAL BANK
OF OMAHA, a national banking association having its principal place of business
in Omaha, Nebraska as agent ("FNB-O" or the "Agent") for itself, LASALLE BANK
NATIONAL ASSOCIATION, M&I MARSHALL & ILSLEY BANK, WELLS FARGO BANK, NATIONAL
ASSOCIATION and such additional Revolving Lenders as may from time to time enter
the Third Amended and Restated Revolving Credit Agreement (as the same may be
amended, supplemented or otherwise modified from time to time, the "Revolving
Credit Agreement"), dated as of December 15, 2003 (collectively, the "Revolving
Lenders"), and DATEK ONLINE HOLDINGS CORP. (the "Guarantor"). All terms not
defined in this Pledge Agreement shall have their respective meanings as set
forth in the Revolving Credit Agreement.

                              W I T N E S S E T H:

         WHEREAS, the Agent, the Revolving Lenders and Ameritrade Holding
Corporation, formerly Arrow Stock Holding Corporation (the "Borrower"), are
parties to the Revolving Credit Agreement;

         WHEREAS, the Guarantor and the Agent are parties to an Amended and
Restated Stock Pledge Agreement, dated as of December 16, 2002 (the "Existing
Pledge Agreement");

         WHEREAS, in order to induce the Revolving Lenders to make extensions of
credit to the Borrower and in order to secure the Borrower's obligations due to
the Revolving Lenders under the Revolving Credit Agreement, the Guarantor, a
Subsidiary of the Borrower, has agreed to act as guarantor of the Borrower's
obligations under the Revolving Credit Agreement pursuant to the Second Amended
and Restated Guaranty Agreement, dated as of the date hereof, among the
Guarantor and the Agent, as agent for the Revolving Lenders (the "Guaranty
Agreement");

         WHEREAS, the Guarantor and the Revolving Lenders wish to amend and
restate the Existing Pledge Agreement;

         WHEREAS, the Guarantor and the Revolving Lenders wish to have this
Pledge Agreement, dated as of December 15, 2003, be the controlling agreement
with respect to the matters set forth herein, which shall supersede the Existing
Pledge Agreement;

         WHEREAS, the Guarantor and the Revolving Lenders do not intend for this
Pledge Agreement to be deemed to extinguish any existing obligations of the
Guarantor;

                                     - 1 -

<PAGE>

         WHEREAS, as of the date hereof, the Guarantor and the Agent, for itself
and the Revolving Lenders, are entering into the Second Amended and Restated
Security Agreement (the "Security Agreement");

         NOW, THEREFORE, in consideration of the premises, and for other good
and valuable consideration, the receipt and sufficiency of which is hereby
acknowledged, it is agreed as follows:

                                 I. DEFINITIONS

         Section 1.1 Definitions. For purposes hereof, the following definitions
shall apply:

         "Ameritrade, Inc. Stock" means any stock of Ameritrade, Inc., a direct
Subsidiary of Ameritrade Online Holdings Corp. (formerly Ameritrade Holding
Corporation) ("Ameritrade Online"), which the Guarantor shall now or hereafter
receive or shall become entitled to receive for any reason, as listed in
Schedule A attached hereto, as amended from time to time.

         "Collateral" means the Pledged Stock and the Stock Rights, including
the proceeds of each.

         "Guarantor Event of Default" means an event described in Section 5.

         "Lien" means any security interest, mortgage, pledge, lien,
encumbrance, title retention agreement, or lessor's interest, in, of or on any
of the Collateral.

         "Obligations" means any and all existing and future indebtedness,
obligations and liability of the Guarantor under the Guaranty Agreement, direct
or indirect, absolute or contingent (including all renewals, extensions and
modifications thereof and all attorneys' fees incurred by the Agent or the
Revolving Lenders in connection with the collection or enforcement thereof).

         "Permitted Encumbrance" means any and all encumbrances existing as of
this date that are listed on Schedule B attached hereto.

         "Pledged Stock" means the Ameritrade, Inc. Stock and the Subsidiary
Stock.

         "Section" means a numbered section of this Pledge Agreement, unless
another document is specifically referenced.

         "Stock" means shares of stock in a corporation or other certificated
equity interest.

         "Stock Rights" means any Stock, any dividend or other distribution and
any other right or property, including any "securities entitlement," (as defined
in Article 8 of the Uniform Commercial Code as adopted by the State of Nebraska,
as amended from time to time), which the Guarantor shall now or hereafter
receive or shall become entitled to receive for any reason

                                     - 2 -

<PAGE>

whatsoever with respect to, in substitution for or in exchange for any shares of
the Pledged Stock and any Stock, any right to receive Stock and any right to
receive earnings, in which the Guarantor now has or hereafter acquires any
right, in connection with the Pledged Stock.

         "Subsidiary Stock" means the pledged Stock of the Guarantor's
Subsidiaries as listed in Schedule A attached hereto, as amended from time to
time, and all additional Stock issued to the Guarantor in connection with any
Material Subsidiary; provided, however, that Subsidiary Stock shall not include
any investment property or equity securities issued by any Subsidiary that is
organized under the laws of any jurisdiction other than the United States of
America (or any state thereof) in excess of sixty-five percent (65%) of the
total voting power of all equity securities of such Subsidiary; provided further
that Subsidiary Stock shall not include any investment property or equity
securities issued by Datek Canada Financial Services, Inc.

         The foregoing definitions shall be equally applicable to both the
singular and plural forms of the defined terms.

                              II. SECURITY INTEREST

         Section 2.1 Grant of Security Interest. The Guarantor hereby grants to
the Agent for the benefit of the Revolving Lenders a security interest in the
Pledged Stock and all related Stock Rights to secure payment and performance of
the Obligations, including, without limitation, payment of the Notes. All stock
certificates representing the Pledged Stock shall be delivered to the Agent for
the Revolving Lenders together with appropriate stock powers duly executed in
blank.

                       III. REPRESENTATIONS AND WARRANTIES

         Section 3.1 Representations and Warranties. The Guarantor represents
and warrants to the Agent and the Revolving Lenders that each share of the
Pledged Stock has been duly and validly issued, is fully paid and non-assessable
and is owned by the Guarantor free and clear of any Lien, other than the
security interest created by this Pledge Agreement, the Existing Pledge
Agreement, the Security Agreement and Permitted Encumbrances.

                                  IV. COVENANTS

         Section 4.1 Affirmative Covenants. From the date of this Pledge
Agreement, and thereafter until this Pledge Agreement is terminated pursuant to
Section 7.15, the Guarantor shall:

                  (a) Delivery of Certain Items. Deliver to the Agent any Stock
         certificate or instrument evidencing or constituting Collateral,
         including subsequent shares of Subsidiary Stock (including stock
         dividends) issued to the Guarantor.

                                     - 3 -

<PAGE>

                  (b) Taxes. Pay when due all taxes, assessments and
         governmental charges and levies upon the Collateral, except those being
         contested in good faith by appropriate proceedings and with respect to
         which no Lien exists.

                  (c) Financing Statements and Other Actions. Execute and
         deliver to the Agent all stock powers, financing statements and other
         documents and do such other things from time to time requested by the
         Agent or the Revolving Lenders in order to maintain a first perfected
         security interest in the Collateral in favor of the Agent for the
         Revolving Lenders and to effect a transfer of the Collateral, or any
         part thereof.

                  (d) Reports. Furnish to the Agent such reports relating to the
         Collateral as the Agent or Revolving Lenders may from time to time
         request.

         Section 4.2 Negative Covenants. From the date of this Pledge Agreement,
and thereafter until this Pledge Agreement is terminated pursuant to Section
7.15, the Guarantor shall not:

                  (a) Liens. Create, incur, or suffer to exist, any Lien on the
         Collateral except the security interest created by this Pledge
         Agreement, the Existing Pledge Agreement, the Security Agreement or
         Permitted Encumbrances.

                  (b) Disposition of Collateral. Sell or otherwise dispose of
         all or any part of the Collateral, except as permitted in writing by
         the Requisite Revolving Lenders or as expressly permitted under Section
         4.2 of the Revolving Credit Agreement.

                  (c) Changes in Capital Structure of Issuers. (i) Permit or
         suffer any issuer of Pledged Stock to dissolve, liquidate, retire any
         of its capital stock, reduce its capital or merge or consolidate with
         any other entity (other than as permitted by Section 4.2 of the
         Revolving Credit Agreement), or (ii) vote any of the Pledged Stock in
         favor of any of the foregoing, except as otherwise permitted in writing
         by the Requisite Revolving Lenders; provided that the broker-dealer
         Subsidiaries of the Guarantor may consolidate if (x) the Guarantor
         provides the Agent with prior notice of the consolidation, (y) there
         are no Guarantor Events of Default and (z) all Stock of the entity or
         entities remaining after consolidation of the broker-dealer
         Subsidiaries will have been delivered as collateral to the Agent.

                  (d) Issuance of Additional Stock. (i) Permit or suffer the
         issuer of any of the Pledged Stock to authorize or issue any additional
         Stock, any right to receive Stock or any right to receive earnings,
         unless the same shall be pledged to the Agent hereunder, or (ii) vote
         any of the Pledged Stock in favor of any of the foregoing, except as
         otherwise permitted in writing by the Requisite Revolving Lenders.

                                     - 4 -

<PAGE>

                            V. DEFAULTS AND REMEDIES

         Section 5.1 Events of Default. The occurrence of any one or more Events
of Default under the Revolving Credit Agreement or the failure of the Guarantor
to fulfill its Obligations under this Pledge Agreement, the Security Agreement
or the Guaranty Agreement, if such failure continues beyond the applicable cure
period, if any, shall constitute a Guarantor Event of Default hereunder.

         Section 5.2. Acceleration and Remedies. If any Guarantor Event of
Default occurs and is continuing, and upon the expiration of any applicable cure
period, if any, upon the election of the Requisite Revolving Lenders, the
Obligations, including accrued interest, shall immediately become due and
payable without presentment, demand, protest or notice of any kind, all of which
are hereby expressly waived, and the Agent, or if the Agent refuses to act upon
the direction of Requisite Revolving Lenders, the Revolving Lenders may (i)
exercise all rights set forth in Sections 7.2, 7.3 and 7.4, and (ii) may
exercise any or all of the rights and remedies provided (x) in this Pledge
Agreement, (y) in the Nebraska Uniform Commercial Code (the "Nebraska UCC") and
in the Delaware Uniform Commercial Code (the "Delaware UCC") to a secured party
when a debtor is in default under a security agreement and (z) by any other
applicable law. Upon the occurrence of an Event of Default described in Section
6.1(h)(1) or (2) of the Revolving Credit Agreement, acceleration under this
Section 5.2 shall occur automatically without the election, declaration, notice
or other act on the part of any of the Revolving Lenders.

                      VI. WAIVERS, AMENDMENTS AND REMEDIES

         Section 6.1 Waivers, Amendments and Remedies. No delay or omission of
the Agent or Revolving Lenders to exercise any right or remedy granted under
this Pledge Agreement shall impair such right or remedy or be construed to be a
waiver of any Guarantor Event of Default or an acquiescence therein, and any
single or partial exercise of any such right or remedy shall not preclude other
or further exercise thereof or the exercise of any other right or remedy, and no
waiver, amendment or other variation of the terms, conditions or provisions of
this Pledge Agreement whatsoever shall be valid unless in writing signed by the
Agent, and then only to the extent in such writing specifically set forth. All
rights and remedies contained in this Pledge Agreement or by law afforded shall
be cumulative and all shall be available to the Agent and the Revolving Lenders
until the Obligations have been paid and performed in full.

                             VII. GENERAL PROVISIONS

         Section 7.1 Dividends. Unless a Guarantor Event of Default occurs and
is continuing, any dividends payable in connection with the Pledged Stock may be
payable to the Guarantor.

         Section 7.2 Special Collateral Account. Subject to the provisions of
Section 7.1, all cash received by the Agent or the Revolving Lenders, if any,
with respect to the Collateral shall be deposited in a special collateral
account with the Agent for the Revolving Lenders and shall be held by the Agent
as security for the Obligations. The Guarantor shall have no control

                                     - 5 -

<PAGE>

whatsoever over said special collateral account. The Agent may, but is not
required to, at any time and from time to time, in its sole discretion, apply
any part of the credit balance in said special collateral account to the payment
of the Obligations, in accordance with the Revolving Credit Agreement, whether
or not the Obligations shall be then due.

         Section 7.3 Registration of Pledged Stock. At the option of the Agent,
any registerable Collateral may at any time after the occurrence of a Guarantor
Event of Default and upon the expiration of any applicable cure period, if any,
be registered in the name of FNB-O or its nominee as agent for the Revolving
Lenders.

         Section 7.4 Exercise of Rights in Pledged Stock. After a Guarantor
Event of Default occurs and is continuing, and upon the expiration of any
applicable cure period, if any, the Agent or its nominee as agent for the
Revolving Lenders may at any time and from time to time, without notice,
exercise all voting and corporate rights relating to the Collateral, including,
without limitation, exchange, subscription or any other rights, privileges, or
options pertaining to any shares of the Pledged Stock and the Stock Rights as if
it were the absolute owner thereof. At all other times, the Guarantor may
exercise such rights.

         Section 7.5 Notice of Disposition of Pledged Stock. Notice of the time
and place of any public sale or the time after which any private sale or other
disposition of all or any part of the Collateral may be made shall be reasonable
if sent to the Guarantor, addressed as set forth in Article VIII, at least ten
(10) days prior to any such public sale or the time after which any such private
sale or other disposition may be made.

         Section 7.6 Terms of Disposition. The Guarantor agrees that the private
sale or other private disposition of Collateral consisting of securities shall
be commercially reasonable notwithstanding the possibility that a substantially
higher price might be realized if such sale or other disposition were public and
deferred until after registration under the Securities Act of 1933, as amended,
or compliance with any other applicable securities laws.

         Section 7.7 Possession of Collateral; Disclaimer. Beyond the exercise
of reasonable care to assure the safe custody of the Collateral in the physical
possession of the Agent pursuant hereto, neither the Agent nor the Revolving
Lenders shall have any duty or liability to collect any sums due in respect
thereof or to protect, preserve or exercise any rights pertaining thereto, and
the Agent and each Revolving Lender shall be relieved of all responsibility for
the Collateral upon surrendering it to the Guarantor. No course of dealing
between the Guarantor or the Borrower and the Agent or the Revolving Lenders,
nor any failure to exercise nor any delay in exercising, on the part of the
Agent or the Revolving Lenders, any right, power or privilege hereunder or with
respect to the Obligations shall operate as a waiver thereof; nor shall any
single or partial exercise of any right, power or privilege hereunder or
thereunder preclude any other or further exercise thereof or the exercise of any
other right, power or privilege. The rights and remedies herein provided and
provided in all other agreements, instruments and documents delivered, or to be
delivered, pursuant to or in connection with or to evidence any of the
Obligations are cumulative and are in addition to, and not exclusive of, any
rights and remedies

                                     - 6 -

<PAGE>

of a secured party under the Nebraska UCC or the Delaware UCC. The provisions of
this Pledge Agreement are severable and if any clause or provision thereof shall
be held invalid or unenforceable in whole or in part, then such invalidity or
unenforceability shall attach only to such clause or provision, or part thereof,
and shall not in any manner affect such clause or provision in any other
jurisdiction or any other clause or provision in this Pledge Agreement or any
jurisdiction.

         Section 7.8 Specific Performance of Certain Covenants. The Guarantor
acknowledges and agrees that a breach of any of the covenants contained in
Sections 4.1(a), 4.1(d) or 4.2 will cause irreparable injury to the Revolving
Lenders, that the Revolving Lenders have no adequate remedy at law in respect of
such breaches and therefore agrees, without limiting the right of the Revolving
Lenders to seek and obtain specific performance of other obligations of the
Guarantor contained in this Pledge Agreement, that the covenants of the
Guarantor contained in the Sections referred to in this Section 7.8 shall be
specifically enforceable against the Guarantor.

         Section 7.9 Definition of Certain Terms. Terms defined in the Nebraska
UCC which are not otherwise defined in this Pledge Agreement are used in this
Pledge Agreement as defined in the Nebraska UCC as in effect on the date hereof.

         Section 7.10 Benefit of Agreement. The terms and provisions of this
Pledge Agreement shall be binding upon and inure to the benefit of the
Guarantor, the Agent and the Revolving Lenders and their respective successors
and assignees, except that the Guarantor shall not have the right to assign its
rights nor delegate its duties under this Pledge Agreement, without the prior
written consent of all the Revolving Lenders.

         Section 7.11 Survival of Representations. All representations and
warranties of the Guarantor contained in this Pledge Agreement shall survive the
execution and delivery of this Pledge Agreement.

         Section 7.12 Taxes and Expenses. The Guarantor will upon demand pay to
the Agent (i) any taxes (excluding income taxes) payable or ruled payable by
federal or state authority in respect of this Pledge Agreement, together with
interest and penalties, if any, and (ii) all reasonable expenses, including the
reasonable and documented fees and expenses of counsel for the Agent and the
Revolving Lenders (which may be employees of the Agent or another Revolving
Lender) and of any experts and agents that the Revolving Lenders may incur in
connection with (a) the administration of this Pledge Agreement, (b) the custody
or preservation of, or the sale of, collection from, or other realization upon,
any of the Pledged Stock, (c) the exercise or enforcement of any of the rights
of the Revolving Lenders hereunder, or (d) the failure of the Guarantor to
perform or observe any of the provisions hereof or the failure of the Borrower
to perform or observe any of the provisions of the Revolving Credit Agreement.

         Section 7.13 Choice of Law. This Pledge Agreement shall be construed in
accordance with the laws of the State of Nebraska.

                                     - 7 -

<PAGE>

         Section 7.14 Headings. The title of and section headings in this Pledge
Agreement are for convenience of reference only, and shall not govern the
interpretation of any of the terms and provisions of this Pledge Agreement.

         Section 7.15 Termination. This Pledge Agreement shall continue in
effect (notwithstanding the fact that from time to time there may be no
Obligations outstanding) until the Guarantor has received written notice from
the Revolving Lenders electing to terminate this Pledge Agreement or the
Revolving Credit Agreement is terminated and there are no Obligations
outstanding (other than contingent obligations which, by their terms, survive
termination of the Revolving Credit Agreement). Upon such termination, the Agent
shall promptly return to the Guarantor all certificates and documents in its
possession representing Collateral hereunder and execute and deliver to the
Guarantor such releases and documents as the Guarantor shall reasonably request
to evidence such termination.

         Section 7.16 Counterparts. This Pledge Agreement may be executed in
several counterparts and such counterparts together shall constitute one and the
same instrument.

                                  VIII. NOTICES

         Section 8.1 Sending Notices. Any notice required or permitted to be
given under this Pledge Agreement may be, and shall be deemed, given and sent
when deposited in the United States mail, postage prepaid, or by telegraph or
telex when delivered to the appropriate office for transmission, charges
prepaid, addressed:

         To the Guarantor:

                  DATEK ONLINE HOLDINGS CORP.
                  4211 South 102nd Street
                  Omaha, Nebraska 68127
                  Attention:  John R. MacDonald

         To the Agent and the Revolving Lenders:

                  FIRST NATIONAL BANK OF OMAHA
                  1620 Dodge Street
                  Omaha, Nebraska  68197-1050
                  Attention: Mark A. Baratta

                                   IX. WAIVERS

         Section 9.1 Waivers. By execution of this Pledge Agreement, the
Guarantor intends that the Collateral shall be absolutely and unconditionally
available to secure the prompt payment when due of all Obligations, irrespective
of the unenforceability, illegality or invalidity of such obligations or the
unenforceability, illegality, invalidity or insufficiency of any security

                                     - 8 -

<PAGE>

therefor, together with all reasonable and documented costs, expenses and
attorneys' fees incurred by the Revolving Lenders in connection with any
Guarantor Event of Default.

         It shall not be necessary to procure the consent of the Guarantor or to
give any notice in reference to: (i) any settlement, renewal, extension,
modification, release, waiver, discharge or variation of terms of any of the
obligations of the Guarantor, any other guarantor or any other interested
person, by operation of law or otherwise; (ii) any impairment, release,
collection or liquidation of any collateral for the Obligations; (iii) any
acceptance of new or additional documents, instruments or agreements in
satisfaction or substitution of the Obligations; (iv) any failure to file,
record or register any security document, to preserve or protect the collateral
obtained thereby, or to perfect the security interest therein; or (v) any other
failure of the Agent or the Revolving Lenders to exercise or enforce any of
their rights against the Guarantor.

         The Guarantor hereby expressly waives and dispenses with notice of
acceptance of this Pledge Agreement, notices of non-payment, default,
non-performance or protest, notice of the amount of indebtedness outstanding at
any time, presentments, protests, demands, prosecution of collection,
foreclosure and possessory remedies, all exemption and homestead laws, and all
setoffs and counterclaims.

         If a claim is made upon the Agent or the Revolving Lenders for
repayment or recovery of any amount(s) or other value received by the Agent or
the Revolving Lenders, from any source, in payment of or on account of the
Obligations and the Agent or the Revolving Lenders pay or otherwise become
liable for such claim by reason of any judgment, decree or order or by reason of
any compromise or settlement of such claim, this Pledge Agreement shall remain
in full force and effect to the same extent as if such amount has never been
received by the Agent or the Revolving Lenders, notwithstanding any termination
hereof or the cancellation of any note or other agreement evidencing the
Obligations.

                            [Signature Page Follows]

                                     - 9 -

<PAGE>

         IN WITNESS WHEREOF, the Guarantor and the Agent have executed this
Pledge Agreement as of the date first above written.

                                DATEK ONLINE HOLDINGS CORP.

                                By /s/ John R. MacDonald
                                  ----------------------------------------------
                                Title
                                     -------------------------------------------

                                FIRST NATIONAL BANK OF OMAHA, as Agent
                                for itself and the other Revolving Lenders

                                By /s/ Mark A. Baratta
                                  ----------------------------------------------
                                Title Vice President

                                     - 10 -

<PAGE>

                                   SCHEDULE A

                                  PLEDGED STOCK

<TABLE>
<CAPTION>
                                                                       Number of
           Owner                           Issuer                     Shares/Units        Certificate No.(s)
           -----                           ------                     ------------        ------------------
<S>                             <C>                                   <C>                 <C>
DATEK Online Holdings Corp.     BigThink Corp.                             100                    2

DATEK Online Holdings Corp.     Datek Online Management Corp.              100                    2

DATEK Online Holdings Corp.     Watcher Technologies LLC                   100%                   8

DATEK Online Holdings Corp.     iCapital Markets LLC                       100%                   2

DATEK Online Holdings Corp.     Ameritrade, Inc.                            24%                 [___]
</TABLE>

                                     - 11 -

<PAGE>

                                   SCHEDULE B

                             PERMITTED ENCUMBRANCES

                                      NONE.

                                     - 12 -