This indicator is designed to replicate real-time E-mini S&P 500 (ES) futures prices by combining two data sources: SPX Index (Data1): This represents the actual S&P 500 cash index. Premium (Data2): This represents the futures premium, which reflects the difference between the futures price and the underlying index. Let’s break down how each part of the code contributes to this process: Inputs and Variables: powerlanguage input: d1(1), d2(2); d1(1) and d2(2) are input parameters allowing you to specify which data streams the indicator will use: d1 points to SPX data (Data1). d2 points to the futures premium data (Data2). powerlanguage var: csyn(0), go(false), d1change(0), d2change(0); csyn(0): This variable holds the synchronized synthetic price, simulating the ES futures price. go(false): A flag that indicates when to start the synchronization process. It turns true when a new trading day starts. d1change(0) and d2change(0): These variables store the percentage change in the SPX index and the premium, respectively. Logic Flow: 1. Detecting the Start of a New Trading Day powerlanguage if d > d[1] then begin go = true; csyn = c; end if d > d[1]: This checks if the current date (d) is greater than the previous date (d[1]), which signals the start of a new trading day. When this condition is true: go = true;: The synchronization flag is set to true, signaling the system to start processing price updates. csyn = c;: The synthetic price (csyn) is initialized to the current close price (c) at the start of the day. This serves as the baseline from which future changes will be applied. 2. Calculating Percentage Changes and Synchronizing Prices powerlanguage else begin if go then begin d1change = c data(d1) / c[1] data(d1); d2change = c data(d2) / c[1] data(d2]; csyn = csyn[1] * ((d1change + d2change) / 2); end; end; else begin: If the date hasn’t changed (i.e., it’s the same trading day), the indicator continues processing price updates. if go then begin: This ensures that the synchronization logic only runs after the go flag has been activated (i.e., after the new day has started). a) Calculating Percentage Changes powerlanguage d1change = c data(d1) / c[1] data(d1); d2change = c data(d2) / c[1] data(d2]; d1change: This computes the percentage change in SPX: c data(d1): Current close of SPX. c[1] data(d1): Previous close of SPX. d1change = c data(d1) / c[1] data(d1) gives the ratio of current to previous close, effectively capturing how much the SPX has moved. d2change: This computes the percentage change in the futures premium: c data(d2): Current premium. c[1] data(d2): Previous premium. This ratio tells us how the premium, which reflects market expectations for futures, is changing. b) Updating the Synthetic ES Price powerlanguage csyn = csyn[1] * ((d1change + d2change) / 2); csyn[1]: This refers to the previous synthetic price. (d1change + d2change) / 2: This averages the percentage changes of SPX and the futures premium. Why average them?: SPX represents the cash market, reflecting actual stock prices. Premium reflects how futures prices diverge from the SPX due to factors like interest rates, dividends, and market expectations. By averaging the changes, the indicator creates a balanced synthetic ES futures price that reflects both real-time index movements and futures-specific dynamics. csyn = csyn[1] * ((d1change + d2change) / 2): The previous synthetic price (csyn[1]) is adjusted by the average of SPX and premium changes, creating a dynamic, real-time replication of ES futures prices. 3. Plotting the Synchronized Synthetic Price powerlanguage if go then plot1(csyn, "c"); if go then plot1(csyn, "c");: If the synchronization process has started (go = true), the synthetic price (csyn) is plotted on the chart. The plot is labeled "c" and scaled to the price axis, visually representing the real-time ES futures price replication. Summary of How This Replicates ES Futures Prices SPX Data (d1) provides the real-time index value of the S&P 500. Premium Data (d2) reflects futures market expectations, capturing factors like interest rates and dividends that influence futures pricing. The indicator: Tracks the changes in both SPX and the premium. Averages these changes to produce a synthetic ES futures price that adjusts in real-time. The resulting synthetic price closely mirrors the behavior of actual ES futures, offering a real-time approximation based on SPX and premium data.
AFAIK the $SPX only updates every 15 seconds most data feeds so no it can't be used for 1 second trading. 1 second trading!!!
why must i be the one to educate all yall? here is what he doesn't know or understand. The difference between the premium quoted on TV at the beginning of the market and the $PREMIUM ticker symbol updated in real-time lies in how they are calculated and their intended use: 1. Premium Quoted on TV (Opening Premium) Definition: This is usually the difference between the fair value of S&P 500 futures and the actual S&P 500 index (SPX) at the market open. Calculation: Fair Value = SPX + (Cost of Carry - Dividends). The premium is then the difference between the futures price and this fair value. Frequency: Typically updated once daily at the market open and referenced for broader market sentiment. Purpose: It's used to give a general idea of how futures are trading relative to the index before the market opens. A positive premium indicates futures are trading above fair value (bullish expectation), while a negative premium suggests they're below fair value (bearish expectation). 2. $PREMIUM Ticker (Real-Time Premium) Definition: This is a real-time, continuously updated measure of the difference between the S&P 500 futures (ES) and the S&P 500 index (SPX). Calculation: Similar to the TV premium, but updated every second to reflect the live changes in both the futures market (ES) and the spot market (SPX). Frequency: Updated second-by-second during market hours. Purpose: Traders use this for high-frequency and intraday trading strategies to identify arbitrage opportunities or short-term market dislocations. Key Differences: Aspect TV Quoted Premium $PREMIUM Ticker Frequency Once daily at market open Continuously updated in real-time Use Case General market sentiment before market opens High-frequency and intraday trading analysis Data Sources Futures fair value and SPX at open Live S&P futures (ES) and SPX price feeds Trading Impact Broad overview, less actionable intraday Critical for real-time arbitrage and scalp trades In essence, the TV quoted premium offers a snapshot for broad market sentiment, while the $PREMIUM ticker is a dynamic tool for traders seeking to capitalize on minute-to-minute movements in the market.
So how come I can see 1s bars on Tradingview ? If they can get 1sec data - why not me too. And if not, can I forward the data from TradingView to myself ?
you can chatgpt what you want, no retail is seriously arb es and spx, and spy for that matter. it is not worth the effort for less than a penny. spx and es move the same direction, add 25 points to spx on average, except around the rollover period. when spx is closed overnight, there is nothing to arb, different animal completely.