OPEN-SOURCE SCRIPT
تم تحديثه Amritsingh Pinbar Candle GhostTrade Criteria

//version=5
indicator("Custom Candle with Asymmetric Wicks", overlay=true)
// === User Inputs ===
// Body percent thresholds (as % of full candle)
bodyMin = input.float(72.0, "Minimum Body %", minval=0.0, maxval=100.0)
bodyMax = input.float(85.0, "Maximum Body %", minval=0.0, maxval=100.0)
// Wick ratio threshold (e.g., 2.0 means one wick must be at least 2x the other)
wickRatio = input.float(2.0, "Min Wick Asymmetry Ratio", minval=1.0, step=0.1)
// === Candle Calculations ===
bodySize = math.abs(close - open)
candleRange = high - low
// Avoid divide-by-zero
validCandle = candleRange > 0
// Body as % of full candle
bodyPercent = validCandle ? (bodySize / candleRange) * 100 : 0
// Wick sizes
upperWick = high - math.max(close, open)
lowerWick = math.min(close, open) - low
// Ensure both wicks are present (non-zero)
bothWicksPresent = (upperWick > 0) and (lowerWick > 0)
// Wick asymmetry condition (either wick must be ≥ wickRatio × the other)
wickAsymmetry = (upperWick >= lowerWick * wickRatio) or (lowerWick >= upperWick * wickRatio)
// Final condition: all must be true
signal = validCandle and bothWicksPresent and wickAsymmetry and (bodyPercent >= bodyMin and bodyPercent <= bodyMax)
// === Plotting ===
plotshape(signal, title="Candle Signal", location=location.belowbar, style=shape.labelup, color=color.orange, size=size.small, text="⚡")
barcolor(signal ? color.orange : na)
indicator("Custom Candle with Asymmetric Wicks", overlay=true)
// === User Inputs ===
// Body percent thresholds (as % of full candle)
bodyMin = input.float(72.0, "Minimum Body %", minval=0.0, maxval=100.0)
bodyMax = input.float(85.0, "Maximum Body %", minval=0.0, maxval=100.0)
// Wick ratio threshold (e.g., 2.0 means one wick must be at least 2x the other)
wickRatio = input.float(2.0, "Min Wick Asymmetry Ratio", minval=1.0, step=0.1)
// === Candle Calculations ===
bodySize = math.abs(close - open)
candleRange = high - low
// Avoid divide-by-zero
validCandle = candleRange > 0
// Body as % of full candle
bodyPercent = validCandle ? (bodySize / candleRange) * 100 : 0
// Wick sizes
upperWick = high - math.max(close, open)
lowerWick = math.min(close, open) - low
// Ensure both wicks are present (non-zero)
bothWicksPresent = (upperWick > 0) and (lowerWick > 0)
// Wick asymmetry condition (either wick must be ≥ wickRatio × the other)
wickAsymmetry = (upperWick >= lowerWick * wickRatio) or (lowerWick >= upperWick * wickRatio)
// Final condition: all must be true
signal = validCandle and bothWicksPresent and wickAsymmetry and (bodyPercent >= bodyMin and bodyPercent <= bodyMax)
// === Plotting ===
plotshape(signal, title="Candle Signal", location=location.belowbar, style=shape.labelup, color=color.orange, size=size.small, text="⚡")
barcolor(signal ? color.orange : na)
ملاحظات الأخبار
//version=5indicator("Custom Candle with Asymmetric Wicks", overlay=true)
// === User Inputs ===
// Body percent thresholds (as % of full candle)
bodyMin = input.float(72.0, "Minimum Body %", minval=0.0, maxval=100.0)
bodyMax = input.float(85.0, "Maximum Body %", minval=0.0, maxval=100.0)
// Wick ratio threshold (e.g., 2.0 means one wick must be at least 2x the other)
wickRatio = input.float(2.0, "Min Wick Asymmetry Ratio", minval=1.0, step=0.1)
// === Candle Calculations ===
bodySize = math.abs(close - open)
candleRange = high - low
// Avoid divide-by-zero
validCandle = candleRange > 0
// Body as % of full candle
bodyPercent = validCandle ? (bodySize / candleRange) * 100 : 0
// Wick sizes
upperWick = high - math.max(close, open)
lowerWick = math.min(close, open) - low
// Ensure both wicks are present (non-zero)
bothWicksPresent = (upperWick > 0) and (lowerWick > 0)
// Wick asymmetry condition (either wick must be ≥ wickRatio × the other)
wickAsymmetry = (upperWick >= lowerWick * wickRatio) or (lowerWick >= upperWick * wickRatio)
// Final condition: all must be true
signal = validCandle and bothWicksPresent and wickAsymmetry and (bodyPercent >= bodyMin and bodyPercent <= bodyMax)
// === Plotting ===
plotshape(signal, title="Candle Signal", location=location.belowbar, style=shape.labelup, color=color.orange, size=size.small, text="⚡")
barcolor(signal ? color.orange : na)
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.