답변완료
지표와 시스템 매수타점 차이
안녕하세요.
당일 오전 고점과 당일 저점을 피보나치 비율로 분할 매수하는 수식을 작성하였으나, 매수 매도 타점이 지표상 타점과 상이하여 원인이 무엇인지 문의드립니다.
1) 지표와 시스템식의 주요 피보나치식은 동일하나, 첫 매매 이후 다른 타점에서 거래가 되는데 원인이 무엇인지 알려주시면 감사하겠습니다.
2) 추가적으로 피보나치 비율에 따라 물타기 후 반등하여 상단 피보나치 도달 시 전량 매도 혹은 손절하는 수식 작성하였는데, 맞게 작성했는지 검토해주시면 감사하겠습니다.
1. 지표식--------------------------------
input :Per1(76.4),Per2(61.8),Per3(50.0),Per4(38.2),Per5(23.6);
var : HH(0),LL(0),DD(0),TT(0);
Input: GrowthRate(0.15);
var: cnt(0),AvgDH(0),AvgDL(0),n(0),AL_Avg(0),AH(0);
LL= DayLow;
If H == DayHigh and sTime < 130000 Then
{
HH = H;
}
var1 = HH-(HH-LL)*(Per5/100);
var2 = HH-(HH-LL)*(Per4/100);
var3 = HH-(HH-LL)*(Per3/100);
var4 = HH-(HH-LL)*(Per2/100);
var5 = HH-(HH-LL)*(Per1/100);
plot1(HH,"최고");
plot2(var1,"76.4");
plot3(var2,"61.8");
plot4(var3,"50.0");
plot5(var4,"38.2");
plot6(var5,"23.6");
plot7(LL,"최저");
------------------------------------------
2. 시스템 식-------------------------------
#수수료율: 0.004%
#거래세: (매도시) 0.25%
input :Per1(76.4),Per2(61.8),Per3(50.0),Per4(38.2),Per5(23.6),Deposit(1000000),Rate(20);
var : HH(0),LL(0),DD(0),TT(0);
LL= DayLow;
If H == DayHigh and sTime < 130000 Then
{
HH = H;
}
var1 = HH-(HH-LL)*(Per5/100);
var2 = HH-(HH-LL)*(Per4/100);
var3 = HH-(HH-LL)*(Per3/100);
var4 = HH-(HH-LL)*(Per2/100);
var5 = HH-(HH-LL)*(Per1/100);
if MarketPosition == 0 and DayHigh >=DayClose(1)*(1+(rate/100)) Then
{
Buy("b1",AtLimit,var1,round((Deposit/var1)/6*1,0));
}
Else
if MarketPosition == 1 and LatestEntryName == "b1" Then
{
Buy("b2",AtLimit,var2,round((Deposit/var2)/6*2,0));
ExitLong("S1",Atlimit,var1*1.03);
}
Else
if MarketPosition == 1 and latestEntryName == "b2" Then
{
Buy("b3",AtLimit,Var3,round((Deposit/var3)/6*3,0));
ExitLong("S2",AtLimit,var1);
}
Else
if MarketPosition == 1 and latestEntryName == "b3"
Then
{
ExitLong("S3",AtLimit,AvgEntryPrice);
SetStopLoss(3,PercentStop);
}
2023-01-18
621
글번호 165547
시스템
답변완료
문의드립니다
수고가 많으십니다.
예스랭귀지 초보인지라 몇가지 문의를 드리고자 합니다.
1-1. 차트에 "수익 틱수" 표시
해외/국내선물 "틱"봉 기준 차트에서,
매수 또는 매도 신호가 발생된 종가를 기준으로,
다음 신호가 나올때까지
(예를들어 이번 신호가 "매수"신호일 경우 그 다음 매도 신호 발생때까지..
또는 "매도"신호 발생 후 그 다음 "매수신호발생때까지..)
캔들의 종가를 기준으로 10틱 단위로 "oo틱 수익" 이 나오게 하고 싶습니다.
단, 장의 흐름에 따라서,
봉의 길이가 짧은 경우에는.. 10틱 수익 → 20틱 수익 → 30틱 수익.. 등등 으로 표기 될수 있지만..
만일 장의 급등락 발생될 경우(장대 양봉/음봉이 발생될 경우)에는..
10틱 수익 → 30틱 수익 → 70틱 수익 이런식으로 유도리 있게 표기 될 수 있도록..
수식 작성이 가능할까요?
상기 "틱"봉 기준 차트에서의 수식 작성이 가능하다면..
"분"봉 기준 차트도 같은 수식을 사용해도 되는건가요?
1-2. "1-1"에서 캔들의 종가말고, 캔들이 만들어지는 과정에서,
매수의 경우에는 캔들의 고가, 매도의 경우에는 캔들의 저가를 표시할 수도 있는건가요?
가능하다면 수식 좀 부탁드리겠습니다.
2-1. "수익 틱수" 표기 위치 조정
"틱" 차트 또는 "분" 차트에서 나오는,
"oo틱 수익"의 글자위치(=발생위치)도 임의로 조절이 가능한건지요?
예를들면,
(1) "매수" 신호로 발생되는 "oo틱 수익"의 텍스트 위치는.. 캔들(봉) 위에
(2) "매도" 신호로 발생되는 "oo틱 수익"의 텍스트 위치는.. 캔들(봉) 아래에 표시
3. 홍콩 항셍지수의 경우, 새벽 03시 50분에 장마감이 되고,
오전 10시 15분에 개장이 되는데,
장 마감의 연속성을 단절하고, 오전 개장시간에 맞춰서 첫번째 (매수/매도) 신호를 내보내고자 합니다.
이러한 경우에는 수식을 어떻게 표현해야 되는건가요?
2-2. 아울러 항셍지수의 경우, 당일 시가는 전일 저녁장을 기준으로 자동으로 책정이 되는건지요?
당일 오전 10시 14분 시초가를 당일 시가로 표현하는 것도 가능한건가요?
2023-01-19
521
글번호 165543
시스템
답변완료
수식부탁드립니다
Input : Period(20), Period1(10), Period2(10);
var : StoK(0),StoD(0),tx1(0);
StoK = StochasticsK(Period,Period1);
StoD = StochasticsD(Period,Period1,Period2);
if crossup(stod,50) Then
Text_New(sdate,stime,H,"■");
if crossdown(stod,50) Then
Text_New(sdate,stime,H,"■");
위 식에서 crossup(stod,50)식의 ■은 빨간색 추가,
crossdown(stod,50)식의 ■은 녹색으로 표시가능할까요?
2023-01-18
600
글번호 165541
강조
답변완료
수식 부탁드립니다
수고 하십니다.
아래 지표의 30분 지표값을 5분봉 차트에 표시하고 싶습니다.
수고 하세요...
#######
input : start(0.02),increment(0.02),maximum(0.2);
var : haopen(0),haclose(0),hahigh(0),halow(0),hacolor(0);
var : af(0),trend_dir(0),ep(0),trend_bars(0),psar(0);
var : sar_long_to_short(False),sar_short_to_long(False),trend_change(False);
// Calculation HA Values
if index == 0 then
{
haOpen = open;
haClose = (O+H+L+C)/4;
haHigh = MaxList( high, haOpen, haClose);
haLow = MinList( low, haOpen,haClose);
}
else
{
haClose = (O+H+L+C)/4;
haOpen = (haOpen [1] + haClose [1])/2 ;
haHigh = MaxList(High, haOpen, haClose) ;
haLow = MinList(Low, haOpen, haClose) ;
}
// HA colors
hacolor = iff(haclose > haopen , green ,red);
psar = 0.0; // PSAR
af = 0.0; // Acceleration Factor
trend_dir = 0; // Current direction of PSAR
ep = 0.0; // Extreme point
trend_bars = 0;
sar_long_to_short = trend_dir[1] == 1 and haclose <= psar[1]; // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and haclose >= psar[1]; // PSAR switches from short to long
trend_change = IsNaN(psar[2]) == true or sar_long_to_short or sar_short_to_long;
// Calculate trend direction
trend_dir = iff(IsNaN(psar[2]) == true and haclose[1] > haopen[1] , 1 ,
IFf(IsNaN(psar[2]) == true and haclose[1] <= haopen[1] , -1 ,
iff(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 , trend_dir[1]))));
trend_bars = iff(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 ,
iff(trend_dir == 1 , trend_bars[1] + 1 ,
iff(trend_dir == -1 , trend_bars[1] - 1 ,trend_bars[1]))));
// Calculate Acceleration Factor
af = iff(trend_change , start ,
iff((trend_dir == 1 and hahigh > ep[1]) or (trend_dir == -1 and low < ep[1]) , min(maximum, af[1] + increment),af[1]));
// Calculate extreme point
ep = iff(trend_change and trend_dir == 1 , hahigh ,
iff(trend_change and trend_dir == -1 , halow ,
iff(trend_dir == 1 , max(ep[1], hahigh) ,min(ep[1], halow))));
// Calculate PSAR
psar = iff(IsNaN(psar[2]) == true and haclose[1] > haopen[1] , halow[1] ,
iff(IsNan(psar[2]) == true and haclose[1] <= haopen[1] , hahigh[1] ,
iff(trend_change , ep[1] ,
IFf(trend_dir == 1 , psar[1] + af * (ep - psar[1]) , psar[1] - af * (psar[1] - ep) ))));
input : 상승전환색(Black), 하락전환색(Black) ;
plot1(psar,"pSar",iff(trend_dir == 1 ,상승전환색,하락전환색));
2023-01-18
570
글번호 165540
지표