ORDER MATCHING LOGIC (EXCESS BUY AGAINST SELL AND VICE VERSA)

  • HI,

    I WANT A LOGIC FOR ORDER MATCHING SYSTEM.

    SRNOCLTCDBUYSELLQTYMATCHMATCHSRNO

    1A001SELL100NULLNULL

    2A001BUY25NULLNULL

    3A001BUY50NULLNULL

    4A001BUY75NULLNULL

    SO THE NEW RECORDSET SHOULD BE

    SRNO CLTCDBUYSELLQTYMATCHMATCHSRNO

    1A001SELL25252

    2A001BUY25251

    3A001BUY50505

    4A001BUY25256

    5A001SELL50503

    6A001SELL25254

    7A001BUY50

    Thanks in anticipation

    Regards,

    Shantaram

  • I'm afraid more information is required.

    I am not seeing the pattern between the desired output and your input.

    Is there a sequence?

    Are there trading rules which apply?

    Is there some sort of standing balance which must be maintained.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • I'm afraid more information is required. Your MATCHSRNO in the output set obviously references other rows in the output set, but I am not seeing the correlation between the desired output and your input.

    Is there a sequence?

    Are there trading rules which apply?

    Is there some sort of standing balance which must be maintained?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply