Hi,

I have been trying to do fractional-share trading with custom data but haven't been able to do so using all methods mentioned in previous threads (listed below). I have tried using SetHoldings(), MarketOrder(), MarketOrder(quantity=float(X)), setting custom data secruity type to SecurityType.Crypto to no avail. I was able to achieve fractional trading in crypto assets on live trading (Coinbase Pro) but not when backtesting with custom data. 

Note: All experiments done in LEAN locally.

Any help or clarification would be greatly appreciated.

Reader() implementation of Custom data

    def Reader(self, config, line, date, isLiveMode):

        coin = BinanceTradeBarData()
        coin.Symbol = config.Symbol

        data = line.split(",")
        coin.Time = pd.to_datetime(data[0],unit='ms')
        coin.EndTime = coin.Time + timedelta(minutes=1)
        coin.Value = data[4]
        coin.Open = float(data[1])
        coin.High = float(data[2])
        coin.Low = float(data[3])
        coin.Close = float(data[4])
        coin.Volume = float(data[5])
        coin.SecurityType = SecurityType.Crypto

 

Previous Threads about Fractional Trading