Skip to main content

Shadow Trader - Piviot ThinkScript

#==================
# Floor Trader Pivots# FazDane# Last Update 17 Mar 2009

# Shadow Trader Uses the Floor Trader Pivots# PIVOT = (High + Close + Low)/3# R3 = High + 2(Pivot - Low)# R2 = Pivot + (R1 - S1)# R1 = (2*Pivot) - Low# S1 = (2*Pivot) - High# S2 = Pivot - (R1 - S1)# S3 = Low - 2(Hi - Pivot)



input showOnlyToday = NO;input Market_Open_Time = 0930;input Market_Close_Time = 1600;

def day = getDay();def lastDay = getLastDay();def isToday = if(day == lastDay, 1, 0);def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

def pastOpen = if((secondsTillTime(Market_Open_Time) > 0), 0, 1);def pastClose = if((secondsTillTime(Market_Close_Time) > 0), 0, 1);def marketOpen = if(pastOpen and !pastClose, 1, 0);def firstBar = if (day[1] != day, 1, 0);

def closingBell = if secondsTillTime(Market_Close_Time)[1] > 0 and secondsTillTime(Market_Close_Time) <= 0 or (secondsTillTime(Market_Close_Time)[1] <> 0) then 1 else 0;

rec regHoursHigh = if(high > regHoursHigh[1] and marketOpen, high, if(marketOpen and !firstBar, regHoursHigh[1], high));rec regHoursLow = if(low <> 0 and !firstBar, regHoursLow[1], low));

rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);

rec prevClose = compoundValue(1, if closingBell then runningClose else prevClose[1], close);

rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);

rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);



# PIVOT = (High + Close + Low)/3

rec Piviot = (prevHigh + prevClose + prevLow) / 3;

# R3 = High + 2(Pivot - Low)

rec R3 = prevHigh + 2 * ( Piviot - prevLow );

# S1 = (2*Pivot) - High

rec S1 = (2 * Piviot) - prevHigh; # R1 = (2*Pivot) - Low

rec R1 = (2 * Piviot) - prevLow;

# R2 = Pivot + (R1 - S1)

rec R2 = Piviot + (R1 - S1);

# S2 = Pivot - (R1 - S1)

rec S2 = Piviot - (R1 - S1);

# S3 = Low - 2(Hi - Pivot)

rec S3 = prevLow - 2 * (prevHigh - Piviot);



#Piviot Plotplot PlPiviot = if shouldPlot then Piviot else double.nan;PlPiviot.SetStyle(curve.SHORT_DASH);PlPiviot.SetDefaultColor(color.white);PlPiviot.SetLineWeight(3);

plot Resl = if shouldPlot then R1 else double.nan;Resl.SetDefaultColor(color.dark_red);Resl.SetLineWeight(3);

plot Sup1 = if shouldPlot then S1 else double.nan;Sup1.SetDefaultColor(color.dark_green);Sup1.SetLineWeight(3);

plot Res2 = if shouldPlot then R2 else double.nan;Res2.SetDefaultColor(color.darK_red);Res2.SetStyle(curve.LONG_DASH);Res2.SetLineWeight(3);

plot Sup2 = if shouldPlot then S2 else double.nan;Sup2.SetStyle(curve.LONG_DASH);Sup2.SetDefaultColor(color.dark_green);Sup2.SetLineWeight(3);

plot Res3 = if shouldPlot then R3 else double.nan;Res3.SetDefaultColor(color.light_red);Res3.SetLineWeight(3);

plot Sup3 = if shouldPlot then S3 else double.nan;Sup3.SetDefaultColor(color.light_green);sup3.SetLineWeight(3);sup3.SetLineWeight(3);
#==================

Popular posts from this blog

Inside the 2026 Market Cycle: Volatility, Opportunity, and Trend Reversal

Market Outlook – Cycle Modeling, Analog Analysis & Trading Playbook 2026 Market Outlook: - A Cycle-Based Framework for the Coming Inflection Year By FazDane Analytics – Gann Cycles • SPX Analog Modeling • Macro Liquidity Signals Introduction Financial markets rarely move randomly. Beneath the volatility and narrative noise, long-term structural cycles tend to repeat in surprisingly consistent patterns. Using W.D. Gann’s time-cycle matrix, liquidity-driven analogs, and historical SPX behavior, 2026 emerges as one of the most important inflection years of the decade. The Gann row containing 2026 links directly to some of the most consequential years in market history: 1913 → 1932 → 1950 → 1969 → 1987 → 2006 → 2008 → 2026 These years include major tops, bottoms, crashes, liquidity contractions, and generational turning points. Together they form the backbone of the 2026 Analog SPX Model , a statistically meaningful roadmap for how markets may behave thro...

Gold’s Rising Momentum: Technical Structure and Macro Outlook for 2025

Gold Market Review – November 2025 | FazDane Analytics Gold Market Review – November 2025 By FazDane Analytics Preface After a sharp selloff from early October into November, gold has begun to recover toward its mean level, regaining technical stability and re-establishing key trend relationships. This market review evaluates gold’s current price structure, technical posture, correlation regime shifts, and long-term macro pattern — providing a comprehensive understanding of where gold stands and what risks lie ahead. 📌 Current Price Snapshot Gold is currently trading around 4084 , recovering from its recent drawdown and drifting back toward key moving averages and VWAP levels. Despite recent volatility, momentum is beginning to shift upward, and the balance of probabilities favors a near-term continuation of the rebound. Key Levels R...

Market Review -May 19, 2025

🧭 Comprehensive Daily Market Review – May 19, 2025 🧭 Market Overview: S&P 500 Futures (ES) As of mid-morning, the S&P 500 futures market (ES) remains resilient despite early weakness. After falling 60 points overnight, the index has rebounded, now down just 10 points and trading above VWAP (5938) — a sign of short-term strength. Both short-term and long-term trends remain bullish , with this week’s expected range between 6042 (upside target) and 5857 (support) . Technicals show robust momentum but caution as resistance approaches. Key Resistance : 5950–6018 Support Zone : 5909–5927 Current Price : Above all key moving averages 20 SMA: +4% 50 SMA: +6.35% 200 SMA: +2.94% 📊 Technical Internals Indicator Reading Outlook MACD +39 Strong bullish momentum FDTS +23 Buy signal confirmed RSI 68.43 Approaching overbought CPCI 1.2 High hedging, cautious tone SKEW 136 Elevated tail-risk ...