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...

AI-Agents - Codex

FazDane Analytics - How to Build and Schedule Codex-Based Agents | 2026 Faz Dane ANALYTICS How to Build and Schedule Codex-Based Agents Complete guide to autonomous multi-hour Ralph loops, skill automation, and scheduled agent deployment with OpenAI Codex Published May 2026 | Developer Guide OpenAI Codex agents represent a new frontier in autonomous software development. Unlike traditional AI assistants that pause for confirmation at every step, Codex agents can run autonomously for hours , making decisions, writing code, and executing tasks without human intervention. This guide walks through the complete setup: enabling the hidden `/goal` command for autonomous runs, building reusable skills that scale, configuring sche...

Weekly Market Analysis: Strong Trend, Rising Rotation, and a Choppy Summer Setup

FazDane Analytics — Weekly Market Analysis | June 6, 2026 SPX Trend Holds Up, but Summer Choppiness Is Starting to Enter the Picture Weekly Market Analysis  ·  Support Levels  ·  Bradley Siderograph  ·  Seasonal Cycle Week of June 6, 2026  |  FazDane Analytics By   FazDane Analytics Weekly Technical Seasonal ~7 min read ►  Editor's Take The S&P 500 continues to hold a bullish structure across all key timeframes. The short-term trend is up. The hourly trend is up. The three-month structure is up. That is the most important starting point — the market is not in a breakdown phase . But the character of the advance is changing. As SPX pushes deeper into 7,553 territory with the recent high at 7,620.9 , volatility compression, options activity, and seasonal timing are beginning to signal a shift from clean momentum expansion toward a more rotational and choppy summe...