Candle Value Rollup.

Discussion in 'Technical Analysis' started by TheBulldog, Jun 21, 2024.

  1. Greetings,
    I have a Trading101 question. But, before I get to my question, let me set something-up.
    I'm streaming Market data to my local database. It contains, the Symbol, open_price, close_price, high_price, low_price, vwap, volume, accumulated_volume, start_datetime, end_datetime, etc..

    I think that I understand the properties of a completed/finished candle with its' Open, Close, High, and Low. My question is in regard to how a candle's values are derived after that candle minute is completed. Before you answer, please read this carefully. On any given Stock, and on any given minute, my market data stream has many transaction records. My understanding is that the highest of them becomes the candle High, the lowest becomes the candle Low. Here's my question, how are the Open and Close derived? Average?
    Thank you in advance.
     
  2. tiddlywinks

    tiddlywinks

    You mention "minute", therefore it is safe to assume you are talking about time-based bar plots. You also seem to understand that your data feed is a constant "stream" of information. Hence, it is the time-based structure of your OHLCV bar plots that determines the visual representation of each "chunk" of the data stream.

    In this case, OHLCV of each bar are determined by Time. Feeds and platforms may differ slightly as to exact starting/ending times of data chunks, in this case 1 minute chunks. Is it 0-59 seconds, or 1-60 seconds that is being chunked?

    HTH
     
    Sprout and TheBulldog like this.
  3. Yes, that is correct. So, when I see a finished one-minute candle, meaning that a new minute candle has begun, that previous candle properties (open,close,high,low) "should be the same" regardless of what trading platform anyone might be using. If that is correct, then with so many transactions that occurred within that previous candle-minute, how are the final properties derived?
    I really hope that makes sense because I may have a very wrong understanding going-on. LOL
     
  4. tiddlywinks

    tiddlywinks

    For practicality, there is no "final" property as the data feed is a constant stream. The data feed and the platform being used for visual representation determine the "chunks". Each transaction is timestamped. Those timestamps AND how the platform processes those timestamps provide the answer to your time-based question.
     
  5. ok, I understand that there is no 'final" property. I meant that when I look at my streamed data for a Stock(n number of records), and then I look at the candle for that stock at that minute using a platform, say Webull or ThinkOrSwim, the data does not line-up. Sometimes it's close, other times way-off.
     
  6. tiddlywinks

    tiddlywinks

    The data stream merely provides data. Transaction time may or may not align with whatever time-based chunking you are doing. There is no requirement for a bar "open" transaction to occur at a specific time. It can occur anytime within the start and end times of the time-based plot. An opening transaction can even be the closing transaction. Or maybe there are no transactions at all within a given start/end time. Yet the empty bar is a completed bar. Same applies for a bar "close". Mind you, this is about when a transaction occurs. The time of a transaction is not the same thing as an explicit starting or ending time of a time-based plot.
     
  7. SunTrader

    SunTrader

    A bar closes, as the close, once a timeframe time ends. The next trade in the next timeframe is the open. Rinse, repeat.

    Now sometimes opening of the day and closing of the day values are amended later by a stock exchange. All data feeds should account for that. Even free ones, which I only use for extraneous esoteric symbols (economic mainly). Get what you pay for.
     
  8. Sprout

    Sprout

    Some platforms start a bar count at the beginning of the timeframe, others at the end. The offset should be 1 bar to sync your data sources.