답변완료
예스트레이더 수식으로 전환 문의드립니다.
study("T3 MTF", overlay=true)
res = input(title="Time Frame", type=resolution, defval="D")
T3FiboLine = input(false, title="Show T3 Fibonacci Ratio Line?")
length1 = input(8, "T3 Length")
a1 = input(0.7, "Volume Factor")
e1=ema((high + low + 2*close)/4, length1)
e2=ema(e1,length1)
e3=ema(e2,length1)
e4=ema(e3,length1)
e5=ema(e4,length1)
e6=ema(e5,length1)
c1=-a1*a1*a1
c2=3*a1*a1+3*a1*a1*a1
c3=-6*a1*a1-3*a1-3*a1*a1*a1
c4=1+3*a1+a1*a1*a1+3*a1*a1
T3=c1*e6+c2*e5+c3*e4+c4*e3
T3k = security(tickerid, res, T3)
plot(T3k, color=red, linewidth=3, title="T3")
length12 = input(5, "T3 Length fibo")
a12 = input(0.618, "Volume Factor fibo")
e12=ema((high + low + 2*close)/4, length12)
e22=ema(e12,length12)
e32=ema(e22,length12)
e42=ema(e32,length12)
e52=ema(e42,length12)
e62=ema(e52,length12)
c12=-a12*a12*a12
c22=3*a12*a12+3*a12*a12*a12
c32=-6*a12*a12-3*a12-3*a12*a12*a12
c42=1+3*a12+a12*a12*a12+3*a12*a12
T32=c12*e62+c22*e52+c32*e42+c42*e32
T32k = security(tickerid, res, T32)
plot(T3FiboLine and T32k ? T32k : na, color=blue, linewidth=2, title="T3fibo")
multi timeframe으로 가능할지 문의드립니다.
좋은 하루되세요
감사합니다.
2020-01-29
239
글번호 135461
지표
답변완료
시스템식 부탁드립니다.
항상 도움 주셔서 감사합니다.
아래의 Easy Language Code 코드를 예스랭귀지로 변환 부탁드립니다.
감사합니다.
#----------------
# 요청 시스템1
#----------------
Inputs:
TradeUnit(100),
Band1(0), // Should be between 0 and 1
Band2(0), // Should be between 0 and 1
ExitBand(0); // Should be between 0 and .5
Variables:
Support(0), Resistance(0);
If CurrentBar = 1 then Begin
Support = C;
Resistance = C;
End;
If time >= 930 and time <= 1000 then begin
If Close > Resistance then begin
Resistance = Close;
End;
If Close < Support then begin
Support = Close;
End;
End;
#-----------
If time > 1000 and time < 1500 then begin
#-----------
{ Long Entry }
If Close <= (Resistance + Band1) and Close >= (Resistance - Band2) and Close > Close[1] and marketposition = 0 then begin
Buy TradeUnit shares next bar market;
End;
{ Long Exit }
If marketposition = 1 and marketposition = marketposition(1) then begin
Sell TradeUnit shares next bar at (Close - ExitBand) stop;
End;
{ Long Money Management }
If marketposition = 1 and (Close - EntryPrice)*TradeUnit <= -75 then begin
Sell TradeUnit shares next bar market;
End;
{ Short Entry }
If Close <= (Support + Band2) and Close >= (Support - Band1) and Close < Close[1] and marketposition = 0 then begin
Sell short TradeUnit shares next bar market;
End;
{ Short Exit }
If marketposition = -1 and marketposition = marketposition(1) then begin
Buy to cover TradeUnit shares next bar at (Close + ExitBand) stop;
End;
{ Short Money Management }
If marketposition = -1 and (EntryPrice - Close)*TradeUnit <= -75 then begin
Buy to Cover TradeUnit shares next bar market;
End;
#-----------
End;
#-----------
If time >= 1530 then begin
If marketposition = 1 then begin
Sell TradeUnit shares next bar market;
End;
If marketposition = -1 then begin
Buy to Cover TradeUnit shares next bar market;
End;
End;
#----------------
# 요청 시스템2
# Long-Only Strategy
#----------------
Input:
InitialBalance(100000), // The account size at start of trading
NDay(20) // How many days long is this systems basis (20 or 55 day) ;
Variables:
N(0), // Underlying volatility of the stock
DPP(Close), // Dollar per price of the stock
StopLoss(0), // Stop loss value
DollarRisk(0), // Dollar risk value T
radeUnit(100), // How much to trade based on idea that 1N
represents 1% of account equity
UnitsHeld(0), // How many units are currently held NotationalAccount(10000), // Notational Account, hard coded for testing purposes LastAccount(0), // Last account size to reevaluate drawdown Stop_On(False), // Stop loss boolean
Fast_Ave ( 0 ) , // Fast moving average value
Slow_Ave ( 0 ) , // Slow moving average value
Cross_Over (False); // Simple cross-over filter ;
{ Set-up }
Cross_Over = False;
Fast_Ave = Xaverage ( Close , 50 ) ;
Slow_Ave = Xaverage ( Close , 200 ) ;
If Fast_Ave > Slow_Ave and Slow_Ave > Slow_Ave [ 1 ] Then
Cross_Over = True;
{ Position Sizing }
N = VolatilityStdDev(NDay);
DPP = Close; // Price of the stock is equal to its close
DollarRisk = NotationalAccount * 0.01;
TradeUnit = IntPortion(DollarRisk/(N*DPP));
StopLoss = 2 * N;
// Decrease the size of the notational account if 10% drawdown
If NotationalAccount < (LastAccount * 0.9) Then Begin
NotationalAccount = NotationalAccount * 0.8;
Print(File("c: urtle_notational.txt"), NotationalAccount);
End
Else Begin
LastAccount = NotationalAccount;
End;
{ Entry }
// Do not even consider a trade if too many units are on the line
If UnitsHeld < 12 then Begin
// Enter if price exceeds by a single tick high of the preceding NDays)
If Close > HighD(NDay) and Cross_Over then Begin
If marketposition = 0 then begin
Buy ("Long") TradeUnit shares next bar market;
UnitsHeld = UnitsHeld + TradeUnit;
End;
If marketposition = 1 then begin
Buy ("Long more") (TradeUnit / 2) shares next bar market;
UnitsHeld = UnitsHeld + (TradeUnit / 2);
End;
End;
End;
{ Stop }
if ( Close - EntryPrice ) > StopLoss then begin
Stop_On = True;
End
Else begin
Stop_On = False;
End;
{ Exit}
If Close < LowD(NDay/2) and Stop_On then begin
Sell ("Long Exit") currentshares shares next bar market;
UnitsHeld = 0;
End;
#----------------
# 요청 시스템2
# Long-Only Strategy
#----------------
Input:
InitialBalance(100000), // The account size at start of trading
NDay(20) // How many days long is this systems basis (20 or 55 day) ;
Variables:
N(0), // Underlying volatility of the stock
DPP(Close), // Dollar per price of the stock
StopLoss(0), // Stop loss value
DollarRisk(0), // Dollar risk value
TradeUnit(100), // How much to trade based on idea that 1N represents 1% of account equity
UnitsHeld(0), // How many units are currently held NotationalAccount(10000), // Notational Account, hard coded for testing purposes LastAccount(0), // Last account size to reevaluate drawdown Stop_On(False), // Stop loss boolean
Fast_Ave ( 0 ) , // Fast moving average value
Slow_Ave ( 0 ) , // Slow moving average value
Cross_Over (False); // Simple cross-over filter ;
{ Set-up }
Cross_Over = False;
Fast_Ave = Xaverage ( Close , 50 ) ;
Slow_Ave = Xaverage ( Close , 200 ) ;
If Fast_Ave < Slow_Ave and Slow_Ave < Slow_Ave [ 1 ] Then
Cross_Over = True;
{ Position Sizing }
N = VolatilityStdDev(NDay);
DPP = Close; // Price of the stock is equal to its close
DollarRisk = NotationalAccount * 0.01;
TradeUnit = IntPortion(DollarRisk/(N*DPP));
StopLoss = 2 * N;
// Decrease the size of the notational account if 10% drawdown
If NotationalAccount < (LastAccount * 0.9) Then Begin
NotationalAccount = NotationalAccount * 0.8;
Print(File("c: urtle_short_notational.txt"), NotationalAccount);
End
Else Begin
LastAccount = NotationalAccount;
End;
{ Entry }
// Do not even consider a trade if too many units are on the line
#*
If UnitsHeld < 12 then Begin
#*
// Enter if price exceeds by a single tick high of the preceding NDays)
If Close < LowD(NDay) and Cross_Over then Begin
SellShort ("Short") N shares next bar market;
UnitsHeld = UnitsHeld + TradeUnit;
End;
If marketposition = -1 then begin
SellShort ("Short more") (N / 2) shares next bar market;
UnitsHeld = UnitsHeld + (TradeUnit / 2);
End;
End;
#*
End;
#*
{ Stop }
if ( Close - EntryPrice ) < StopLoss then begin
Stop_On = True;
End
Else begin
Stop_On = False;
End;
{ Exit}
If Close > HighD(NDay/2) and Stop_On then begin
BuyToCover ("Short Exit") currentshares shares next bar market;
UnitsHeld = 0;
End;
2020-01-28
353
글번호 135453
시스템
답변완료
지표 수정 부탁드립니다.
틱봉에서 N분봉으로 변환 후 N분간 고/저점을 나타내는 수식을
이전에 부탁드려 받은 적이 있습니다.
현재 봉이 고가나 저가를 갱신하면 해당 지표의 고/저점도 같이 갱신되므로
사용하지 못하고 있습니다.
1봉 전의 N분간 고/저점을 나타내고 싶은데 수식을 봐도 어디에
[1]을 넣어야 할지 몰라 이렇게 문의 드립니다.
수정 부탁드립니다.
감사합니다.
아래는 이전에 받았던 수식 입니다.
input : n(3),CC(10),CF(3),Per1(25),Per2(50),Per3(75);
input : 굵기1(1),굵기2(1),굵기3(1),굵기4(1),굵기5(1),굵기6(1);
input : 색상1(RED),색상2(MAGENTA),색상3(GREEN),색상4(CYAN),색상5(BLUE),색상6(BLACK);
var : TF(0),S1(0),D1(0),TM(0),cnt(0),T1(0),HH(0),LL(0),ii(0),TT(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0);
var : O1(0),H1(0),L1(0),C1(0),sum(0),mav(0),VD(0),VT(0),VM(0),VP(0);
Array : V1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
TT = stime;
ii = 0;
}
Else
ii = ii+1;
if D1 > 0 then
{
#영업일변경 기준으로 경과된 분
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
//n분 미만
if TM < n then
{
//당일최고와 최저가를 기준으로 선 출력
hh = DayHigh;
ll = daylow;
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL1 = TL_New(D1,TT,HH,Sdate,stime,HH);
TL2 = TL_New(D1,TT,HH-(HH-LL)*0.25,Sdate,stime,HH-(HH-LL)*(Per1/100));
TL3 = TL_New(D1,TT,HH-(HH-LL)*0.50,Sdate,stime,HH-(HH-LL)*(Per2/100));
TL4 = TL_New(D1,TT,HH-(HH-LL)*0.75,Sdate,stime,HH-(HH-LL)*(Per3/100));
TL5 = TL_New(D1,TT,LL,Sdate,stime,LL);
}
else //분이상 경과
{
//최근 n분 이내에서 최고가와 최저가 계산해서 선 출력
HH = H;
LL = L;
for cnt = 0 to ii
{
if TM[cnt] > TM-N then
{
if H[cnt] > HH Then
HH = H[cnt];
if L[cnt] < LL Then
LL = L[cnt];
TT = stime[cnt];
}
if TM[cnt] < TM-N Then
cnt = ii+1;
}
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL1 = TL_New(D1,TT,HH,Sdate,stime,HH);
TL2 = TL_New(D1,TT,HH-(HH-LL)*0.25,Sdate,stime,HH-(HH-LL)*(Per1/100));
TL3 = TL_New(D1,TT,HH-(HH-LL)*0.50,Sdate,stime,HH-(HH-LL)*(Per2/100));
TL4 = TL_New(D1,TT,HH-(HH-LL)*0.75,Sdate,stime,HH-(HH-LL)*(Per3/100));
TL5 = TL_New(D1,TT,LL,Sdate,stime,LL);
}
TL_SetColor(TL1,RED);
TL_SetColor(TL2,MAGENTA);
TL_SetColor(TL3,GREEN);
TL_SetColor(TL4,CYAN);
TL_SetColor(TL5,BLUE);
TL_SetSize(TL1, 굵기1);
TL_SetSize(TL2, 굵기2);
TL_SetSize(TL3, 굵기3);
TL_SetSize(TL4, 굵기4);
TL_SetSize(TL5, 굵기5);
#1분봉 기준(시,고,저,종,거래량 계산)
if bdate != bdate[1] or (Bdate == bdate[1] and TM > TM[1]) Then
{
O1 = O;
H1 = H;
L1 = L;
V1[0] = 0 ;
for cnt = 1 to 99
{
V1[cnt] = v1[cnt-1][1];
}
}
if H > H1 Then
H1 = H;
if L < L1 Then
L1 = L;
C1 = C;
V1[0] = V1[0]+V;
TL_Delete(TL6);
if V1[cc] > 0 then
{
sum = 0;
for cnt = 1 to CC
{
sum = sum + V1[cnt];
}
mav = sum/CC;
//최근 1분거래량이 이전 cc봉 평균대비 CF배 이상이면
if V1[0] >= mav*CF Then
{
//날짜,시간,TM값, 평균값 저장
VD = sdate;
VT = stime;
VM = TM;
VP = (O1+H1+L1+C1)/4;
}
//오늘 거래량조건이 발생한적 있고 현재부터 20분 이내이면 출력
if VD == sdate and VM > TM-n Then
{
TL6 = TL_new(D1,TT,VP,Sdate,stime,VP);
TL_SetColor(TL6,BLACK);
TL_SetSize(TL6,굵기6);
}
}
}
2020-01-28
213
글번호 135434
지표