OPEN-SOURCE SCRIPT
papa experiment

//version=6
indicator("Edufx AMD", shorttitle="Edufx AMD", overlay=true)
// ───── Inputs ─────
timezone = input.string("America/New_York", "Timezone")
enableDailyCycles = input.bool(true, "Enable Daily Cycles")
colorAcc = input.color(color.new(color.gray, 80), "Accumulation")
colorManip = input.color(color.new(color.red, 80), "Manipulation")
colorDist = input.color(color.new(color.green, 80), "Distribution")
// ───── Daily Anchor (NY 8PM) ─────
var int dayStart = na
if na(dayStart) or time >= dayStart + 86400000
dayStart := timestamp(timezone, year, month, dayofmonth, 20, 0)
accEnd = dayStart + 9 * 60 * 60 * 1000
manEnd = dayStart + 15 * 60 * 60 * 1000
distEnd = dayStart + 24 * 60 * 60 * 1000
// ───── State ─────
var float accLo = na
var float accHi = na
var float manLo = na
var float manHi = na
var float disLo = na
var float disHi = na
var bool accDone = false
var bool manDone = false
var bool disDone = false
// ───── Daily AMD ─────
if enableDailyCycles
// Accumulation
if time >= dayStart and time < accEnd
accLo := na(accLo) ? low : math.min(accLo, low)
accHi := na(accHi) ? high : math.max(accHi, high)
if time >= accEnd and not accDone and not na(accLo)
box.new(dayStart, accHi, accEnd, accLo,
xloc=xloc.bar_time, bgcolor=colorAcc, border_color=colorAcc)
accDone := true
// Manipulation
if time >= accEnd and time < manEnd
manLo := na(manLo) ? low : math.min(manLo, low)
manHi := na(manHi) ? high : math.max(manHi, high)
if time >= manEnd and not manDone and not na(manLo)
box.new(accEnd, manHi, manEnd, manLo,
xloc=xloc.bar_time, bgcolor=colorManip, border_color=colorManip)
manDone := true
// Distribution
if time >= manEnd and time < distEnd
disLo := na(disLo) ? low : math.min(disLo, low)
disHi := na(disHi) ? high : math.max(disHi, high)
if time >= distEnd and not disDone and not na(disLo)
box.new(manEnd, disHi, distEnd, disLo,
xloc=xloc.bar_time, bgcolor=colorDist, border_color=colorDist)
disDone := true
// Reset
if time >= distEnd
accLo := na
accHi := na
manLo := na
manHi := na
disLo := na
disHi := na
accDone := false
manDone := false
disDone := false
indicator("Edufx AMD", shorttitle="Edufx AMD", overlay=true)
// ───── Inputs ─────
timezone = input.string("America/New_York", "Timezone")
enableDailyCycles = input.bool(true, "Enable Daily Cycles")
colorAcc = input.color(color.new(color.gray, 80), "Accumulation")
colorManip = input.color(color.new(color.red, 80), "Manipulation")
colorDist = input.color(color.new(color.green, 80), "Distribution")
// ───── Daily Anchor (NY 8PM) ─────
var int dayStart = na
if na(dayStart) or time >= dayStart + 86400000
dayStart := timestamp(timezone, year, month, dayofmonth, 20, 0)
accEnd = dayStart + 9 * 60 * 60 * 1000
manEnd = dayStart + 15 * 60 * 60 * 1000
distEnd = dayStart + 24 * 60 * 60 * 1000
// ───── State ─────
var float accLo = na
var float accHi = na
var float manLo = na
var float manHi = na
var float disLo = na
var float disHi = na
var bool accDone = false
var bool manDone = false
var bool disDone = false
// ───── Daily AMD ─────
if enableDailyCycles
// Accumulation
if time >= dayStart and time < accEnd
accLo := na(accLo) ? low : math.min(accLo, low)
accHi := na(accHi) ? high : math.max(accHi, high)
if time >= accEnd and not accDone and not na(accLo)
box.new(dayStart, accHi, accEnd, accLo,
xloc=xloc.bar_time, bgcolor=colorAcc, border_color=colorAcc)
accDone := true
// Manipulation
if time >= accEnd and time < manEnd
manLo := na(manLo) ? low : math.min(manLo, low)
manHi := na(manHi) ? high : math.max(manHi, high)
if time >= manEnd and not manDone and not na(manLo)
box.new(accEnd, manHi, manEnd, manLo,
xloc=xloc.bar_time, bgcolor=colorManip, border_color=colorManip)
manDone := true
// Distribution
if time >= manEnd and time < distEnd
disLo := na(disLo) ? low : math.min(disLo, low)
disHi := na(disHi) ? high : math.max(disHi, high)
if time >= distEnd and not disDone and not na(disLo)
box.new(manEnd, disHi, distEnd, disLo,
xloc=xloc.bar_time, bgcolor=colorDist, border_color=colorDist)
disDone := true
// Reset
if time >= distEnd
accLo := na
accHi := na
manLo := na
manHi := na
disLo := na
disHi := na
accDone := false
manDone := false
disDone := false
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.