답변완료
문의 드립니다
안녕하세요
1. 다음 트랜드지표을 다음변수로 3개을 만들고자 합니다
1.라인1;10,1
2.라인1:11,2
3.라인3:12,3의 변수로 만들고 각 라인의 변수는 변경 가능 하게해주세요.
input : Periods(10);
input : Multiplier(3.0);
input : changeATR(1);#1:SMA 0:RMA
var : src(0),alpha(0),source(0),ATR1(0),ATR2(0),ATRV(0);
var : up(0),up1(0),dn(0),dn1(0),trend(0),tx(0);
src = (H+L)/2;
alpha = 1 / Periods;
atr1 = IFf(IsNan(atr1[1]) == true , ma(TrueRange, Periods) , alpha * TrueRange + (1 - alpha) * atr1[1]);
atr2 = ATR(Periods);
atrv = IFf(changeATR == 1 , atr1 , atr2);
up=src-(Multiplier*atrv);
up1 = IFf(IsNan(up[1]) == False,up[1],up);
up = iff(close[1] > up1 , max(up,up1) , up);
dn=src+(Multiplier*atrv);
dn1 = IFf(IsNan(dn[1]) == False,dn[1], dn);
dn = iff(close[1] < dn1 , min(dn, dn1) , dn);
trend = 1;
trend = IFf(IsNan(trend[1]) == False,trend[1], trend);
trend = IFf(trend == -1 and close > dn1 , 1 , iff(trend == 1 and close < up1 , -1 , trend));
if trend == 1 Then
plot1(up,"UpTrend",White);
Else
NoPlot(1);
if trend == -1 then
Plot2(dn,"Down Trend",Black);
Else
NoPlot(2);
if trend == 1 and trend[1] == -1 Then
{
tx =Text_New(sDate,sTime,up,"●");
Text_SetStyle(tx,1,1);
Text_SetColor(tx,Red);
}
if trend == -1 and trend[1] == 1 Then
{
tx =Text_New(sDate,sTime,dn,"●");
Text_SetStyle(tx,1,1);
Text_SetColor(tx,Blue);
}
2 10ema선을 고가,저가,종가을 기준으로 3개의 ema선을 만들고 싶습니다.
감사합니다
2024-10-29
598
글번호 184706
지표
답변완료
수식 부탁드려요~
1.목표
매수 = (predayhigh()+predaylow()+predayclose())/3 +predayhigh() - predaylow();
지지 = 2*((predayhigh()+predaylow()+predayclose())/3) - predayhigh();
목표 = 매수 +(매수- 지지);
valuewhen(1,목표,목표)
2. 매수
매수 = (predayhigh()+predaylow()+predayclose())/3 +predayhigh() - predaylow();
valuewhen(1,매수,매수)
3. 손절선
첫봉기준 = date!=date(1) && predayclose()*1.05;
중심선 = Valuewhen(1, 첫봉기준, (H+L)/1.96);
if(CountSince(첫봉기준, date!=date(1)) == 1, 중심선, 0)
안녕하세요
위의 키움 라인수식을
목표 > 매수 > 손절선 으로 라인의 순서가 되어있으면서
주가가 손절선 위에 있을때 ..
주가가 손절선 아래에 있는경우는 제외되는 종목식을 부탁드립니다.
2024-10-29
769
글번호 184705
종목검색
답변완료
하이킨아시
input : MaPeriod(2),MaPeriod2(1);
var : maOpen(0),maClose(0),maLow(0),maHigh(0);
var : haOpen(0),haClose(0),haLow(0),haHigh(0);
var : ExtMapBuffer1(0),ExtMapBuffer2(0),ExtMapBuffer3(0),ExtMapBuffer4(0);
var : ExtMapBuffer5(0),ExtMapBuffer6(0),ExtMapBuffer7(0),ExtMapBuffer8(0);
var : r(0),g(0),b(0), TL(0),t(0),tx(0);
if Index == 0 Then
{
maOpen=Open;
maClose=Close;
maLow=Low;
maHigh=High;
}
Else
{
maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod;
maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod;
maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod;
maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod;
haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2;
haClose=(maOpen+maHigh+maLow+maClose)/4;
haHigh=Max(maHigh, Max(haOpen, haClose));
haLow=Min(maLow, Min(haOpen, haClose));
if (haOpen<haClose) then
{
r=255;
g=10;
b=0;
ExtMapBuffer7=haLow;
ExtMapBuffer8=haHigh;
t = 1;
}
else
{
r=0;
g=191;
b=255;
ExtMapBuffer7=haHigh;
ExtMapBuffer8=haLow;
t = -1;
}
ExtMapBuffer5=haOpen;
ExtMapBuffer6=haClose;
ExtMapBuffer1=WMA(ExtMapBuffer7,MAperiod2);
ExtMapBuffer2=WMA(ExtMapBuffer8,MAperiod2);
ExtMapBuffer3=WMA(ExtMapBuffer5,MAperiod2);
ExtMapBuffer4=WMA(ExtMapBuffer6,MAperiod2);
}
분봉에 일봉값을 구하고 싶습니다.지난번 것은 어찌 해결 했는데 이건좀 안되네요 일이 많으신데 부탁합니다
2024-10-29
821
글번호 184703
지표