답변완료
if조건식 가격조건유무
안녕하세요.
간단히 상향돌파하는 전략에서
if stime<특정시간 and crossup(c,ma(C,5)) then
buy("돌파매수",atmarket)
if stime<특정시간 then
buy("돌파매수",atstop, ma(C,5))
으로 하는경우 백테스트상 약간의 차이가 발생하는 걸 발견했습니다만, (후자가 진입이 좀더 늘어남)
상방돌파전략의 특성상, atstop으로 쓰는것이 더 맞을것 같기는 합니다만(가격조건만 만족되면 바로 주문나가므로...)
차이에 대해서 좀 설명부탁드립니다~
2022-06-08
1062
글번호 159687
시스템
답변완료
수식 문의
아래는 슈퍼 시그널 채널이라는 지표의 MQL5 수식입니다.
이 수식을 예트 수식으로 변환하고 싶습니다.
본 수식의 사용법에 대한 설명을 아래 링크에 첨부하였습니다.
여러 회원님들 도움 되시기 바랍니다.
부탁 드리겠습니다. 감사합니다.
//+------------------------------------------------------------------+
//| super-signals-channel.mq4 |
//| Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Nick Bilak"
#property link "http://www.forex-tsd.com/"
// hacked into a channel ind. by t_david sometime in early 2007
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_width1 1
#property indicator_color2 Lime
#property indicator_width2 1
#property indicator_color3 Red
#property indicator_width3 1
#property indicator_color4 Lime
#property indicator_width4 1
extern int SignalGap = 4;
extern int ShowBars = 50;
extern int BBPeriod=20;
int dist=24;
int Win = 0,Loss= 0;
double b1[];
double b2[];
double b3[];
double b4[];
int init() {
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1); //
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1); // cross
SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,1); // down arrow
SetIndexStyle(3,DRAW_ARROW,STYLE_SOLID,1); // up arrow
SetIndexBuffer(0,b1);
SetIndexBuffer(1,b2); //
SetIndexBuffer(2,b3); // Down arrow
SetIndexBuffer(3,b4); // Up arrow
SetIndexArrow(2,234); // Down arrow
SetIndexArrow(3,233); // Up arrow
return(0);
}
int start()
{
int hhb,llb, count;
for (count=0;count<500;count++)
{
b1[count]=0; b2[count]=0; b3[count]=0; b4[count]=0;
hhb = iHighest(Symbol(),0,MODE_HIGH,dist,count-dist/2);
llb = iLowest(Symbol(),0,MODE_LOW,dist,count-dist/2);
if ((count==hhb))
{
{
b3[count]= High[hhb]+SignalGap*Point;
if(((Open[count-1])) > ((Close[count-1]))) // GREEN Candlestick
{
Win++;
// Print("SUPER SIGNAL CHANNELWin::",Win);
}
else
{
Loss++;
// Print("SUPER SIGNAL CHANNEL Loss::",Loss);
}
}
}
if (count==llb)
{
{
b4[count]=Low[llb]-SignalGap*Point;
if(((Open[count-1]))< ((Close[count-1]))) // RED Candlestick
{
Win++;
Print("SUPER SIGNAL CHANNEL Win::",Win);
}
else
{
Loss++;
Print("SUPER SIGNAL CHANNEL Loss::",Loss);
}
}
}
b1[count]=High[hhb];//+SignalGap*Point; //draws horiz line for sale (RED)
b2[count]=Low[llb];//-SignalGap*Point; //draws horiz line for buy (GREEN)
}
return(0);
}
2022-06-08
1111
글번호 159684
지표
답변완료
수식 문의
아래는 Jurik Volatility Bands 라는 지표입니다.
아래 수식을 예트 수식으로 변환하고 싶습니다.
링크를 첨부 하였으니 한번 읽어보시고
여러 회원님들께도 도움되시기 바랍니다.
부탁 드리겠습니다. 감사합니다.
//PRC_Jurik Volatility Bands | indicator
//31.08.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4
//https://www.prorealcode.com/topic/jurik-volatility-bands/
//// --- settings
Length = 14
Shift = 0
ShowMiddle = 1
ZeroBind = 1
Normalize = 0
// --- end of settings
Price = customclose
if barindex>Length then
vprice = average[1](Price)[shift]
cprice = average[1](Price)
hprice = highest[length](vprice)
lprice = lowest[length](vprice)
len1 = Max(Log(Sqrt(0.5*(length-1)))/Log(2.0)+2.0,0)
pow1 = Max(len1-2.0,0.5)
del1 = hprice - bsmax[1]
del2 = lprice - bsmin[1]
volty = 0
if(Abs(del1) > Abs(del2)) then
volty = Abs(del1)
endif
if(Abs(del1) < Abs(del2)) then
volty = Abs(del2)
endif
vsum = vsum[1] + 0.1*(volty-volty[10])
avg = vsum
avgLen=65
for k=1 to avgLen-1 do
avg = avg+vsum[k]
next
avg = avg/k
avolty = avg
if avolty > 0 then
dVolty = volty/avolty
else
dVolty = 0
endif
if dVolty>exp((1/pow1)*log(len1)) then
dVolty=exp((1/pow1)*log(len1))
endif
if (dVolty < 1) then
dVolty = 1.0
endif
pow2 = exp(pow1*log(dVolty))
len2 = Sqrt(0.5*(length-1))*len1
Kv = exp(sqrt(pow2)*log(len2/(len2+1)))
if (del1 > 0) then
bsmax = hprice
else
bsmax = hprice - Kv*del1
endif
if (del2 < 0) then
bsmin = lprice
else
bsmin = lprice - Kv*del2
endif
dnValue = bsmin
upValue = bsmax
miValue = (upValue+dnValue)/2.0
////
if (ZeroBind) then
if (Normalize) then
upValues = 1
dnValues = -1
diff = (upValue-miValue)
if (diff <> 0) then
price = (cprice-miValue)/diff
else
price = 0
endif
else
upValues = upValue-miValue
dnValues = dnValue-miValue
price = (cprice-miValue)
endif
else
upValues = upValue
dnValues = dnValue
price = cprice
endif
if (ShowMiddle) then
if (ZeroBind) then
miValues = 0
else
miValues = miValue
endif
endif
endif
return upValues coloured(0,191,255) as "up value", dnValues coloured(219,112,147) as "dn value", miValues coloured(105,105,105) style(dottedline) as "mi value", price coloured(0,191,255) style(line,2) as "price"
2022-06-08
1131
글번호 159680
지표