예스스탁
예스스탁 답변
2024-11-20 10:57:17
안녕하세요
예스스탁입니다.
1
input : P(14);
var1 = RSI(P);
3번문의에 올리신 수식에 보시면 RSI의 기간은 설정에서 변경하기 위해 input으로 선언되어 있습니다.
수식에서 input으로 선언된 변수가 해당 창에 표시가 되고 값을 설정창에서 변경할 수 있습니다.
즉 수식에서 설정창에 나타나게 하시려면 input변수로 선언해서 대체하시면 됩니다.
2
아래 내용 참고하시기 바랍니다.
var : Grid(0);
if Index == 0 Then
{
Grid = Grid_New(7, 6, 3,White, Gray, 1, Gray, 0);
Grid_Cell(Grid,0,0,"종목명",0,0,BLACK,Green);
Grid_Cell(Grid,1,0,"현재가",0,0,BLACK,Green);
Grid_Cell(Grid,2,0,"전일대비",0,0,BLACK,Green);
Grid_Cell(Grid,3,0,"등락율",0,0,BLACK,Green);
Grid_Cell(Grid,4,0,"거래량",0,0,BLACK,Green);
Grid_Cell(Grid,5,0,"거래대금",0,0,BLACK,Green);
Grid_Cell(Grid,0,1,SymbolName,0,0,BLACK,White);
Grid_Cell(Grid,1,1,NumToStr(c,2),0,0,BLACK,White);
Grid_Cell(Grid,2,1,NumToStr(c-DayClose(1),2),0,0,BLACK,White);
Grid_Cell(Grid,3,1,NumToStr((c-DayClose(1))/DayClose(1)*100,2),0,0,BLACK,White);
Grid_Cell(Grid,4,1,NumToStr(v,0),0,0,BLACK,White);
Grid_Cell(Grid,5,1,NumToStr(m,0),0,0,BLACK,White);
Grid_CellSetWidth(Grid,0,0,20);
Grid_CellSetWidth(Grid,1,0,15);
Grid_CellSetWidth(Grid,2,0,15);
Grid_CellSetWidth(Grid,3,0,15);
Grid_CellSetWidth(Grid,4,0,15);
Grid_CellSetWidth(Grid,5,0,20);
Grid_CellSetTextVAlign(Grid,0,0,2);
Grid_CellSetTextVAlign(Grid,1,0,2);
Grid_CellSetTextVAlign(Grid,2,0,2);
Grid_CellSetTextVAlign(Grid,3,0,2);
Grid_CellSetTextVAlign(Grid,4,0,2);
Grid_CellSetTextVAlign(Grid,5,0,2);
Grid_CellSetTextVAlign(Grid,0,1,2);
Grid_CellSetTextVAlign(Grid,1,1,2);
Grid_CellSetTextVAlign(Grid,2,1,2);
Grid_CellSetTextVAlign(Grid,3,1,2);
Grid_CellSetTextVAlign(Grid,4,1,2);
Grid_CellSetTextVAlign(Grid,5,1,2);
Grid_CellSetTextHAlign(Grid,0,0,2);
Grid_CellSetTextHAlign(Grid,1,0,2);
Grid_CellSetTextHAlign(Grid,2,0,2);
Grid_CellSetTextHAlign(Grid,3,0,2);
Grid_CellSetTextHAlign(Grid,4,0,2);
Grid_CellSetTextHAlign(Grid,5,0,2);
Grid_CellSetTextHAlign(Grid,0,1,2);
Grid_CellSetTextHAlign(Grid,1,1,2);
Grid_CellSetTextHAlign(Grid,2,1,2);
Grid_CellSetTextHAlign(Grid,3,1,2);
Grid_CellSetTextHAlign(Grid,4,1,2);
Grid_CellSetTextHAlign(Grid,5,1,2);
Grid_CellSetTextColor(Grid,1,1,IFf(C>DayClose(1),Red,IFf(C<DayClose(1),Blue,Green)));
Grid_CellSetTextColor(Grid,2,1,IFf(C>DayClose(1),Red,IFf(C<DayClose(1),Blue,Green)));
Grid_CellSetTextColor(Grid,3,1,IFf(C>DayClose(1),Red,IFf(C<DayClose(1),Blue,Green)));
}
3
input : P(14);
input : length(20);
input : mult(2.0);
input : lengthKC(20);
input : multKC(1.5);
input : useTrueRange(true);#1:TrueRange 0:고저폭
var : source(0),basis(0),dev(0),upperbb(0),lowerbb(0);
var : mav(0),r(0),rangema(0),upperKC(0),lowerKC(0);
var : sqzOn(False),sqzOff(False),noSqz(False),val(0),bcolor(0),scolor(0);
var1 = RSI(P);
// Calculate BB
source = close;
basis = ma(source, length);
dev = multKC * std(source, length);
upperBB = basis + dev;
lowerBB = basis - dev;
// Calculate KC
mav = ma(source, lengthKC);
r = iff(useTrueRange == 1 , TrueRange , (high - low));
rangema = ma(r, lengthKC);
upperKC = mav + rangema * multKC;
lowerKC = mav - rangema * multKC;
sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC);
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC);
noSqz = (sqzOn == false) and (sqzOff == false);
val = LRL(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),ma(close,lengthKC)), lengthKC);
bcolor = iff( val > 0,
iff( val > iff(IsNan(val[1]),0,val[1]), lime, green),
iff( val < iff(IsNan(val[1]),0,val[1]), red, maroon));
scolor = iff(noSqz ,blue ,IFf( sqzOn , black , gray ));
if (bcolor == lime and scolor == Gray) or CrossUp(var1,30) Then
Buy("b");
if (bcolor == green and scolor == black) or CrossDown(var1,70) Then
ExitLong("bx");
즐거운 하루되세요
> 안산개미 님이 쓴 글입니다.
> 제목 : 수식및 표시방법좀 부탁드립니다.
> 매번 감사합니다.
아래 3가지 부분 부탁드립니다.
1.수식을 시스템 파일로 할때, 사진처럼 차트쉐어에서 전체공개시 사람들이 편의에 맞게 조
정해서 쓰게 하고자 합니다. 그림1 표시 나오는 수식?방법? 좀 알려주세요
2. 차트 하단에 종목 정보좀 나타나게하는 수식?방법? 좀 알려주세요(그림2 참조)
3. 마지막으로 시스템 파일 아래 수식은 rsi 조건만 인데, 만약 smi(Squeeze Momentum Indicator)를 조합해서 한다고 할때 buy 와 exitlong 수식에 2가지 조건(rsi, smi)표시하는 수식좀 만들어주세요
1.rsi
input : P(14);
var1 = RSI(P);
if CrossUp(var1,30) Then
Buy("매수");
if CrossDown(var1,70) Then
exitlong("매도");
2.smi(Squeeze Momentum Indicator)
input : length(20);
input : mult(2.0);
input : lengthKC(20);
input : multKC(1.5);
input : useTrueRange(true);#1:TrueRange 0:고저폭
var : source(0),basis(0),dev(0),upperbb(0),lowerbb(0);
var : mav(0),r(0),rangema(0),upperKC(0),lowerKC(0);
var : sqzOn(False),sqzOff(False),noSqz(False),val(0),bcolor(0),scolor(0);
// Calculate BB
source = close;
basis = ma(source, length);
dev = multKC * std(source, length);
upperBB = basis + dev;
lowerBB = basis - dev;
// Calculate KC
mav = ma(source, lengthKC);
r = iff(useTrueRange == 1 , TrueRange , (high - low));
rangema = ma(r, lengthKC);
upperKC = mav + rangema * multKC;
lowerKC = mav - rangema * multKC;
sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC);
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC);
noSqz = (sqzOn == false) and (sqzOff == false);
val = LRL(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),ma(close,lengthKC)), lengthKC);
bcolor = iff( val > 0,
iff( val > iff(IsNan(val[1]),0,val[1]), lime, green),
iff( val < iff(IsNan(val[1]),0,val[1]), red, maroon));
scolor = iff(noSqz ,blue ,IFf( sqzOn , black , gray ));
if bcolor == lime and scolor == Gray Then
Buy("b");
if bcolor == green and scolor == black Then
ExitLong("bx");
답변감사합니다만, 3개 문의사항중 2번째 문의답변에 대해 수식 적용해보니, 종목정보가 불일치 하는데요, 확인부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식및 표시방법좀 부탁드립니다.
> 안녕하세요
예스스탁입니다.
1
input : P(14);
var1 = RSI(P);
3번문의에 올리신 수식에 보시면 RSI의 기간은 설정에서 변경하기 위해 input으로 선언되어 있습니다.
수식에서 input으로 선언된 변수가 해당 창에 표시가 되고 값을 설정창에서 변경할 수 있습니다.
즉 수식에서 설정창에 나타나게 하시려면 input변수로 선언해서 대체하시면 됩니다.
2
아래 내용 참고하시기 바랍니다.
var : Grid(0);
if Index == 0 Then
{
Grid = Grid_New(7, 6, 3,White, Gray, 1, Gray, 0);
Grid_Cell(Grid,0,0,"종목명",0,0,BLACK,Green);
Grid_Cell(Grid,1,0,"현재가",0,0,BLACK,Green);
Grid_Cell(Grid,2,0,"전일대비",0,0,BLACK,Green);
Grid_Cell(Grid,3,0,"등락율",0,0,BLACK,Green);
Grid_Cell(Grid,4,0,"거래량",0,0,BLACK,Green);
Grid_Cell(Grid,5,0,"거래대금",0,0,BLACK,Green);
Grid_Cell(Grid,0,1,SymbolName,0,0,BLACK,White);
Grid_Cell(Grid,1,1,NumToStr(c,2),0,0,BLACK,White);
Grid_Cell(Grid,2,1,NumToStr(c-DayClose(1),2),0,0,BLACK,White);
Grid_Cell(Grid,3,1,NumToStr((c-DayClose(1))/DayClose(1)*100,2),0,0,BLACK,White);
Grid_Cell(Grid,4,1,NumToStr(v,0),0,0,BLACK,White);
Grid_Cell(Grid,5,1,NumToStr(m,0),0,0,BLACK,White);
Grid_CellSetWidth(Grid,0,0,20);
Grid_CellSetWidth(Grid,1,0,15);
Grid_CellSetWidth(Grid,2,0,15);
Grid_CellSetWidth(Grid,3,0,15);
Grid_CellSetWidth(Grid,4,0,15);
Grid_CellSetWidth(Grid,5,0,20);
Grid_CellSetTextVAlign(Grid,0,0,2);
Grid_CellSetTextVAlign(Grid,1,0,2);
Grid_CellSetTextVAlign(Grid,2,0,2);
Grid_CellSetTextVAlign(Grid,3,0,2);
Grid_CellSetTextVAlign(Grid,4,0,2);
Grid_CellSetTextVAlign(Grid,5,0,2);
Grid_CellSetTextVAlign(Grid,0,1,2);
Grid_CellSetTextVAlign(Grid,1,1,2);
Grid_CellSetTextVAlign(Grid,2,1,2);
Grid_CellSetTextVAlign(Grid,3,1,2);
Grid_CellSetTextVAlign(Grid,4,1,2);
Grid_CellSetTextVAlign(Grid,5,1,2);
Grid_CellSetTextHAlign(Grid,0,0,2);
Grid_CellSetTextHAlign(Grid,1,0,2);
Grid_CellSetTextHAlign(Grid,2,0,2);
Grid_CellSetTextHAlign(Grid,3,0,2);
Grid_CellSetTextHAlign(Grid,4,0,2);
Grid_CellSetTextHAlign(Grid,5,0,2);
Grid_CellSetTextHAlign(Grid,0,1,2);
Grid_CellSetTextHAlign(Grid,1,1,2);
Grid_CellSetTextHAlign(Grid,2,1,2);
Grid_CellSetTextHAlign(Grid,3,1,2);
Grid_CellSetTextHAlign(Grid,4,1,2);
Grid_CellSetTextHAlign(Grid,5,1,2);
Grid_CellSetTextColor(Grid,1,1,IFf(C>DayClose(1),Red,IFf(C<DayClose(1),Blue,Green)));
Grid_CellSetTextColor(Grid,2,1,IFf(C>DayClose(1),Red,IFf(C<DayClose(1),Blue,Green)));
Grid_CellSetTextColor(Grid,3,1,IFf(C>DayClose(1),Red,IFf(C<DayClose(1),Blue,Green)));
}
3
input : P(14);
input : length(20);
input : mult(2.0);
input : lengthKC(20);
input : multKC(1.5);
input : useTrueRange(true);#1:TrueRange 0:고저폭
var : source(0),basis(0),dev(0),upperbb(0),lowerbb(0);
var : mav(0),r(0),rangema(0),upperKC(0),lowerKC(0);
var : sqzOn(False),sqzOff(False),noSqz(False),val(0),bcolor(0),scolor(0);
var1 = RSI(P);
// Calculate BB
source = close;
basis = ma(source, length);
dev = multKC * std(source, length);
upperBB = basis + dev;
lowerBB = basis - dev;
// Calculate KC
mav = ma(source, lengthKC);
r = iff(useTrueRange == 1 , TrueRange , (high - low));
rangema = ma(r, lengthKC);
upperKC = mav + rangema * multKC;
lowerKC = mav - rangema * multKC;
sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC);
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC);
noSqz = (sqzOn == false) and (sqzOff == false);
val = LRL(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),ma(close,lengthKC)), lengthKC);
bcolor = iff( val > 0,
iff( val > iff(IsNan(val[1]),0,val[1]), lime, green),
iff( val < iff(IsNan(val[1]),0,val[1]), red, maroon));
scolor = iff(noSqz ,blue ,IFf( sqzOn , black , gray ));
if (bcolor == lime and scolor == Gray) or CrossUp(var1,30) Then
Buy("b");
if (bcolor == green and scolor == black) or CrossDown(var1,70) Then
ExitLong("bx");
즐거운 하루되세요
> 안산개미 님이 쓴 글입니다.
> 제목 : 수식및 표시방법좀 부탁드립니다.
> 매번 감사합니다.
아래 3가지 부분 부탁드립니다.
1.수식을 시스템 파일로 할때, 사진처럼 차트쉐어에서 전체공개시 사람들이 편의에 맞게 조
정해서 쓰게 하고자 합니다. 그림1 표시 나오는 수식?방법? 좀 알려주세요
2. 차트 하단에 종목 정보좀 나타나게하는 수식?방법? 좀 알려주세요(그림2 참조)
3. 마지막으로 시스템 파일 아래 수식은 rsi 조건만 인데, 만약 smi(Squeeze Momentum Indicator)를 조합해서 한다고 할때 buy 와 exitlong 수식에 2가지 조건(rsi, smi)표시하는 수식좀 만들어주세요
1.rsi
input : P(14);
var1 = RSI(P);
if CrossUp(var1,30) Then
Buy("매수");
if CrossDown(var1,70) Then
exitlong("매도");
2.smi(Squeeze Momentum Indicator)
input : length(20);
input : mult(2.0);
input : lengthKC(20);
input : multKC(1.5);
input : useTrueRange(true);#1:TrueRange 0:고저폭
var : source(0),basis(0),dev(0),upperbb(0),lowerbb(0);
var : mav(0),r(0),rangema(0),upperKC(0),lowerKC(0);
var : sqzOn(False),sqzOff(False),noSqz(False),val(0),bcolor(0),scolor(0);
// Calculate BB
source = close;
basis = ma(source, length);
dev = multKC * std(source, length);
upperBB = basis + dev;
lowerBB = basis - dev;
// Calculate KC
mav = ma(source, lengthKC);
r = iff(useTrueRange == 1 , TrueRange , (high - low));
rangema = ma(r, lengthKC);
upperKC = mav + rangema * multKC;
lowerKC = mav - rangema * multKC;
sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC);
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC);
noSqz = (sqzOn == false) and (sqzOff == false);
val = LRL(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),ma(close,lengthKC)), lengthKC);
bcolor = iff( val > 0,
iff( val > iff(IsNan(val[1]),0,val[1]), lime, green),
iff( val < iff(IsNan(val[1]),0,val[1]), red, maroon));
scolor = iff(noSqz ,blue ,IFf( sqzOn , black , gray ));
if bcolor == lime and scolor == Gray Then
Buy("b");
if bcolor == green and scolor == black Then
ExitLong("bx");