예스스탁
예스스탁 답변
2022-06-14 10:59:29
안녕하세요
예스스탁입니다.
input : amplitude(20);
var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0);
var : up(0),down(0);
var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0);
highPrice = Highest(H,amplitude);
lowPrice = Lowest(L,amplitude);
highma = ma(high, amplitude);
lowma = ma(low, amplitude);
if nextTrend == 1 Then
{
maxLowPrice = max(lowPrice, maxLowPrice);
if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then
{
trend = 1;
nextTrend = 0;
minHighPrice = highPrice;
}
}
else
{
minHighPrice = min(highPrice, minHighPrice);
if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then
{
trend = 0;
nextTrend = 1;
maxLowPrice = lowPrice;
}
}
if trend == 0 Then
{
if IsNaN(trend[1]) == False and trend[1] != 0 Then
{
up = iff(IsNaN(down[1]) == true,down,down[1]);
}
else
{
up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1]));
}
}
else
{
if isnan(trend[1]) == False and trend[1] != 1 Then
{
down = iff(IsNan(up[1]) == true, up , up[1]);
}
else
{
down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1]));
}
}
ht = iff(trend == 0 , up , down);
if trend == 0 Then
{
if trend != trend[1] Then
var1 = 0;
if L <= ht Then
{
var1 = var1+1;
if var1 ==1 Then
Buy();
}
}
if trend != 0 Then
{
if trend != trend[1] Then
var2 = 0;
if H >= ht Then
{
var2 = var2+1;
if var2 ==1 Then
Sell();
}
}
즐거운 하루되세요
> 당일선물 님이 쓴 글입니다.
> 제목 : 수식도움 부탁드립니다.
>
아래 지표수식에서
trend 가 down 에서 up 으로 전환후 "첫번째"로 저가가 ht 선 보다 작거나 같을때 매수
trend 가 up 에서 down 으로 전환후 "첫번째"로 고가가 ht 선 보다 크거나 같을때 매도
두번째 세번째는 신호발생 하지 않고 첫번째에만 신호가 발생하는 시스템 수식 부탁드립니다.
============
input : amplitude(20);
var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0);
var : up(0),down(0);
var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0);
highPrice = Highest(H,amplitude);
lowPrice = Lowest(L,amplitude);
highma = ma(high, amplitude);
lowma = ma(low, amplitude);
if nextTrend == 1 Then
{
maxLowPrice = max(lowPrice, maxLowPrice);
if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then
{
trend = 1;
nextTrend = 0;
minHighPrice = highPrice;
}
}
else
{
minHighPrice = min(highPrice, minHighPrice);
if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then
{
trend = 0;
nextTrend = 1;
maxLowPrice = lowPrice;
}
}
if trend == 0 Then
{
if IsNaN(trend[1]) == False and trend[1] != 0 Then
{
up = iff(IsNaN(down[1]) == true,down,down[1]);
}
else
{
up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1]));
}
}
else
{
if isnan(trend[1]) == False and trend[1] != 1 Then
{
down = iff(IsNan(up[1]) == true, up , up[1]);
}
else
{
down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1]));
}
}
ht = iff(trend == 0 , up , down);