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

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

Mastering the Art and Science of Trading

Preface: Navigating the Business of Trading Before immersing oneself in the world of trading, it is imperative to embark on a systematic study of the trading system. Understanding your own identity and behavior, especially in times of panic, is a fundamental aspect of trading. Delving into the intricacies of trading psychology becomes crucial for a trader, laying the groundwork for informed decision-making and emotional resilience. Identifying Tradable Assets: Fundamental Analysis As traders venture into the markets, it is paramount to comprehend the nature of the commodities or instruments they choose to trade or invest in. Factors such as trading volume, liquidity, and the fundamental performance of the underlying asset come into play. Conducting a thorough examination of the company's fundamentals, including financial health, profitability, and debt levels, sets the stage for a well-informed approach. Creating and regularly refining a shortlist

Illuminating the Future: A Comprehensive Analysis of Global X Lithium & Battery Tech ETF (LIT)

Illuminating the Future: Global X Lithium & Battery Tech ETF (LIT) Analysis Technical Analysis The current landscape of the Global X Lithium & Battery Tech ETF (LIT) presents an intriguing financial picture. Standing at $48.48, the ETF's price reflects a 38% retracement from its peak at $97.13. Tracing its journey since 2019, we see fluctuations ranging from $17.83 to $97.13. Currently, it balances precariously at a 38% retracement level. A deeper dive into the 5-year chart reveals a bullish flag pattern, suggesting a possible upswing in the foreseeable future. However, this optimism is tempered by the need for vigilant monitoring amidst the swirling currents of market volatility. In the short term, the ETF has hit a resistance point, indicating potential choppy movements ahead. The MACD indicator underscores this by showing a downward trend, with the FazDane Crossover of moving averages turning negative. This could h