예스스탁
예스스탁 답변
2025-09-17 12:52:15.0
> as8282 님이 쓴 글입니다.
> 제목 : 부탁합니다.
> 아래 지표로 시스템식을 부탁합니다.
기본사항
: 투자금액을 100% 로 잡았을때 30%를 3회까지 분할매수
( 예: 1천만원일때 1회 3백만원씩 신호나올때마다 3회까지 매수 )
매수
1. 밴드의 중심선이 상승일때 and
2. 저점이 밴드 하단밖에 있을때 양봉이면 매수
청산
1. 시가가 밴드안에서 시작해서 양봉으로 상단밴드밖에서 종가일때 or
2. 익절 1% ~ (변수로 부탁합니다) or
3. 종가기준 3% 손절 ( 변수로 부탁합니다.) or
4. 매수후 중심선이 하락으로 바뀌면 본절청산
input : HalfLength(60);
input : PriceType(5);#1: Close, 2:Open, 3:High, 4:Low, 5:Median, 6:Typical, 7:Weighted, 8:Average
input : AtrPeriod(60);
input : AtrMultiplier(4);
input : TMAangle(2);
input : crossUpInput(false);
input : crossDownInput(false);
input : comingBackInput(false);
input : onArrowDownInput(false);
input : onArrowUpInput(false);
input : colorDOWN(red);
input : colorUP(green);
input : colorBands(Gray);
input : cautionInput(true);
Array : TX1[100](0),TX2[100](0),TX3[100](0);
var : cnt(0),price(0),colorBuffer(Nan);
var : asum(0),ATR(0),i(0),j(0);
var : sum(0),sumw(0),k(0),tmac(0),tmau(0),tmad(0);
var : pastTmac(nan),pastTmau(nan),pastTmad(Nan);
var : tmau_temp(nan),tmac_temp(Nan),tmad_temp(nan);
var : point(0),reboundD(0),reboundU(0),caution(0),last(False);
For cnt = 0 to 99
{
Text_Delete(TX1[cnt]);
Text_Delete(TX2[cnt]);
Text_Delete(TX3[cnt]);
}
if PriceType == 1 Then
Price = close;
Else if PriceType == 2 Then
Price = open;
Else if PriceType == 3 Then
Price = high;
Else if PriceType == 4 Then
Price = low;
Else if PriceType == 5 Then
Price = (high + low) / 2;
Else if PriceType == 6 Then
Price = (high + low + close) / 3;
Else if PriceType == 7 Then
Price = (high + low + close + close) / 4;
Else
Price = (high + low + close + open)/ 4;
//MAIN
for i = HalfLength downto 0
{
//ATR
asum = 0.0;
for j = 0 to AtrPeriod - 1
{
asum = asum + max(high[i + j + 10], close[i + j + 11]) - min(low[i + j + 10], close[i + j + 11]);
}
atr = asum/AtrPeriod;
//BANDS
sum = (HalfLength + 1) * Price[i];
sumw = (HalfLength + 1);
k = HalfLength;
for j = 1 to HalfLength
{
sum = sum + k * Price[i + j];
sumw = sumw + k;
if (j <= i) Then
{
sum = sum + k * Price[i - j];
sumw = sumw + k;
}
k = k -1;
}
tmac = sum/sumw;
tmau = tmac+AtrMultiplier*atr;
tmad = tmac-AtrMultiplier*atr;
//CHANGE TREND COLOR
if pastTmac != 0.0 Then
{
if tmac > pastTmac Then
colorBuffer = colorUP;
if tmac < pastTmac then
colorBuffer = colorDOWN;
}
//SIGNALS
reboundD = 0.0;
reboundU = 0.0;
caution = 0.0;
if pastTmac != 0.0 Then
{
if (high[i + 1] > pastTmau and close[i + 1] > open[i + 1] and close[i] < open[i]) Then
{
reboundD = high[i] + AtrMultiplier * atr / 2;
if (tmac - pastTmac > TMAangle * point) Then
{
caution = reboundD + 10 * point;
}
}
if (low[i + 1] < pastTmad and close[i + 1] < open[i + 1] and close[i] > open[i]) Then
{
reboundU = low[i] - AtrMultiplier * atr / 2;
if (pastTmac - tmac > TMAangle * point) then
{
caution = reboundU - 10 * point;
}
}
}
//LAST REAL
if i == HalfLength Then
{
last = true;
tmau_temp = tmau;
tmac_temp = tmac;
tmad_temp = tmad;
}
//DRAW HANDICAPPED BANDS
if i < HalfLength Then
{
TX1[i] = Text_New(NextBarSdate[i],NextBarStime[i],Tmau,"-");
Text_SetColor(TX1[i],colorBands);
Text_SetStyle(TX1[i],2,2);
TX2[i] = Text_New(NextBarSdate[i],NextBarStime[i],Tmac,"-");
Text_SetColor(TX2[i],colorBuffer);
Text_SetStyle(TX2[i],2,2);
TX3[i] = Text_New(NextBarSdate[i],NextBarStime[i],Tmad,"-");
Text_SetColor(TX3[i],colorBands);
Text_SetStyle(TX3[i],2,2);
}
}
//DRAW REAL BANDS
plot1(iff(last , tmau_temp , tmau), "TMA Up", colorBands);
plot2(iff(last , tmac_temp , tmac), "TMA Mid", colorBuffer);
plot3(iff(last , tmad_temp , tmad), "TMA Down", colorBands);
FixPlotShift(1,-HalfLength);
FixPlotShift(2,-HalfLength);
FixPlotShift(3,-HalfLength);