<PAGE>

                                                                    Exhibit 10.4


                               SECURITY AGREEMENT
                               ------------------


     This SECURITY AGREEMENT (this "Agreement") dated as of July 10, 2001 is
made by The Ashton Technology Group, Inc. ("Ashton"), a Delaware corporation,
Universal Trading Technologies Corporation, a Delaware corporation ("UTTC;
Ashton and UTTC collectively, "Debtor") in favor of RGC International Investors,
LDC ("Secured Party").

                                  BACKGROUND
                                  ----------

     A.   Ashton and Secured Party are parties to a Securities Purchase
Agreement dated August 18, 1999 pursuant to which Secured Party purchased 20,000
shares of Ashton's Series F Convertible Preferred Stock, par value $.01 per
share (the "Series F Preferred Stock");

     B.   Pursuant to the terms and subject to the conditions in that certain
Securities Exchange Agreement of even date herewith between Ashton and Secured
Party (the "Exchange Agreement"), Secured Party is exchanging all shares of the
Series F Preferred Stock currently owned by Secured Party for Ashton's 9%
Secured Convertible Notes (the "Notes");

     C.   As an inducement to the Secured Party to enter into the Exchange
Agreement, Debtor has agreed to execute and deliver to Secured Party this
Agreement pursuant to which Debtor grants Secured Party a security interest in
and to the Collateral (as hereinafter defined) as collateral security for all of
Debtor's Obligations (as hereinafter defined).

     NOW, THEREFORE, the parties agree as follows, intending to be legally
bound.

     Grant of Security Interest.  Debtor hereby grants to Secured Party a
     --------------------------
security interest in the following property, whether now owned or hereafter
arising or acquired (collectively, the "Collateral"):

          (a)  all of the Intellectual Property (as hereinafter defined)
relating to, or otherwise incorporated in, or in any way comprising the System
(as hereinafter defined), together with the System itself.

          (b)  all proceeds and products of any of the foregoing, including
insurance payable by reason of loss or damage and proceeds of proceeds.

     For purposes hereof, "Intellectual Property" means Debtor's existing and
after-acquired or created intellectual property and rights in intellectual
property under licenses including, without limitation, patents, patent
applications, patent rights, inventions, know-how, trade secrets, trademarks,
trademark applications, service marks, service names, trade names, copyrights,
and proprietary products consisting of, among other things, systems, computer
programs, source code and object code, algorithms, schematics and data.

                                       1
<PAGE>

     For purposes hereof, "System" means all of Debtor's existing and future
electronic trading system technology, including, without limitation, the
eVWAP(TM) Trading System (formerly known as the VWAP Trading System) described
in the Securities and Exchange Commission Approval Order, Rel. No. 34-41210,
dated March 24, 1999 and as it may, in the future be enhanced or improved,
including all versions and derivatives thereof.

     Debtor represents and warrants that it is the sole owner of the Collateral
and has the legal right to grant to Secured Party a security interest therein.

     SECTION 1.  Security for Obligations.  This Agreement secures the payment
                 ------------------------
and performance of all indebtedness, obligations, and liabilities of every kind
and nature of the Debtor to Secured Party (whether primary or secondary, direct
or indirect, absolute or contingent, sole, joint, or several, secured or
unsecured, similar or dissimilar, or related or unrelated) heretofore, now, or
hereafter contracted or acquired, evidenced by the Notes or arising hereunder,
including, without limitation, Secured Party's attorneys' fees, and costs and
expenses incurred in connection with the collection and enforcement of the Notes
and this Agreement (collectively, the "Obligations").

     SECTION 2.  Debtor Remains Liable.  Anything herein to the contrary
                 ---------------------
notwithstanding, (a) Debtor shall remain liable under its contracts and
agreements included in the Collateral to the extent set forth therein to perform
all of Debtor's duties and obligations thereunder to the same extent as if this
Agreement had not been executed, (b) the exercise by Secured Party of any of the
rights hereunder shall not release Debtor from any of its duties or obligations
under its contracts and agreements included in the Collateral, and (c) Secured
Party shall not have any obligation or liability under the contracts and
agreements included in the Collateral by reason of this Agreement, nor shall
Secured Party be obligated to perform any of the obligations or duties of Debtor
thereunder or to take any action to collect or enforce any claim for payment
assigned hereunder.

     SECTION 3.  Debtor Use of Collateral in Ordinary Course of Business.
                 -------------------------------------------------------
Debtor shall be able to use the Collateral in its ordinary course of business,
notwithstanding the provisions of Section 5(a) below, which includes licensing
of the Collateral to users and re-distributors pursuant to license agreements
reviewed by and reasonably acceptable to Secured Party.

     SECTION 4.  Further Assurances.
                 ------------------

          (a)    Debtor agrees that from time to time, at its expense, it will
promptly execute and deliver all further instruments and documents, and take all
further action, that may be necessary, or that Secured Party may reasonably
request, in order to perfect and protect any security interest granted or
purported to be granted hereby or to enable Secured Party to exercise and
enforce its rights and remedies hereunder with respect to any Collateral.
Without limiting the generality of the foregoing, Debtor will: (i) notify
Secured Party in writing of any Collateral hereafter created or acquired by
Debtor, together with such descriptive information about such

                                       2
<PAGE>

Collateral as Secured Party may request; (ii) cooperate with Secured Party in
preparing any and all documentation necessary to perfect Secured Party's
security interests in nationally registered patents, trademarks and copyrights
and applications thereof; (iii) cooperate with Secured Party in registering
copyrights and/or patents for all Collateral which is heretofore unregistered;
and (iv) execute and file such financing or continuation statements, or
amendments thereto, and such other instruments or notices, as may be necessary,
or as Secured Party may reasonably request, in order to perfect and preserve the
security interests granted or purported to be granted hereby.

          (b)    Debtor hereby authorizes Secured Party to file one or more
financing or continuation statements, and amendments thereto, relative to all or
any part of the Collateral without the signature of Debtor where permitted by
law. A carbon, photographic, or other reproduction of this Agreement or any part
thereof shall be sufficient as a financing statement where permitted by law.

          (c)    Upon Secured Party's request, Debtor will furnish to Secured
Party statements and schedules further identifying and describing the Collateral
and such other reports in connection with the Collateral all in reasonable
detail.

     SECTION 5.  Transfers and Other Liens.  Debtor shall not:
                 -------------------------

          (a)    Sell, assign (by operation of law or otherwise), or otherwise
dispose of any of the Collateral.

          (b)    Create or suffer to exist any lien, security interest, or other
charge or encumbrance upon or with respect to any of the Collateral except for
liens, security interests or other encumbrances existing as of the date hereof.

     SECTION 6.  Secured Party Appointed Attorney-in-Fact.  Debtor hereby
                 ----------------------------------------
irrevocably appoints Secured Party as its attorney-in-fact, with full authority
in the place and stead of Debtor and in the name of Debtor, Secured Party, or
otherwise, from time to time in Secured Party's discretion to take any action
and to execute any instrument which Secured Party may reasonably deem necessary
or advisable to accomplish the purposes of this Agreement, including, without
limitation:

          (a)    to sign in the name and on behalf of Debtor any financing
statements or other papers required under Section 4.

          (b)    after the occurrence and during the continuance of an Event of
Default, to ask, demand, collect, sue for, recover, compound, receive, and give
acquittance and receipts for moneys due and to become due under or in respect of
any of the Collateral;

          (c)    to receive, endorse, and collect any drafts or other
instruments, documents, and chattel paper in connection with subsection (b)
above; and

                                       3
<PAGE>

          (d)    after the occurrence and during the continuance of an Event of
Default, to file any claims or take any action or institute any proceedings
which Secured Party may deem necessary or desirable for the collection of any of
the Collateral or otherwise to enforce the rights of Secured Party with respect
to any of the Collateral.

     Debtor hereby ratifies and approves all acts of Secured Party as such
attorney-in-fact.  Secured Party shall not, in its capacity as such attorney-in-
fact, be liable for any acts or omissions, nor for any error of judgment or
mistake of fact or law.  This power, being coupled with an interest, is
irrevocable until all Obligations have been fully satisfied.  Any amounts
received or collected by Secured Party in its capacity as such attorney-in-fact
shall be applied as provided in Section 11(b).

     SECTION 7.  Secured Party May Perform.  If Debtor fails to perform any
                 -------------------------
agreement contained herein, Secured Party may itself perform, or cause
performance of, such agreement, and the expenses of Secured Party incurred in
connection therewith shall be payable by Debtor under Section 12(b).

     SECTION 8.  Secured Party's Duties.  The powers conferred on Secured Party
                 ----------------------
hereunder are solely to protect its interest in the Collateral and shall not
impose any duty to exercise any such powers.  Except for the safe custody and
preservation of any Collateral in its possession and the accounting for moneys
actually received by it hereunder, Secured Party shall not have any duty as to
any Collateral or as to the taking of any necessary steps to preserve rights
against any parties or any other rights pertaining to any Collateral.

     SECTION 9.  Inspection Rights.  Secured Party shall have access, upon
                 -----------------
reasonable notice to Debtor, at Debtor's expense, during normal business hours
to (i) inspect, audit, and make extracts from all of Debtor's records, files,
and books of account relating to the Collateral, and Debtor shall deliver any
document or instrument necessary for Secured Party to obtain records from any
service bureau maintaining records for Debtor; and (ii) examine and inspect
inventory and other Collateral owned by Debtor, provided however, upon the
                                                -------- -------
occurrence and during the continuance of an Event of Default, Secured Party
shall have access at any time, from time to time, to make such inspections,
audits and extracts of the Collateral, or from Debtor's records, files or books.
In connection with any such inspection or audit, Secured Party will take
commercially reasonable steps to maintain the confidentiality of Debtor's
proprietary information.

     SECTION 10. Events of Default.  Each of the following shall constitute an
                 -----------------
"Event of Default" hereunder:

          (a)    the occurrence of a Mandatory Redemption Event under the Notes;
or

          (b)    any breach by Debtor of the covenants, agreements and
obligations to be observed or performed by Debtor hereunder.

                                       4
<PAGE>

     SECTION 11. Remedies.  If any Event of Default shall occur and be
                 --------
continuing:

          (a)    Secured Party may exercise in respect of the Collateral, in
addition to other rights and remedies provided for herein or otherwise available
to it, all the rights and remedies of a secured party on default under the
Uniform Commercial Code in effect in the State of Delaware and other applicable
laws and agreements and also may (i) require Debtor to, and Debtor hereby agrees
that it will at its expense and upon request of Secured Party forthwith,
assemble the tangible components Collateral as directed by Secured Party and
make it available to Secured Party at a place or places to be designated by
Secured Party which are reasonably convenient to Secured Party and Debtor and
(ii) without notice except as specified below, sell the Collateral or any part
thereof in one or more parcels at public or private sale, at any of Secured
Party's offices or elsewhere, for cash, on credit, or for future delivery, and
upon such other terms as Secured Party may deem commercially reasonable. Debtor
agrees that, to the extent notice of sale shall be required by law, at least ten
(10) days' notice to Debtor of the time and place of any public sale or the time
after which any private sale is to be made shall constitute reasonable
notification. Secured Party shall not be obligated to make any sale of the
Collateral regardless of notice of sale having been given. Secured Party may
adjourn any public or private sale from time to time by announcement at the time
and place fixed therefor, and such sale may, without further notice, be made at
the time and place to which it was so adjourned.

          (b)    All cash proceeds received by Secured Party in respect of any
sale of, collection from, or other realization upon all or any part of the
Collateral may, in the discretion of Secured Party, be held by Secured Party
(without interest) as collateral for, and/or then or at any time thereafter
applied (after payment of any amounts payable to Secured Party pursuant to
Section 11(b)) in whole or in part by Secured Party against, all or any part of
the Obligations in such order as Secured Party shall elect. Any surplus of such
cash or cash proceeds held by Secured Party and remaining after payment in full
of all the Obligations shall be paid over to Debtor or to whosoever may be
lawfully entitled to receive such surplus.

     SECTION 12. Indemnity and Expenses.
                 ----------------------

          (a)    Debtor agrees to indemnify Secured Party from and against any
and all claims, losses, and Obligations growing out of or resulting from this
Agreement (including, without limitation, enforcement of this Agreement).

          (b)    Debtor will pay to Secured Party on demand the amount of any
and all reasonable expenses, including the reasonable fees and disbursements of
counsel to Secured Party and of any experts and agents which Secured Party may
incur in connection with (i) the custody, preservation, use, or operation of, or
the sale of, collection from, or other realization upon, any of the Collateral,
(ii) the exercise or enforcement of any of the rights of Secured Party, (iii)
the registration of patents, copyrights or trademarks on behalf of Debtor as
contemplated in Section 4(a) hereof, filings or registrations necessary to
perfect the security interests in the

                                       5
<PAGE>

Collateral created hereby or (iv) the failure by Debtor to perform or observe
any of the provisions hereof.

     SECTION 13. Continuing Security Interest; etc.  This Agreement shall create
                 ----------------------------------
a continuing security interest in the Collateral and shall (a) be binding upon
Debtor, its successors, and assigns and (b) inure to the benefit of Secured
Party and its successors, transferees, and assigns. The execution and delivery
of this Agreement shall in no manner impair or affect any other security (by
endorsement or otherwise) for the payment or performance of the Obligations, and
no security taken hereafter as security for payment or performance of the
Obligations shall impair in any manner or affect this Agreement or the security
interest granted hereby, all such present and future additional security to be
considered as one general, continuing security. Any of the Collateral may be
released from this Agreement without altering, varying, or diminishing in any
way this Agreement or the security interest granted hereby as to the Collateral
not expressly released, and this Agreement and such security interest shall
continue in full force and effect as to all of the Collateral not expressly
released.

     SECTION 14. Governing Law; Miscellaneous.
                 ----------------------------

          (a)    Governing Law. This Agreement shall be governed by and
                 -------------
construed in accordance with the laws of the State of Delaware applicable to
agreements made and to be performed in the State of Delaware (without regard to
principles of conflict of laws). Each party irrevocably consent to the exclusive
jurisdiction of the United States federal courts and the state courts located in
Delaware with respect to any suit or proceeding based on or arising under this
Agreement, the agreements entered into in connection herewith or the
transactions contemplated hereby or thereby and irrevocably agree that all
claims in respect of such suit or proceeding may be determined in such courts.
Each party irrevocably waive the defense of an inconvenient forum to the
maintenance of such suit or proceeding. Each party further agree that service of
process upon a party mailed by first class mail shall be deemed in every respect
effective service of process upon the party in any such suit or proceeding.
Nothing herein shall affect any party's right to serve process in any other
manner permitted by law. Each party agree that a final non-appealable judgment
in any such suit or proceeding shall be conclusive and may be enforced in other
jurisdictions by suit on such judgment or in any other lawful manner.

          (b)    Counterparts; Signatures by Facsimile. This Agreement may be
                 -------------------------------------
executed in one or more counterparts, all of which shall be considered one and
the same agreement and shall become effective when counterparts have been signed
by each party and delivered to the other party. This Agreement, once executed by
a party, may be delivered to the other party hereto by facsimile transmission of
a copy of this Agreement bearing the signature of the party so delivering this
Agreement.

          (c)    Headings. The headings of this Agreement are for convenience of
                 --------
reference and shall not form part of, or affect the interpretation of, this
Agreement.

                                       6
<PAGE>

          (d)  Severability. If any provision of this Agreement shall be invalid
               ------------
or unenforceable in any jurisdiction, such invalidity or unenforceability shall
not affect the validity or enforceability of the remainder of this Agreement or
the validity or enforceability of this Agreement in any other jurisdiction.

          (e)  Entire Agreement; Amendments.  This Agreement and the instruments
               ----------------------------
referenced herein contain the entire understanding of the parties with respect
to the matters covered herein and therein and, except as specifically set forth
herein or therein, neither the Debtor nor the Secured Party makes any
representation, warranty, covenant or undertaking with respect to such matters.
No provision of this Agreement may be waived or amended other than by an
instrument in writing signed by the party to be charged with enforcement.

          (f)  Notices. Any notices required or permitted to be given under the
               -------
terms of this Agreement shall be in writing and shall be sent by certified or
registered mail (return receipt requested) or delivered personally or by courier
(including a recognized overnight delivery service) or by facsimile and shall be
effective five days after being placed in the mail, if mailed by regular United
States mail, or upon receipt, if delivered personally or by courier (including a
recognized overnight delivery service) or by facsimile, in each case addressed
to a party. The addresses for such communications shall be:

               If to the Debtor:

                    The Ashton Technology Group, Inc.
                    1835 Market Street
                    Suite 420
                    Philadelphia, Pennsylvania 19103
                    Attention: President
                    Facsimile: (215) 789-3397

               With copy to:

                    Morgan, Lewis & Bockius LLP
                    1701 Market Street
                    Philadelphia, Pennsylvania 19103
                    Attention: Gary Arlen Smith, Esquire
                    Facsimile: (215) 563-5299

               If to a Secured Party:

                    RGC International Investors, LDC
                    c/o Rose Glen Capital Management, L.P.
                    3 Bala Plaza East, Suite 501
                    251 St. Asaphs Road

                                       7
<PAGE>

                    Bala Cynwyd, PA 19004
                    Facsimile: (610) 617-0570


               With copy to:

                    Klehr, Harrison, Harvey, Branzburg & Ellers LLP
                    260 S. Broad Street
                    Philadelphia, Pennsylvania 19102
                    Attention: Barry J. Siegel, Esquire
                    Facsimile: 215-568-6603

     Each party shall provide notice to the other party of any change in
address.

          (g)  Successors and Assigns. This Agreement shall be binding upon and
               ----------------------
inure to the benefit of the parties and their successors and assigns. Neither
the Debtor nor the Secured Party shall assign this Agreement or any rights or
obligations hereunder without the prior written consent of the other.

          (h)  Third Party Beneficiaries. This Agreement is intended for the
               -------------------------
benefit of the parties hereto and their respective permitted successors and
assigns, and is not for the benefit of, nor may any provision hereof be enforced
by, any other person.

          (i)  Further Assurances. Each party shall do and perform, or cause to
               ------------------
be done and performed, all such further acts and things, and shall execute and
deliver all such other agreements, certificates, instruments and documents, as
the other party may reasonably request in order to carry out the intent and
accomplish the purposes of this Agreement and the consummation of the
transactions contemplated hereby.

          (j)  No Strict Construction. The language used in this Agreement will
               ----------------------
be deemed to be the language chosen by the parties to express their mutual
intent, and no rules of strict construction will be applied against any party.

          (k)  Remedies. The Debtor acknowledges that a breach by it of its
               --------
obligations hereunder will cause irreparable harm to the Secured Party by
vitiating the intent and purpose of the transactions contemplated hereby.
Accordingly, the Debtor acknowledges that the remedy at law for a breach of its
obligations under this Agreement will be inadequate and agrees, in the event of
a breach or threatened breach by the Debtor of the provisions of this Agreement,
that the Secured Party shall be entitled, in addition to all other available
remedies in law or in equity, to an injunction or injunctions to prevent or cure
any breaches of the provisions of this Agreement and to enforce specifically the
terms and provisions of this Agreement, without the necessity of showing
economic loss and without any bond or other security being required.

                                       8
<PAGE>

     SECTION 15.  Termination of Security Interest.  Notwithstanding anything
                  --------------------------------
contained herein to the contrary, any security interest granted under this
Agreement shall terminate upon the proper extinguishment of the Debtor's
Obligations.

                                       9
<PAGE>

          IN WITNESS WHEREOF, Debtor, intending to be legally bound, has
executed or caused the execution of this Agreement, under seal, as of the date
first above written.

                              THE ASHTON TECHNOLOGY GROUP, INC.



                              By:    /s/ Arthur J. Bacci
                                  -------------------------------
                                  Arthur J. Bacci,
                                  President and Chief Operating Officer



                              UNIVERSAL TRADING TECHNOLOGIES
                              CORPORATION



                              By:    /s/ Fredric W. Rittereiser
                                  -------------------------------
                                  Fredric W. Rittereiser,
                                  Chief Executive Officer

                                       10