webull icon indicating copy to clipboard operation
webull copied to clipboard

Fractional Share Purchase by 'MKT' place_order

Open cjszk opened this issue 3 years ago • 3 comments

Fractional Share Purchase Support - Currently when calling wb.place_order(), it casts the 'quant' value to an int, rounding it. The endpoint accepts a 'float' value for MKT orders to purchase fractional shares.

data = {
            'action': action,
            'comboType': 'NORMAL',
            'orderType': orderType,
            'outsideRegularTradingHour': outsideRegularTradingHour,
            'quantity': int(quant), # changing this to float(quant) works to execute fractional share purchase.
            'serialId': str(uuid.uuid4()),
            'tickerId': tId,
            'timeInForce': enforce
        }

cjszk avatar Aug 01 '22 07:08 cjszk

let me give it a try, I think it is an easy fix.

tedchou12 avatar Sep 11 '22 04:09 tedchou12

#338

tedchou12 avatar Sep 12 '22 20:09 tedchou12

@cjszk Could you give this branch a try?

tedchou12 avatar Sep 12 '22 20:09 tedchou12