예스스탁
예스스탁 답변
2025-06-05 11:16:57
안녕하세요
예스스탁입니다.
input : per(14),per2(14);
var : loc(False),bottom(Nan),loc2(false),top(Nan),tx(0);
loc = low < lowest(low, per)[1] and low <= lowest(low, per)[per];
loc2 = high > highest(high, per2)[1] and high >= highest(high, per2)[per2];
if loc == true Then
bottom = 0;
Else
{
if bottom >= 0 Then
bottom = bottom+1;
}
if loc2 == true Then
top = 0;
Else
{
if top >= 0 Then
top = top+1;
}
plot1(bottom,"bottom",blue);
plot2(top,"top",red);
if CrossUp(bottom,top) Then
{
tx = Text_New_Self(sDate,sTime,top,"▲");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Green);
}
if CrossDown(bottom,top) Then
{
tx = Text_New_Self(sDate,sTime,top,"▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
}
즐거운 하루되세요
> 뽀스뽀스 님이 쓴 글입니다.
> 제목 : 항상 죄송스럽네요 지표변환 부탁드려요 건강하세요
> 항상 감사하고 있습미다 건강하세요
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ceyhun
//@version=4
study("Top Bottom Indicator",overlay=false)
per = input(14, title="Bottom Period")
loc = low < lowest(low[1], per) and low <= lowest(low[per], per)
bottom = barssince(loc)
plot(bottom,color=color.blue)
per2 = input(14, title="Top Period")
loc2 = high > highest(high[1], per2) and high >= highest(high[per2], per2)
top = barssince(loc2)
plot(top,color=color.red)
Buy = crossover(bottom,top)
Sell = crossunder(bottom,top)
plotshape(Buy,title="Buy", style=shape.triangleup,location=location.bottom, color=#008000, text="Buy",size=size.tiny)
plotshape(Sell,title="Sell",style=shape.triangledown,location=location.top, color=#FF0000, text="Sell",size=size.tiny)
background = top < bottom ? color.new(#0000FF,80) : top > bottom ? color.new(#FF0000,80) : na
bgcolor(color=background)
alertcondition(Buy, title="Buy Signal", message="Buy")
alertcondition(Sell, title="Sell Signal", message="Sell")