커뮤니티
글번호 228232 문의입니다
안녕하세요 .
답변 2번 을 시스템(전략)으로 만들어 주시면 감사하겠습니다. 아래 -- shortSignal 의 정의가 있어야 될것 같긴한대데요.....
2
input : emaFastLen(8);
input : emaSlowLen(21);
input : atrPeriod(7);
input : atrMult(1.8);
input : squeezeLen(20);
input : showVWAP(true);
var : Emafast(0),Emaslow(0),Golden(False),death(False);
var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C);
emaFast = ema(close, emaFastLen);
emaSlow = ema(close, emaSlowLen);
golden = CrossUp(emaFast, emaSlow);
death = CrossDown(emaFast, emaSlow);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / atrperiod ;
ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,atrperiod) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1]));
upperBand = src + atrMult * AtrV;
lowerBand = src - atrMult * AtrV;
if lowerBand > lowerBand[1] or close[1] < lowerBand[1] Then
lowerBand = lowerBand;
Else
lowerBand = lowerBand[1];
if upperBand < upperBand[1] or close[1] > upperBand[1] Then
upperBand = upperBand;
Else
upperBand = upperBand[1];
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
}
var : basis_sqz(0),dev_sqz(0),kcUpper(0),kcLower(0);
var : squeezeOn(False),squeezeOff(False),mom(0),momCol(0),volSurge(False);
basis_sqz = ma(close, squeezeLen);
dev_sqz = std(close, squeezeLen);
kcUpper = basis_sqz + 1.5 * dev_sqz;
kcLower = basis_sqz - 1.5 * dev_sqz;
squeezeOn = (kcLower > supertrend) or (kcUpper < supertrend);
squeezeOff = squeezeOn == False;
mom = close - (basis_sqz + kcUpper + kcLower) / 2;
momCol = iff(mom > 0 , IFF(mom > mom[1], lime , green) , IFf(mom < mom[1], red , maroon));
volSurge = volume > ma(volume, 20) * 2;
var : hlc3(0),sum1(0),sum2(0),aboveVWAP(False),vwapVal(0),longSignal(False);
hlc3 = (h+l+c)/3;
if Bdate != Bdate[1] Then
{
sum1 = 0;
sum2 = 0;
}
sum1 = sum1 + (hlc3*v);
sum2 = sum2 + v;
vwapVal = sum1/sum2;
aboveVWAP = close > vwapVal;
longSignal = golden and direction < 0 and squeezeOff and volSurge and aboveVWAP;
if longSignal == true Then
Find(1);
답변 1
예스스탁 예스스탁 답변
2025-11-24 13:16:04