답변완료
신호가 안나옵니다..
안녕하세요
항상 감사합니다.
아래와 같은 시스템을 구현하고자 하는데 신호가 나오지 않습니다
오류가 무엇일까요.
미리 감사합니다
Input : shortPeriod(12),longPeriod(26),Period(12);
Inputs: RSILength(14), OverSold(30), OverBought(70);
Var : value1(0),Value2(0), macdosc(0);
value1 = MACD(shortPeriod, longPeriod);
Value2 = ema(value1,Period);
macdosc = value1- Value2;
If Crossup(RSI(RSILength), OverSold) Then
if (marketposition <= 0) and
macdosc[3] < macdosc[2] and
macdosc[2] < macdosc[1] and
macdosc[1] < macdosc then
Buy ("MRL");
If CrossDown(RSI(RSILength), OverBought) Then
if (marketposition >=0) and
macdosc[3] > macdosc[2] and
macdosc[2] > macdosc[1] and
macdosc[1] > macdosc then
Sell ("MRS");
2025-02-06
469
글번호 187884
시스템
답변완료
도움 부탁드립니다
안녕하세요
늘 도움주셔서 감사합니다.
아래 수식좀 봐주세요
검증은 되는데 화면에는 나오지 않고 있습니다.
부탁드립니다.
Input : Length1(3),Length2(16),Length3(60);
Var : TLen1(0),TLen2(0),TLen3(0),Tma1(0),Tma2(0),Tma3(0);
TLen1 = Ceiling((Length1 + 1) * .5);
TLen2 = Ceiling((Length2 + 1) * .5);
TLen3 = Ceiling((Length3 + 1) * .5);
Tma1 = ma(ma(C, TLen1), TLen1);
Tma2 = ma(ma(C, TLen2), TLen2);
Tma3 = ma(ma(C, TLen3), TLen3);
if Tma1 > Tma1[1] Then
Tma1 = 1;
if Tma1< Tma1[1] Then
Tma1 = -1;
if Tma1== 1 and Tma1[1] != 1 Then
var1 = 0;
// if Tma1 == 1 and C > O and (C+O)/2 >= Tma1 and Tma2 > Tma2[1] and Tma3>Tma3 [1] Then{ 60이평포함
if Tma1 == 1 and C > O and (C+O)/2 >= Tma1 and Tma2 >Tma2 [1] and Tma1> Tma2 Then{
var1 = var1+1;
if var1 == 1 Then
buy("5매수");
}
if Tma1 == -1 and Tma1[1] != -1 Then
var2 = 0;
// if Tma1 == -1 and C < O and (C+O)/2 <= Tma1 and Tma2 < Tma2[1] and Tma3 < Tma3[1] Then{ 60이평포함
if Tma1 == -1 and C < O and (C+O)/2 <= Tma1 and Tma2 < Tma2[1] and Tma1 < Tma2 Then{
var2 = var2+1;
if var2 == 1 Then
sell("5매도");
}
2025-02-06
454
글번호 187882
시스템
답변완료
문의드립니다
수고 많으십니다
수식 문의드립니다.
[매수진입]
2개의 SMA가 정배열이고(20,40이평)
3개의 EMA가 정배열이고 양의 기울기를 가지고(15,25,35이평)
25EMA가 엔벨로프(23, 1퍼센트) 상단선보다 위에 위치하고
양봉의 종가가 엔벨로프 상단선 위에 위치할 때 매수 진입
(다만 캔들의 고저점 길이가 100틱 이상일 때는 진입 배제)
[매도진입]
2개의 SMA가 역배열이고(20,40이평)
3개의 EMA가 역배열이고 음의 기울기를 가지고(15,25,35이평)
25EMA가 엔벨로프(23, 1퍼센트) 하단선보다 아래에 위치하고
음봉의 종가가 엔벨로프 하단선 아래에 위치할 때 매도 진입
(다만 캔들의 고저점 길이가 100틱 이상일 때는 진입 배제)
[수익 청산_트레일링 스탑]
80틱 이상 수익시 진입가 기준 +11틱에 스탑로스
90틱 이상 수익시 진입가 기준 +22틱에 스탑로스
110틱 이상 수익시 진입가 기준 +33틱에 스탑로스
120틱 이상 수익시 진입가 기준 + 44틱에 스탑로스
250틱 이상 수익시 진입가 기준 + 55틱에 스탑로스
X틱 이상 수익시 진입가 기준 + Y틱에 스탑로스
... (위 같이 예시 만들어 주시면 추가적으로 만들어보겠습니다)
*다만 만약 스탑로스로 수익 청산 될 경우(미완선봉) 그 봉 완성시 매수, 매도 진입 금지(다음봉부터 다시 매수 OR 매도 진입 여부 결정)
[손절]
1)200틱
2)가격이 엔벨로프 상하단선 터치시(매수는 하단선 터치, 매도는 상단선 터치)
1),2)중 손실이 작은 값으로 손절
감사합니다
2025-02-06
405
글번호 187881
시스템
답변완료
수식 부탁 드립니다
#,안녕하세요
상기 그림파일 참조하여 우축 추세선 수식을 부탁드립니다.
*,당일(D)
1,첫시작 볼밴 상단밴드 최고점을 당일Y축까지 그리기
2,첫시작 볼밴 하단밴드 최저점을 당일Y축까지 그리기
*,전일(D-1)
3,첫시작 볼밴 상단밴드 최고점을 익일 Y축까지 그리기
4,첫시작 볼밴 하단밴드 최저점을 익일 Y축까지 그리기
(PS : D 와 D-1 의 추세선 생성 여부를 변수로 조절하면 좋겠습니다)
Input : Period(20), MultiD(2);
var : MAv(0),BBup(0),BBdn(0);
MAv = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
Plot1(MAv, "이평");
Plot2(BBup, "상단밴드");
Plot3(BBdn, "하단밴드");
$, 언제나 늘 고맙습니다.
2025-02-07
543
글번호 187880
지표
답변완료
사용자 함수를 사용하여 지표에 표현
1. _01_최저누적매수량_2025_CWY_v01.yfu
- 사용자 함수로 2400bar 기간동안 개인 최저 누적수량을 구하여
"기간최저보유수량_개인"을 구한다.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input : 최대기간(Numeric), 기간최저보유수량_개인(NumericRef) ;
var : 일순매수량_개인(0), 일누적매수량_개인(0), 최고보유수량_개인(0) ;
# 순매수수량 외부 참조 데이터 : 최대 2400 bar이하로 설정 ******************************
일순매수량_개인 = data2(C);
일누적매수량_개인 = 일누적매수량_개인 + 일순매수량_개인 ;
기간최저보유수량_개인 = min(기간최저보유수량_개인,일누적매수량_개인);
_01_최저누적매수량_2025_CWY_v01 = 1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. #01_01_개인누적지표.yin
- 2400bar동안 누적개인 보유수량이 -값이 나오지 않도록 사용자함수에서
구한 "기간최저보유수량_개인"의 값을 이용하여 최기 수량에 "최저수량보정_개인"으로
보정을 하여 누적을 하더라도 음수는 나오지 않게 하려고 합니다.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var : 최대기간(2400), 기간최저보유수량_개인(0) ;
var : 일순매수량_개인(0), 일누적매수량_개인(0), 최고보유수량_개인(0), 최저수량보정_개인(0) ;
_01_최저누적매수량_2025_CWY_v01(최대기간, 기간최저보유수량_개인);
# 순매수수량 외부 참조 데이터 : 최대 2400 bar이하로 설정 ******************************
일순매수량_개인 = data2(C);
일누적매수량_개인 = 일누적매수량_개인 + 일순매수량_개인 ;
If 기간최저보유수량_개인 < 0 Then
최저수량보정_개인 = - 기간최저보유수량_개인 ;
Else 최저수량보정_개인 = 0;
If Index == 0 Then
일누적매수량_개인 = 일순매수량_개인 + 최저수량보정_개인 ;
Else 일누적매수량_개인 = 일누적매수량_개인 + 일순매수량_개인 ;
Plot1(일순매수량_개인, "일순매수량_개인[일/화]", Rgb(000,100,000), Def, 1);
Plot2(일누적매수량_개인, "일누적매수량_개인[일/화]", Rgb(000,250,000), Def, 1);
Plot3(기간최저보유수량_개인, "기간최저보유수량_개인[일/화]", Rgb(000,000,250), Def, 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. 1의 마지막 값만 가져와 2.의 초기의 "최저수량보정_개인"에만 한번만 계산이 되어
적용이 되는 수식을 작성하고 싶은데 잘 되지 않습니다.
4. 가능하면 사용할 수 있도록 검토 부탁드립니다.
2025-02-06
441
글번호 187879
사용자 함수
답변완료
문의 드립니다
input : StartTime(80000),EndTime(60000),Xtime(60000);
var : Tcond(false),entry(0);
if sdate != sDate[1] Then
SetStopEndofday(Xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Inputs: VtyPercent(0.10),ATRperiod(1);
input : P1(1),P2(3);
var : m1(0),m2(0);
m1 = ma(C,P1);
m2 = ma(C,P2);
If MarketPosition() <> 1 and m1 > m2 Then
Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 and m1 > m2 Then
Buy ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 and m1 > m2 Then
Buy ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 and m1 > m2 Then
Buy ("Vty_LE4", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE4)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 and m1 > m2 Then
Buy ("Vty_LE5", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE5)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
하나의 캔들에 진입 청산후 또 동일조건이 왔을때 신호 허용이 가능하지요 ?
-----------------------------------------
input : StartTime(192000),EndTime(52000);
input : 익절틱수(0),손절틱수(0);
var : Tcond(False),entry(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
{
if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
ExitShort();
}
if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
ExitLong();
수식의 해석을 부탁드립니다.
2025-02-07
427
글번호 187877
시스템