예스스탁
예스스탁 답변
2025-02-21 13:22:36
안녕하세요
예스스탁입니다.
input : Periods(10);
input : Multiplier(3.0);
input : changeATR(1);#1:SMA 0:RMA
input : upcolor(Red),downcolor(Blue);
var : src(0),alpha(0),source(0),ATR1(0),ATR2(0),ATRV(0);
var : up(0),up1(0),dn(0),dn1(0),trend(0),tx(0);
src = (H+L)/2;
alpha = 1 / Periods;
atr1 = IFf(IsNan(atr1[1]) == true , ma(TrueRange, Periods) , alpha * TrueRange + (1 - alpha) * atr1[1]);
atr2 = ATR(Periods);
atrv = IFf(changeATR == 1 , atr1 , atr2);
up=src-(Multiplier*atrv);
up1 = IFf(IsNan(up[1]) == False,up[1],up);
up = iff(close[1] > up1 , max(up,up1) , up);
dn=src+(Multiplier*atrv);
dn1 = IFf(IsNan(dn[1]) == False,dn[1], dn);
dn = iff(close[1] < dn1 , min(dn, dn1) , dn);
trend = 1;
trend = IFf(IsNan(trend[1]) == False,trend[1], trend);
trend = IFf(trend == -1 and close > dn1 , 1 , iff(trend == 1 and close < up1 , -1 , trend));
if trend == 1 and trend != trend[1] Then
Buy();
if trend == -1 and trend != trend[1] Then
Sell();
input : 틱단위(10),글자크기(9);
var : pp(0),ll(0),Txx(0);
if MarketPosition == 1 Then
{
pp = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*틱단위));
if pp > pp[1] Then
{
Txx = Text_New(sdate,stime,H+PriceScale*3,NumToStr(pp*틱단위,0)+"틱");
Text_SetStyle(Txx,2,1);
Text_SetSize(Txx,글자크기);
}
}
if MarketPosition == -1 Then
{
pp = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*틱단위));
if pp > pp[1] Then
{
Txx = Text_New(sdate,stime,L-PriceScale*3,NumToStr(pp*틱단위,0)+"틱");
Text_SetStyle(Txx,2,0);
Text_SetSize(Txx,글자크기);
}
}
즐거운 하루되세요
> 만강 님이 쓴 글입니다.
> 제목 : 문의 드립니다
>
안녕하세요
input : Periods(10);
input : Multiplier(3.0);
input : changeATR(1);#1:SMA 0:RMA
input : upcolor(Red),downcolor(Blue);
var : src(0),alpha(0),source(0),ATR1(0),ATR2(0),ATRV(0);
var : up(0),up1(0),dn(0),dn1(0),trend(0),tx(0);
src = (H+L)/2;
alpha = 1 / Periods;
atr1 = IFf(IsNan(atr1[1]) == true , ma(TrueRange, Periods) , alpha * TrueRange + (1 - alpha) * atr1[1]);
atr2 = ATR(Periods);
atrv = IFf(changeATR == 1 , atr1 , atr2);
up=src-(Multiplier*atrv);
up1 = IFf(IsNan(up[1]) == False,up[1],up);
up = iff(close[1] > up1 , max(up,up1) , up);
dn=src+(Multiplier*atrv);
dn1 = IFf(IsNan(dn[1]) == False,dn[1], dn);
dn = iff(close[1] < dn1 , min(dn, dn1) , dn);
trend = 1;
trend = IFf(IsNan(trend[1]) == False,trend[1], trend);
trend = IFf(trend == -1 and close > dn1 , 1 , iff(trend == 1 and close < up1 , -1 , trend));
if trend == 1 Then
plot1(up,"Trend",upcolor);
Else
Plot1(dn,"Trend",downcolor);
위 지표을 이용하여 매수매도신호을 만들고자합니다
up trend에서매수, downtrend에서는 매도신호을 만들고 10틱단위을 차트에
표시하고자 합니다
감사합니다