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

AMD Technical Analysis

c AMD- December 2024 Current Price Trends and Short-Term Analysis Hourly Chart (Short-Term) The short-term trend for AMD on the hourly chart is currently down , indicating some immediate bearish momentum. However, there are early signs of a turnaround as the price edges up from $132 toward the $145 level. Significant resistance exists at $145 , which will act as a crucial test for further upward momentum. Until AMD decisively breaks this level, the price action is likely to remain choppy and sideways . Immediate-Term Outlook In the immediate term, AMD appears to be stabilizing and attempting to shift upward. The current price action suggests that the stock may oscillate within the range of $132 to $145 in the short term, building a base for a potential breakout. Key resistance levels are $145, $150, and $155. Medium-Term (Three-Month Daily Chart) Trend Overview On the three-month daily chart, AMD exhibit...

Tesla: Comprehensive Analysis

Tesla: Comprehensive Analysis Tesla: A Beacon of Innovation Tesla has undoubtedly established itself as one of the most innovative companies of our era. Since its inception, Tesla's journey has been marked by groundbreaking achievements and relentless pursuit of advancement in electric vehicles (EVs) and renewable energy. Spearheaded by Elon Musk, Tesla transformed the automotive industry by proving that EVs could be both desirable and practical. The company's flagship electric car, the Tesla Roadster, shattered the stereotype of electric vehicles being slow and uninteresting. Following this, models like the Model S, Model X, Model 3, and Model Y have consistently pushed the boundaries in terms of performance, range, and technology. Tesla's innovations extend beyond vehicles, with their advancements in battery technology, solar energy solutions like Solar Roof, and energy storage systems like Powerwall and Power...

Market Shadows: Bullish Efforts Overshadowed by Persistent Bearish Presence

Monthly Market Review: April's Unexpected Decline and May's Outlook Monthly Market Review: April's Unexpected Decline and May's Outlook April: A Downward Shift in the Market April marked the first down month of 2024, with significant declines across major indices. The S&P 500 (SPX) fell by 218 points, the Nasdaq (NDX) dropped by 721 points, and the Russell 2000 (Russel) declined by 150 points. Typically a mild or upward-trending month, April's downturn was influenced by macro-political issues that escalated market volatility, continuing the exuberant price actions from the previous month. May Forecast: Debunking "Sell in May and Go Away" Contrary to the old market adage "Sell in May and go away," the last 10-15 years have not supported this strategy statistically. May tends to be a highly volatile month,...