예스스탁
예스스탁 답변
2025-08-27 12:51:34
안녕하세요
예스스탁입니다.
var : openPrice(0),highPrice(0),lowPrice(0);
var : isHourClose(False),isPositive(False),isNegative(False);
var : tx1(0),tx2(0),tl(0);
openPrice = open;
highPrice = high;
lowPrice = low;
isHourClose = TimeToMinutes(sTime)%60 == 0;
isPositive = isHourClose and (openPrice == lowPrice) and (lowPrice == lowest(lowPrice, 1));
isNegative = isHourClose and (openPrice == highPrice) and (highPrice == highest(highPrice, 1));
if isPositive == true Then
{
tx1 = Text_New(sDate,sTime,lowPrice-1,"▲");
tx2 = Text_New(sDate,sTime,lowPrice-1,NewLine+NumToStr(openPrice,2));
Text_SetStyle(tx1,2,0);
Text_SetStyle(tx2,2,0);
TL = TL_New(sDate[1],sTime[1],LowPrice,sDate,sTime,lowPrice);
}
// 음의 텍스트 및 선 표시
if isNegative == true Then
{
tx1 = Text_New(sDate,sTime,highPrice+1,"▼");
tx2 = Text_New(sDate,sTime,highPrice+1,NumToStr(openPrice,2)+NewLine);
Text_SetStyle(tx1,2,1);
Text_SetStyle(tx2,2,1);
TL = TL_New(sDate[1],sTime[1],highPrice,sDate,sTime,highPrice);
}
즐거운 하루되세요
> cliba 님이 쓴 글입니다.
> 제목 : 지표 변환부탁드립니다.
> // 시가, 고가, 저가 변수
openPrice = open
highPrice = high
lowPrice = low
// 매시간 정시에 해당하는 캔들인지 확인
isHourClose = (minute == 0)
// 양의 조건: 시가가 저가와 같고 저가가 더 이상 갱신되지 않는 경우
isPositive = isHourClose and (openPrice == lowPrice) and (lowPrice == ta.lowest(lowPrice, 1))
// 음의 조건: 시가가 고가와 같고 고가가 더 이상 갱신되지 않는 경우
isNegative = isHourClose and (openPrice == highPrice) and (highPrice == ta.highest(highPrice, 1))
// 텍스트를 저장할 변수
var string ssText = na
// 양의 텍스트 및 선 표시
if (isPositive)
ssText := str.tostring(openPrice)
label.new(bar_index, lowPrice - 1, text=ssText, style=label.style_label_up, color=color.green, textcolor=color.white, size=size.large, textalign=text.align_center)
line.new(bar_index[1], lowPrice, bar_index, lowPrice, color=color.red, width=1)
// 음의 텍스트 및 선 표시
if (isNegative)
ssText := str.tostring(openPrice)
label.new(bar_index, highPrice + 1, text=ssText, style=label.style_label_down, color=color.green, textcolor=color.white, size=size.large, textalign=text.align_center)
line.new(bar_index[1], highPrice, bar_index, highPrice, color=color.blue, width=1)
else
ssText := na // 조건이 충족되지 않으면 텍스트를 비움