Code Monkey home page Code Monkey logo

Comments (4)

joshfraser avatar joshfraser commented on August 28, 2024

Agreed that this is a bug. Not sure the right fix is deleting those lines. Don't have time to investigate right now though.

from robinhood-to-csv.

wezzybytes avatar wezzybytes commented on August 28, 2024

I don't think the CSV output should replace order quantity and price with first execution quantity and price. Order price and quantity are entered by a user when creating an order. It may differ from the executed price and quantity.

Here's an example of a market order from my portfolio (note both prices):

Order:{  
   'updated_at':'2018-04-04T14:43:25.745567Z',
   'ref_id':None,
   'time_in_force':'gfd',
   'fees':'0.00',
   'cancel':None,
   'response_category':None,
   'id':'[ORDER_ID]',
   'cumulative_quantity':'100.00000',
   'stop_price':None,
   'reject_reason':None,
   'instrument':'https://api.robinhood.com/instruments/[INSTRUMENT_ID]/',
   'state':'filled',
   'trigger':'immediate',
   'override_dtbp_checks':False,
   'type':'market',
   'last_transaction_at':'2018-04-04T14:43:25.648000Z',
   'price':'3.05000000',
   'executions':[
      {  
         'timestamp':'2018-04-04T14:43:25.648000Z',
         'price':'2.91990000',
         'settlement_date':'2018-04-09',
         'id':'[EXECUTION_ID]',
         'quantity':'100.00000'
      }
   ],
   'extended_hours':False,
   'account':'https://api.robinhood.com/accounts/[ACCOUNT_ID]/',
   'url':'https://api.robinhood.com/orders/[ORDER_ID]/',
   'created_at':'2018-04-04T14:43:25.427702Z',
   'side':'buy',
   'override_day_trade_checks':False,
   'position':'https://api.robinhood.com/accounts/[ACCOUNT_ID]/positions/[POSITION_ID]/',
   'average_price':'2.91990000',
   'quantity':'100.00000'
}

I propose to leave the order price and quantity alone. Cumulative quantity is the sum of execution[quantity], and average_price is the average of execution[price]. Most users refer to these as filled quantity and filled price, respectively.

from robinhood-to-csv.

joshfraser avatar joshfraser commented on August 28, 2024

@YAmikep are you happy with @cdesai-qi's solution?

from robinhood-to-csv.

YAmikep avatar YAmikep commented on August 28, 2024

Yes, sounds good, the order information should not be changed by the executions.

from robinhood-to-csv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.