답변완료
수정좀요청 드립니다.
* 좋은 하루 되십시요
* 아래 수식 실행 하면 사진 처럼나오는데 제가 뭘 잘못 한거죠?
지도좀 부탁 드립니다,
## 아래 수식
input : i_lenHARSI(14),i_smoothing(7),i_lenRSI(7);
var : i_colUp(0),i_colDown(0),i_colWick(0),i_source(0);
var : _closeRSI(0),_openRSI(0),_highRSI_raw(0),_lowRSI_raw(0);
var : _highRSI(0),_lowRSI(0),_close(0),_open(0),_high(0),_low(0);
Var : cnt(0), DownAmt1(0), UpAmt1(0), UpSum1(0), DownSum1(0), UpAvg1(0), DownAvg1(0),RSIV1(0);
Var : DownAmt2(0), UpAmt2(0), UpSum2(0), DownSum2(0), UpAvg2(0), DownAvg2(0),RSIV2(0);
var : bodyColour(0),wickColour(0);
i_colUp = red;
i_colDown = teal;
i_colWick = gray;
i_source = (o+h+l+c)/4;
_closeRSI = rsi(i_lenHARSI)-50;
_openRSI = IFF(IsNaN(_closeRSI[1]) == False, _closeRSI[1], _closeRSI);
If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin
UpSum1 = 0;
DownSum1 = 0;
For cnt = 0 To i_lenHARSI - 1 Begin
UpAmt1 = H[cnt] - H[cnt+1];
If UpAmt1 >= 0 Then
DownAmt1 = 0;
Else Begin
DownAmt1 = -UpAmt1;
UpAmt1 = 0;
End;
UpSum1 = UpSum1 + UpAmt1;
DownSum1 = DownSum1 + DownAmt1;
End;
UpAvg1 = UpSum1 / i_lenHARSI;
DownAvg1 = DownSum1 / i_lenHARSI;
End
Else
If CurrentBar > 1 AND i_lenHARSI > 0 Then Begin
UpAmt1 = H[0] - H[1];
If UpAmt1 >= 0 Then
DownAmt1 = 0;
Else Begin
DownAmt1 = -UpAmt1;
UpAmt1 = 0;
End;
UpAvg1 = (UpAvg1[1] * (i_lenHARSI - 1) + UpAmt1) / i_lenHARSI;
DownAvg1 = (DownAvg1[1] * (i_lenHARSI - 1) + DownAmt1) / i_lenHARSI;
End;
If UpAvg1 + DownAvg1 <> 0 Then
RSIV1 = 100 * UpAvg1 / (UpAvg1 + DownAvg1);
Else
RSIV1 = 0;
If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin
UpSum2 = 0;
DownSum2 = 0;
For cnt = 0 To i_lenHARSI - 1 Begin
UpAmt2 = L[cnt] - L[cnt+1];
If UpAmt2 >= 0 Then
DownAmt2 = 0;
Else Begin
DownAmt2 = -UpAmt2;
UpAmt2 = 0;
End;
UpSum2 = UpSum2 + UpAmt2;
DownSum2 = DownSum2 + DownAmt2;
End;
UpAvg2 = UpSum2 / i_lenHARSI;
DownAvg2 = DownSum2 / i_lenHARSI;
End
Else
If CurrentBar > 2 AND i_lenHARSI > 0 Then Begin
UpAmt2 = L[0] - L[1];
If UpAmt2 >= 0 Then
DownAmt2 = 0;
Else Begin
DownAmt2 = -UpAmt2;
UpAmt2 = 0;
End;
UpAvg2 = (UpAvg2[1] * (i_lenHARSI - 1) + UpAmt2) / i_lenHARSI;
DownAvg2 = (DownAvg2[1] * (i_lenHARSI - 1) + DownAmt2) / i_lenHARSI;
End;
If UpAvg2 + DownAvg2 <> 0 Then
RSIV2 = 100 * UpAvg2 / (UpAvg2 + DownAvg2);
Else
RSIV2 = 0;
_highRSI_raw = RSIV1-50;
_lowRSI_raw = RSIV2-50;
_highRSI = max(_highRSI_raw, _lowRSI_raw);
_lowRSI = min(_highRSI_raw, _lowRSI_raw);
_close = (_openRSI + _highRSI + _lowRSI + _closeRSI) / 4;
_open = iff(isnan(_open[i_smoothing]) == true, (_openRSI + _closeRSI) / 2 , (_open[1] * i_smoothing + _close[1]) / (i_smoothing + 1));
_high = max(_highRSI, max(_open, _close));
_low = min(_lowRSI, min(_open, _close));
bodyColour = iff(_close > _open , i_colUp , i_colDown);
wickColour = i_colWick;
var1 = TL_New_Self(sDate,sTime,_open,sDate,sTime,_close);
var2 = TL_New_Self(sDate,sTime,_high,sDate,sTime,max(_open,_close));
var3 = TL_New_Self(sDate,sTime,_Low,sDate,sTime,min(_open,_close));
TL_SetColor(var1,bodyColour);
TL_SetColor(var2,i_colWick);
TL_SetColor(var2,i_colWick);
TL_SetSize(var1,3);
TL_SetSize(var2,1);
TL_SetSize(var3,1);
고맙습니다.
.
2025-02-19
385
글번호 188313
지표
답변완료
문의 드립니다
안녕하세요
input : Periods(10);
input : Multiplier(3.0);
input : changeATR(1);#1:SMA 0:RMA
input : upcolor(Red),downcolor(Blue);
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,"Trend",upcolor);
Else
Plot1(dn,"Trend",downcolor);
위 트랜드 라인을 다른변수로 2개 더 추가하고 싶습니다
부탁드립니다
감사합니다
2025-02-19
490
글번호 188312
지표
답변완료
질문드리겠습니다
안녕하세요 질문 몇가지 드리겠습니다
질문1)
아래와 같이 종목검색 수식을 작성했는데요
일봉상에서 당일부터 5봉 전까지 하루라도 H>L*1.08 일 경우 검색하는 내용입니다
만약 10봉전까지를 작성하고자 한다면 반복문을 이용해서 단순화 시켜서 만들 수 있을까요?
IF H>L*1.08 or H[1]>L[1]*1.08 or
H[2]>L[2]*1.08 or H[3]>L[3]*1.08
or H[4]>L[4]*1.08 or H[5]>L[5]*1.08
Then Find(1);
질문2,3)
아래 식은 조건이 발생하면 당일 한번만 (최초로 만족한 신호만) 나타나게 하는 식인데요
두 가지 경우의 질문이 있습니다
질문1)
당일 3번째 조건 만족 신호까지만(최초,2번째,3번째) 나타나게 하려면 어떻게 수정을 해야할까요?
질문2)
당일 1번째(최초 만족) 과 3번째만 나타내게 하고 싶습니다 (2번째는 건너뛰기)
아래는 수식입니다
감사합니다
var : cnt(0), sum1(0), sumi1(0),tt(0),hh(0),ll(0),tl(0);
var: sum2(0),sumi2(0),sumaa(0);
var : t(0),StartBarIndex(0),dd(0),d1(0),d2(0);
Array : ii[50](0),aa[50](0),bb[50](0),ttl[10](0);
if Bdate != Bdate[1] Then
DD = DD+1;
if h>vi(1)*0.98 Then
{
d1 = dd;
d2 = d1[1];
if d1 >= d2+1 Then
{
var1 = Index;
Var2 = var1[1];
Var3= Var2[1];
sum1=0;
sumi1=0;
tl=TL_NEW(sDatE,sTimE,h*1.01,sDatE,sTimE,99999);
TL_SetSize(tl,0);
For cnt = 1 to (var1-Var2)
{
sum1=sum1+h[cnt];
sumi1=sumi1+1;
}
value1=sum1/sumi1;
2025-02-19
436
글번호 188311
지표
답변완료
수식 부탁드립니다
input을 각각 100, 200, 300 세가지로 만들고, 100 이 200, 300 을 돌파할 때 마다 1계약씩 추가 진입하는 식을 부탁드립니다.
input : len(100),len2(100);
var : oo(0),cc(0),hh(0),ll(0),col(0);
var : haclose(0),haopen(0),hahigh(0),halow(0);
var : o2(0),h2(0),l2(0),c2(0);
oo=ema(open,len);
cc=ema(close,len);
hh=ema(high,len);
ll=ema(low,len);
haclose = (oo+hh+ll+cc)/4;
haopen = iff(IsNaN(haopen[1]) == true, (oo + cc)/2 , (haopen[1] + haclose[1]) / 2);
hahigh = max (hh, max(haopen,haclose));
halow = min (ll, min(haopen,haclose));
o2=ema(haopen, len2);
c2=ema(haclose, len2);
h2=ema(hahigh, len2);
l2=ema(halow, len2);
if crossup(c2, o2) Then
Buy("");
if crossdown(c2, o2) Then
Sell("");
2025-02-19
383
글번호 188309
시스템
답변완료
수식문의드립니다.
안녕하세요,
아래 분할청산식인데 trx3이 마지막 분할청산 96봉이후에 주문이 들어가게 하고 싶습니다.
BarsSinceExit(1) > 96을 썼는데 안먹힙니다.
뭐가 잘못됐는지 모르겠는데 수정 부탁드립니다.
input : txratio(0.3),txa(3),txam(5),txb(8),txn(2);
var : trXcond1(false),trXcond2(false),trXcond3(false);
if MarketPosition == 1 Then
{
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "trx1" Then
trXcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "trx2" Then
trXcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "trx3" Then
trXcond3 = true;
var1 = highest(H,BarsSinceEntry);
if trXcond1 == false and var1 >= EntryPrice*(txa/100+1) and var1 < EntryPrice*(((txa+txam)/100)+1) Then {
ExitLong("trx1",AtStop,var1*(1-txn/100),"",currentContracts*txratio,1);
}
if trXcond2 == false and var1 >= EntryPrice*(txb/100+1) and var1 < EntryPrice*(((txb+txam)/100)+1) Then
ExitLong("trx2",AtStop,var1*(1-txn/100),"",currentContracts*txratio,1);
if (BarsSinceExit(1) > 96) and trXcond3 == false and var1 >= EntryPrice*(txa/100+1) and var1 < EntryPrice*(((txa+txam)/100)+1) Then {
ExitLong("trx3",AtStop,var1*(1-(txn+1)/100),"",currentContracts*txratio,1);
}
}
if MarketPosition != 1 Then
{
trXcond1 = false;
trXcond2 = false;
trXcond3 = false;
}
2025-02-18
358
글번호 188305
시스템