Move snippets and strategies folders to misc directory

This commit is contained in:
2025-02-28 15:20:34 -08:00
parent 7174c8dca2
commit 25f43bc40c
10 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
//@version=6
indicator("Shooting Star and Doji Detector", overlay=true)
// Function to determine if a candle is a shooting star
is_shooting_star(open, high, close, low) =>
body_length = math.abs(close - open)
upper_shadow = high - math.max(open, close)
lower_shadow = math.min(open, close) - low
// Shooting star conditions:
// 1. Small body (less than 1/3 of total candle length)
// 2. Upper shadow at least 2x the body length
// 3. Lower shadow is very small
body_length <= (high - low) / 3 and upper_shadow >= body_length * 2 and lower_shadow <= body_length
// Function to determine if a candle is a doji
is_doji(open, high, close, low) =>
body_length = math.abs(close - open)
total_range = high - low
// Doji conditions:
// 1. Body is very small (less than 10% of total candle range)
body_length <= total_range * 0.1
// Plot shooting star red mark
plotchar(is_shooting_star(open, high, close, low),
title="Shooting Star",
char="+",
location=location.abovebar,
color=color.red,
size=size.small)
// Plot doji green mark
plotchar(is_doji(open, high, close, low),
title="Doji",
char="+",
location=location.abovebar,
color=color.green,
size=size.small)