답변완료
수식작성 부탁드립니다.
운영자님 안녕하세요.
지난번 요청드려 받은 아래의 지표를 이용하여 시스템 수식을 만들려고 합니다.
매수조건 : cumulative_volume_delta 값이 red 에서 green 으로 변경될 때 매수
매도조건 : cumulative_volume_delta 값이 green 에서 red 으로 변경될 때 매도
input: cumulation_length(14);
var : upper_wick(0),lower_wick(0),spread(0),body_length(0);
var : percent_upper_wick(0),percent_lower_wick(0),percent_body_length(0);
var : buying_volume(0),selling_volume(0);
var : cumulative_buying_volume(0),cumulative_selling_volume(0);
var : volume_strength_wave(0),ema_volume_strength_wave(0),cumulative_volume_delta(0);
upper_wick = iff(close>open , high-close , high-open);
lower_wick = iff(close>open , open-low , close-low);
spread = high-low;
body_length = spread - (upper_wick + lower_wick);
percent_upper_wick = upper_wick/spread;
percent_lower_wick = lower_wick/spread;
percent_body_length = body_length/spread;
buying_volume = iff(close>open , (percent_body_length + (percent_upper_wick + percent_lower_wick)/2)*volume , ((percent_upper_wick + percent_lower_wick)/2) * volume);
selling_volume = iff(close<open , (percent_body_length + (percent_upper_wick + percent_lower_wick)/2)*volume , ((percent_upper_wick + percent_lower_wick)/2) * volume);
cumulative_buying_volume = ema(buying_volume,cumulation_length);
cumulative_selling_volume = ema(selling_volume,cumulation_length);
volume_strength_wave = iff(cumulative_buying_volume > cumulative_selling_volume , cumulative_buying_volume , cumulative_selling_volume);
ema_volume_strength_wave = ema(volume_strength_wave , cumulation_length);
cumulative_volume_delta = cumulative_buying_volume - cumulative_selling_volume;
plot1(cumulative_buying_volume,"cumulative_buying_volume",green);
plot2(cumulative_selling_volume,"cumulative_selling_volume",red);
plot3(ema_volume_strength_wave,"ema_volume_strength_wave",gray);
plot4(cumulative_volume_delta,"cumulative_volume_delta",iff(cumulative_volume_delta>0 ,green , red));
2025-06-20
279
글번호 191981
시스템
답변완료
부탁드립니다.
안녕하세요. 수고에 항상 감사드립니다.
1>
아래 수식에 signal이 50선 상방 통과시 분홍색● 봉이 생길때 봉의 저가선 종가선(연한그레이) 생기고 저가선과 종가선 사이는 연한 분홍색이 채워져 박스형식으로 생기도록 부탁드립니다.
다음 ●이 생기면 그전의 선은 없어지고 새로 생겨 선은 항상 하나만 유지합니다.
반대로 파랑색● 고가선 종가선 (연한그레이) --- 연한 연두색 채워지게
2>
signal 선 그림처럼 다이버전스 선이 생기도록 가능하다면 부탁드립니다.
봉에도 같이 생기는게 가능하다면 그럼처럼 부탁드립니다.
3> 그림처럼 노랑 박스안 80과 20사이에 5단위의 얇은회색점선 부탁드립니다.
input : length(14);
input : smoType1(3); #1:EMA, 2:SMA, 3:RMA, 4TMA
input : arsiCss(silver);
input : autoCss(true);
//Signal Line
input : smooth(14);
input : smoType2(1);#1EMA, 2SMA, 3RMA, 4TMA
input : signalCss(Orange);
//OB/OS Style
input : obValue(80);
input : obCss(Green);
input : obAreaCss(LightGreen);
input : osValue(20);
input : osCss(Red);
input : osAreaCss(LightRed);
var : src(0);
var : upper(0),lower(0),r(0);
var : d(0),diff(0),alpha(0),num(0),den(0),arsi(0),signal(0),a(0),tx(0);
src = close;
upper = highest(src, length);
lower = lowest(src, length);
r = upper - lower;
d = src - src[1];
diff = iff(upper > upper[1] , r , iff(lower < lower[1] , -r , d));
if smoType1 == 1 Then
{
num = ema(diff, length);
den = ema(abs(diff), length);
}
if smoType1 == 2 Then
{
num = ma(diff, length);
den = ma(abs(diff), length);
}
if smoType1 == 3 Then
{
alpha = 1/length;
num = iff(isnan(num[1]) == true, ma(diff, length) , alpha * diff + (1 - alpha) * iff(isnan(num[1])==true,0,num[1]));
den = iff(isnan(den[1]) == true, ma(abs(diff), length) , alpha * abs(diff) + (1 - alpha) * iff(isnan(den[1])==true,0,den[1]));
}
if smoType1 == 4 Then
{
num = ma(ma(diff, length),length);
den = ma(ma(abs(diff), length), length);
}
arsi = num / den * 50 + 50;
if smoType2 == 1 Then
{
signal = ema(arsi, smooth);
}
if smoType2 == 2 Then
{
signal = ma(arsi, smooth);
}
if smoType2 == 3 Then
{
a = 1/smooth;
signal = iff(isnan(signal[1]) == true, ma(arsi, length) , a * arsi + (1 - a) * iff(isnan(signal[1])==true,0,signal[1]));
}
if smoType2 == 4 Then
{
signal = ma(arsi, smooth);
}
plot1(arsi, "Ultimate RSI",IFf(arsi > obValue , obCss , IFF(arsi < osValue , osCss ,IFf( autoCss , Black , arsiCss))));
plot2(signal, "Signal Line", signalCss);
PlotBaseLine1(obValue, "Overbought");
PlotBaseLine2(50, "Midline");
PlotBaseLine3(osValue, "Oversold");
var : tx1(0),tx2(0);
if CrossUp(signal,50) Then
{
tx1 = Text_New(sDate,sTime,L,"●");
Text_SetColor(tx1,rgb(255, 0, 127));
Text_SetStyle(tx1,2,0);
Text_SetSize(tx1,30);
tx2 = Text_New_Self(sDate,sTime,50,"●");
Text_SetColor(tx2,rgb(255, 0, 127));
Text_SetStyle(tx2,2,0);
Text_SetSize(tx2,16);
}
if CrossDown(signal,50) Then
{
tx1 = Text_New(sDate,sTime,H,"●");
Text_SetColor(tx1,rgb(0, 145, 255));
Text_SetStyle(tx1,2,1);
Text_SetSize(tx1,30);
tx2 = Text_New_Self(sDate,sTime,50,"●");
Text_SetColor(tx2,rgb(0, 145, 255));
Text_SetStyle(tx2,2,1);
Text_SetSize(tx2,16);
}
if CrossUp(signal,80) Then
{
tx1 = Text_New(sDate,sTime,L,"◈");
Text_SetColor(tx1,rgb(255, 0, 212));
Text_SetStyle(tx1,2,0);
Text_SetSize(tx1,15);
tx2 = Text_New_Self(sDate,sTime,50,"◈");
Text_SetColor(tx2,Red);
Text_SetStyle(tx2,2,0);
Text_SetSize(tx2,20);
}
if CrossDown(signal,20) Then
{
tx1 = Text_New(sDate,sTime,H,"◈");
Text_SetColor(tx1,rgb(34, 0, 204));
Text_SetStyle(tx1,2,1);
Text_SetSize(tx1,15);
tx2 = Text_New_Self(sDate,sTime,50,"◈");
Text_SetColor(tx2,Blue);
Text_SetStyle(tx2,2,1);
Text_SetSize(tx2,20);
}
2025-06-23
292
글번호 191979
지표
답변완료
질문드립니다.
거래량 한봉으로만 표현되는것을 , 총 누적수량으로 볼수 있을까요??
input : 조정1(23.6),조정2(38.2),조정3(60.0),조정4(61.8),조정5(78.4);
input : 글자크기(12);
var : a1(0),a2(0),a3(0),b1(0),b2(0),b3(0),Grid(0);
value1=(high-close)/(high-low);
Value2=(close-low)/(high-low);
var1 = iff((high+low)/2<=close,volume,0);
var2 = iff((high+low)/2<=close,volume*value1,0);
var3 = iff((high+low)/2>close,volume,0);
Var4 = iff((high+low)/2>close,volume*Value2,0);
a1=iff((high+low)/2<=close,volume,0);
a2=(high-close)/(high-low);
a3=iff((high+low)/2<=close,volume*a2,0);
b1=iff((high+low)/2>close,volume,0);
b2=(close-low)/(high-low);
b3=iff((high+low)/2>close,volume*b2,0);
Var5 = iff(a1>0,(a3/a1)*100,iff(b1>0,(b3/b1)*100,0));
Plot1(var1);
Plot2(Var2);
Plot3(Var3);
Plot4(Var4);
Plot5(Var5);
if Index == 0 Then
Grid = Grid_New(7, 2, 5,White, Gray, 1, Gray, 0);
if LastBarOnChart == 1 Then
{
Grid_Cell(Grid,0,0,"매수",0,0,BLACK,White);
Grid_Cell(Grid,1,0,NumToStr(var1,2),0,0,Red,White);
Grid_CellSetTextSize(Grid,0,0,글자크기);
Grid_CellSetTextSize(Grid,1,0,글자크기);
Grid_Cell(Grid,0,1,"매수중매도",0,0,BLACK,White);
Grid_Cell(Grid,1,1,NumToStr(var2,2),0,0,BLACK,White);
Grid_CellSetTextSize(Grid,0,1,글자크기);
Grid_CellSetTextSize(Grid,1,1,글자크기);
Grid_Cell(Grid,0,2,"매도",0,0,BLACK,White);
Grid_Cell(Grid,1,2,NumToStr(var3,2),0,0,Blue,White);
Grid_CellSetTextSize(Grid,0,2,글자크기);
Grid_CellSetTextSize(Grid,1,2,글자크기);
Grid_Cell(Grid,0,3,"매도중매수",0,0,BLACK,White);
Grid_Cell(Grid,1,3,NumToStr(var4,2),0,0,BLACK,White);
Grid_CellSetTextSize(Grid,0,3,글자크기);
Grid_CellSetTextSize(Grid,1,3,글자크기);
Grid_Cell(Grid,0,4,"대비(%)",0,0,Green,White);
Grid_Cell(Grid,1,4,NumToStr(var5,2),0,0,BLACK,White);
Grid_CellSetTextSize(Grid,0,4,글자크기);
Grid_CellSetTextSize(Grid,1,4,글자크기);
2025-06-20
277
글번호 191973
지표