dayvid

Tim West Long Short or Choppy

seperates trending markets from choppy ones
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//Created by ChrisMoody for TimWest on 10/17/2014
study(title="TimWest_Long Short Filters", shorttitle="TimWest_Long-Short-Filters", overlay=true)
source = close
def = input(false, title="------Make Sure ONLY 1 Checkbox Below is checked!!! Or You WILL Get False Results!!!------")
def2 = input(false, title="You Can Check More Than 1 Box To Create Multiple True/False Condition BUT The Background Colors Will Change!!!")
def3 = input(false, title="------If You Select More Than ONE CheckBox Below - Test By Plotting Indicators On Chart To Understand BackGround Colors!!!")
def4 = input(false, title="------ACTIVE CheckBoxes Start BELOW This Line!!!---")
sp = input(true, title="Show BackGround Highlight based on Lookback Period of Price?")
len = input(63, title="Lookback Period to Compare Current Price To.  Tim's Default is 63-Approx. 1 Quarter")
ssma = input(false, title="Show BackGround Highlight based on Cross of Short/Long SMA?")
smas = input(50, title="Short SMA.  Tim's Default is 50 SMA and 200 SMA - Golden Cross - Major Market Trend")
smal = input(200, title="Long SMA.  Tim's Default is 50 SMA and 200 SMA - Golden Cross - Major Market Trend")
sema = input(false, title="Show BackGround Highlight based on Cross of Short/Long EMA?")
emas = input(50, title="Short EMA.  Used for Evaluating Shorter Term Moves -Chuck Hughes 7 Time WorldTradingChampion uses 50-100EMA")
emal = input(100, title="Long EMA.  Used for Evaluating Shorter Term Moves-Chuck Hughes 7 Time WorldTradingChampion uses 50-100EMA")
//Criteria for LookBack of Current Price Vs. Price X bars ago
condpru = close[1] > close[len] ? 1 : 0
condprd = close[1] < close[len] ? 1 : 0
condPrice = sp and condpru ? green : sp and condprd ? red : na
//SMA Criteria
condsmaU = sma(close, smas) > sma(close, smal) ? 1 : 0
condsmaD = sma(close, smas) < sma(close, smal) ? 1 : 0
condSMA = ssma and condsmaU ? green : ssma and condsmaD ? red : na
//EMA Criteria
condemaU = ema(close, emas) > ema(close, emal) ? 1 : 0
condemaD = ema(close, emas) < ema(close, emal) ? 1 : 0
condEMA = sema and condemaU ? green : sema and condemaD ? red : na
//BackGround Hilight Plots
bgcolor(condPrice, transp=70)
bgcolor(condSMA, transp=70)
bgcolor(condEMA, transp=70)