답변완료
수정 의뢰 드립니다!
안녕하세요!
아래는 어제 만들어 주신 지표인데 빠트린 부분이 있어서 제가 직접 한번 만들어 보았는데
데이터가 안불러와지는 걸 확인했습니다.
1. 제가 원하는건 data1 = 콜427 현재가 라고 가정 했을때
data2 = 풋430 현재가 / data3 = 풋427 현재가 / data4 = 풋425 현재가 입니다.
즉, 수식조건은 = (data1 현재가+ data2 현재가 / 2) ,
(data1 현재가+ data3 현재가 / 2) ,
(data1 현재가+ data4 현재가 / 2)
이렇게 3종류선 + 시가 + 전일 고가와 저가, 당일 상대등가격의 고가와 저가를 선으로 나타내고 싶습니다.
2. 그리고 챠트에 어제 날짜의 선들도 계속 화면에 나타나서 복잡한데, 당일의 선들만
화면에 표시 되면 매매에 많은 도움이 될것 같습니다!
수정 좀 부탁드립니다!
var : cnt(0,Data1);
var : v1(0,Data1),v2(0,Data1),v3(0,Data1),v4(0,Data1);
var : tl1(0,Data1),tl2(0,Data1),tl3(0,Data1),tl4(0,Data1);
var : tx1(0,Data1),tx2(0,Data1),tx3(0,Data1),tx4(0,Data1);
#(Data1+Data2)/2;
v1 = (Data1(c)+Data2(c))/2;
#(Data1+Data3)/2;
v2 = (Data1(c)+Data3(c))/2;
#(Data1+Data4)/2;
v3 = (Data1(c)+Data4(c))/2;
#(Data1+Data4)/2;
v4 = (Data1(c)+Data5(c))/2;
For cnt = 0 to 10
{
Text_Delete(tx1[cnt]);
Text_Delete(tx2[cnt]);
Text_Delete(tx3[cnt]);
Text_Delete(tx4[cnt]);
TL_Delete(tl1[cnt]);
TL_Delete(tl2[cnt]);
TL_Delete(tl3[cnt]);
TL_Delete(tl4[cnt]);
}
tx1 = Text_New(NextBarSdate,NextBarStime,v1,NumToStr(v1,2));
tx2 = Text_New(NextBarSdate,NextBarStime,v2,NumToStr(v2,2));
tx3 = Text_New(NextBarSdate,NextBarStime,v3,NumToStr(v3,2));
tx4 = Text_New(NextBarSdate,NextBarStime,v4,NumToStr(v4,2));
tl1 = TL_New(sDate,sTime,v1,NextBarSdate,NextBarStime,v1);
tl2 = TL_New(sDate,sTime,v2,NextBarSdate,NextBarStime,v2);
tl3 = TL_New(sDate,sTime,v3,NextBarSdate,NextBarStime,v3);
tl4 = TL_New(sDate,sTime,v4,NextBarSdate,NextBarStime,v4);
TL_SetColor(tl1,BLACK);#콜427+ 풋430/2
TL_SetColor(tl2,BLUE);#콜427+풋427/2 중심가
TL_SetColor(tl3,BLACK);#콜427+풋425/2
TL_SetColor(tl4,BLACK);##콜427+풋432/2
TL_SetExtLeft(TL1,true);
TL_SetExtLeft(TL2,true);
TL_SetExtLeft(TL3,true);
TL_SetExtLeft(TL4,true);
TL_SetExtRight(TL1,true);
TL_SetExtRight(TL2,true);
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
Plot1(DayOpen);
plot2(data3(highd(1)));//타종목의 전일 고가
plot3(data3(LowD(1)));//타종목의 전일 저가
Plot4((DayHigh+DayLow)/2);
Plot5(DayHigh(1));
Plot6(DayLow(1));
2021-04-23
1116
글번호 148307
지표
답변완료
수식어 부탁드립니다
input : StartTime(140000),EndTime(055000),xtime(055500);
Input : Period(20);
Input : 당일수익틱수(120);
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;
}
value = VR(Period);
var1 = ma(C,5);
var2 = ma(C,200);
If CrossUP(value, 100) and Xcond == False Then
{
Buy("b");
}
If CrossDown(value, 300) and Xcond == False Then
{
Sell("s");
}
if marketposition == 1 then
{
if isentryname("b") == true and crossdown(var1,var2) then
sell("bs");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
}
if marketposition == -1 then
{
if isentryname("s") == true and crossup(var1,var2) then
buy("sb");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
}
------------------------------------------
아래는 위수식어 하단의 특정시간 매매수익에 관한것 입니다
if marketposition == 1 then
{
if isentryname("b") == true and crossdown(var1,var2) then
sell("bs");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
}
if marketposition == -1 then
{
if isentryname("s") == true and crossup(var1,var2) then
buy("sb");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
}
위의 수식어의 시간을 14시부터 19시까지 그리고 수익은 20틱 손실은 20틱으로 변경하고자 합니다
2021-04-23
1006
글번호 148298
시스템
답변완료
시스템 수식으로 자동매매실현 하고자 합니다
안녕하세요 사장님~!!!
오랫만이군요~아래 내용을 만족할 수 있는 수식을 부탁드려요
매수매도 진입시점에서 몇틱수익인지 숫자도 출현시켜 주세요
1.10이평선돌파신호 and
2.macd 기준선 상향돌파 and
3.stochastic 상향돌파
4.이평선이격도 수렴상태에서 신호 발생 시켜주세요
----------------(수식)
1)매수신호
Crossup(C ,avg(C, Period))
and
(StochasticsSlow(Period1,Period2)-
eavg(StochasticsSlow(Period1,Period2),Period3))>=0
and
(MACD(shortPeriod,longPeriod)-eavg(MACD(shortPeriod,longPeriod),sigPeriod))<=0
2)매도신호
Crossdown(C ,avg(C, Period))
and
(StochasticsSlow(Period1,Period2)-
eavg(StochasticsSlow(Period1,Period2),Period3))<=0
and
(MACD(shortPeriod,longPeriod)-eavg(MACD(shortPeriod,longPeriod),sigPeriod))>=0
여기까지하고 ----이평선 이격도 수렴수식과 진입시 수익틱 숫자표시하는것은
수식을 만들어야 합니다
수고하십시요---항상 감사합니다
2021-04-23
1721
글번호 148297
시스템
답변완료
수식 의뢰 부탁드립니다.
안녕하세요
1. 아래 수식에서 3연속 손실이 발생할 경우 N분 매매정지를 할 수 있도록 수정 부탁드립니다
2. 그리고 매매가 끝나면 지정한 시간만큼 매매중지되어야 하는데 위 그림처럼 포지션 청산되자마자 다시 진입과 청산이 이루어집니다
항상 감사합니다
input : N(4),익절(0.03),손절(0),진입(10),StartTime(070000),EndTime(070000),매매정지(20),lb(0),lp(2),sb(0),sp(-2);
var : LL(0),HH(0),tx1(0),tx2(0),cnt(0),Tx3(0),sum(0),CL(0),CS(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 IsExitName("xl",1) == true or IsExitName("xs",1) == true or IsExitName("stopprofittarget",1) == true then
Condition4 = true;
}
b_vv = vv[4]+vv[3]+vv[2]+vv[1];
최고점 = highest(h,진입);
최저점 = lowest(l,진입);
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 and C < LL Then
ExitLong("xl");
if MarketPosition(0) < 0 and C > HH Then
ExitShort("xs");
#타겟청산
SetStopProfittarget(익절,pointstop);
SetStopLoss( 손절 ,PointStop);
2021-04-22
917
글번호 148294
시스템