답변완료
검토 수정 의뢰
수고 하시네요 !
Input : Period1(1), Period2(5), Period3(30), Period4(60), Period5(120),period6(240), Period7(480), Period8(960),period9(1920);
var : sma1(0),sma2(0),sma3(0),sma4(0),sma5(0),sma6(0),sma7(0),sma8(0),sma9(0);
sma1 = ma(C,period1);
sma2 = ma(C,period2);
sma3 = ma(C,period3);
sma4 = ma(C,period4);
sma5 = ma(C,period5);
sma6 = ma(C,period6);
sma7 = ma(C,period7);
sma8 = ma(C,period8);
sma9 = ma(C,period9);
var : t(0),s(0);
var1 = ma(C,1);
Var2 = ma(C,5);
if CrossDown(var1,Var2) Then
{
t = -1;
s = c;
}
if CrossUp(var1,Var2) Then
{
t = 1;
s = c;
}
if t == -1 Then
Buy("b",AtLimit,S-PriceScale*15);
if t == 1 Then
Sell("s",AtLimit,S+PriceScale*15);
if MarketPosition == 1 Then
{
if IsEntryName("b") == true Then
sell("bs",AtStop,EntryPrice-PriceScale*4);
if MarketPosition == 1 and CrossUp(sma7,sma8) Then
ExitShort("-");
}
if MarketPosition == -1 Then
{
if IsEntryName("s") == true Then
Buy("sb",AtStop,EntryPrice+PriceScale*4);
}
매매 반대방향 으로 갈때 4틱손절 후 반대 매매 가 잘 되다가 중간 에
한번씩 수식대로 안되네요 (원인 이 어디 있을까요 ? 잘 하다가 한번 에 큰 손실 을
보니 꼭 해결 을 부탁 드립니다 * 매수 를 했는데 10 틱 이상 하락 하면 청산 과 매도
를 체결 , 매도 를 했는데 10 틱 이상 상승 하면 청산 과 매수 체결 이 반드시 이루어
지게 부탁 드립니다) 그리고 청산 수식 을 넣었는데 실행 이 안되네요
검토 수정 부탁드립니다.
*** 수고 하세요 ***
2021-04-27
648
글번호 148403
시스템
답변완료
확인 좀 부탁드립니다!
수식을 만들어 보았는데 일봉, 분봉, 틱봉에서 선이 전부 나타나지 않는게 있네요!
뭐가 문제인지 잘 모르겠습니다! T T
Plot1 (dayopen,"시가");
Plot2 (dayopen(1),"전일시가");
Plot3 ((dayopen(1)+DayOpen)/2,"시가마디");
Plot4 (DayOpen -(dayopen(1)+DayOpen/2),"시가상방마디");
Plot5 (DayOpen +((dayopen(1)+DayOpen)/2),"시가하방마디");
Plot6 ((DayClose(1)+DayOpen(0))/2,"시가종가마디");
Plot7 (((DayClose(1)+DayOpen(0))/2)+DayOpen,"시가종가상방마디");
Plot8 (DayOpen(0)-((DayClose(1)+DayOpen(0))/2),"시가종가하방마디");
Plot9 (DayClose(1),"전일종가");
2021-04-26
771
글번호 148397
지표
답변완료
수식변환 부탁합니다.
키움에서 사용하던수식 두가지 검색할수 있도록 변환 부탁합니다.
첫번째 수식
A=BBandsUP(20,2);
B=Sar(0.02,0.2);
D=disparity(10);
E=avg(c,224);
F=MACD(12,26);
G=eavg(F,9);
crossup(C,A)
and
crossup(C,B)
and
crossup(F,G)
and
D>=95
and
(crossup(C,avg(c,114))
or
crossup(C,E)
or
Crossup(C, avg(c,448)))
두번째 수식
A=stochasticsslow(10,5);
B=stochasticsslow(20,9);
E= (highest(high,9)+lowest(low,9)+highest(high,26)+lowest(low,26))/4;
F= (highest(high,52)+lowest(low,52))/2;
crossup(A(B),15)
and
(CrossUp(C, E(25)) and CrossUp(C, F(25)))
and
Crossup(c,(highestsince(1,crossup(trix(period),0),c)+lowestsince(1,crossdown(trix(period),0),c))/2 )
and
CrossUp(StochasticsSlow(5,3),eavg(StochasticsSlow(5,3),3))
2021-04-26
1032
글번호 148392
종목검색
답변완료
수식어 부탁드립니다
input : StartTime(150000),EndTime(055000),xtime(055500);
INPUTS: R(4), S(8), U(6), ZEROLINE(0), SMTHLEN(10);
var : Truestrength(0),Truestrengthsig(0);
Input : 당일수익틱수(200);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
Var : value(0),Tcond(false);
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);
Xcond = false;
N1 = NetProfit;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true ) then
Xcond = true;
}
Truestrength = TSI(C, R, S, U);
Truestrengthsig = Ema(TSI(C, R, S, U), SMTHLEN);
if crossup(Truestrength,Truestrengthsig) and Truestrength < 0 Then
buy();
if CrossDown(Truestrength,Truestrengthsig) and Truestrength > 0 Then
sell();
;
------------------------------
True Strength Index 지표를 이용한 수식어 변경입니다.
True Strength Index의 cross down 신호시 10분 이후 5,10선 1차 dead cross에서 진입하고
True Strength Index의 cross up 신호시 10분 이후 5,10선 1차 golden cross에서 sell청산하는
수식어와 그 반대되는 buy신호후 청산하는 수식어도 같이 부탁 드립니다.
2021-04-26
972
글번호 148374
시스템
답변완료
수식 수정 부탁드립니다
안녕하세요
아래 수식에 다음과 같은 내용을 추가부탁드립니다
1. 매수청산 후 매매정지, 매수조건이 다시 만족하면 매매
(sum이 '0' -> '+2'가 다시 될 때 매수해야하지만 현재 청산이후 연속 매수와 청산을 반복)
매도청산 후 매매정지, 매도조건이 다시 만족하면 매매
(sum이 '-2' -> '-2'가 다시 될 때 매도해야 하지만 현재 청산이후 연속 매도와 청산을 반복)
2. 3회 로스컷 후 매매정지, 다시 한번 손실나면 또 매매정지되는 문제점 해소
3회 로스컷 후 매매정지, 이후 손실 카운팅을 다시 시작으로 개선
항상 감사드립니다
--------------------
input : N(4),익절(0.03),손절(0),StartTime(070000),EndTime(070000),매매정지(20),lb(0),lp(2),sb(-2),sp(-2);
var : LL(0),HH(0),cnt(0),sum(0),CL(0),CS(0),Lss(0);
Array : VV[20](0);
var : Tcond(false),S1(0),D1(0),TM(0),b_vv(0),Condition4(False),최고점(0),최저점(0);
Condition1 = L[4]>L[3] and L[3] >L[2] and H>H[1] and H[1]>H[2];
Condition2 = H[4]<H[3] and H[3]<H[2] and L<L[1] and L[1]<L[2];
if ( ( var2 == 0 and C > CS and vv[0] == -1 ) or LL == 0 or C > CL ) and condition1 == true and Condition1[1] == False Then
{
var1 = var1+1;
LL = L[2];
CL = C;
VV[0] = 1;
For cnt = 1 to 19
{
VV[cnt] = VV[cnt-1][1];
}
if VV[N-1] != 0 Then
{
sum = 0;
For cnt = 0 to N-1
{
sum = sum + VV[cnt];
}
}
}
else
{
if L < LL Then
{
var1 = 0;
}
}
if (( var1 == 0 and C < CL and vv[0] ==1) or hh == 0 or C < CS) and condition2 == true and Condition2[1] == False Then
{
var2 = var2+1;
HH = H[2];
CS = C;
VV[0] = -1;
For cnt = 1 to 19
{
VV[cnt] = VV[cnt-1][1];
}
if VV[N-1] != 0 Then
{
sum = 0;
For cnt = 0 to N-1
{
sum = sum + VV[cnt];
}
}
}
Else
{
if H > HH Then
{
var2 = 0;
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
Condition4 = False;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
}
if TotalTrades > TotalTrades[1] Then
{
Condition4 = False;
if PositionProfit(1) < 0 Then
Lss = Lss+1;
Else
Lss= 0;
if lss == 3 Then
Condition4 = true;
}
b_vv = vv[4]+vv[3]+vv[2]+vv[1];
if (sTime > starttime or sTime < Endtime) and marketposition == 0 Then
{
if (b_vv == lb and sum == lp) Then
{
if condition4 == False Then
Buy("b");
if (condition4 == true and TM >= TM[BarsSinceExit(1)]+매매정지) Then
Buy("b1");
}
if (b_vv == sb and sum == sp) Then
{
if condition4 == False Then
Sell("s");
if (condition4 == true and TM >= TM[BarsSinceExit(1)]+매매정지) Then
Sell("s1");
}
}
if MarketPosition(0) > 0 Then
ExitLong("xl",atstop,ll);
if MarketPosition(0) < 0 Then
ExitShort("xs",atstop,hh);
#타겟청산
SetStopProfittarget(익절,pointstop);
SetStopLoss( 손절 ,PointStop);
2021-04-26
1037
글번호 148373
시스템
답변완료
문의 드립니다
input : StartTime(220000),EndTime(055000),진입횟수(10),익절틱수(100),손절틱수(30);
var : Tcond(false),entry(0);
if StartTime < EndTime Then
{
SetStopEndofday(EndTime);
}
Else
{
if sDate != sDate[1] Then
SetStopEndofday(EndTime);
}
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
{
if StartTime > EndTime Then
SetStopEndofday(0);
Tcond = true;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if MarketPosition == 0 and C > O and entry < 진입횟수 Then
{
Buy("b");
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
----------------------
sell 진입후 청산이 포함된 수식어를 부탁드립니다.
---------------------------------
sell만 별도로 진입후 청산의 수식어도 부탁드립니다.
미리 감사드립니다.
2021-04-26
801
글번호 148370
시스템