·Î±×ÀÎ
|
ȸ¿ø°¡ÀÔ
|
ȸ»ç¼Ò°³
|
»çÀÌÆ®¸Ê
Ä¿¹Â´ÏƼ | ¼ö½ÄÀÛ¼º Q&A
ÀÛ¼ºÀÚ :
ÇØ¾Ï
ÀÛ¼ºÀÏ : 2025-05-09 ¿ÀÈÄ 12:03:12 Á¶È¸¼ö : 41
¹®Àǵ帳´Ï´Ù.
ÀÌÀü ¹®Àǵ帰 ¼ö½ÄÁß ¾Æ·¡ÀÇ ¼ö½ÄÀ» Àû¿ëÇß´õ´Ï ¼±ÀÇ »ö»óÀÌ ÆÄ¶õ»öÀ¸·Î¸¸ ³ª¿À°í
green°ú red´Â ±¸ÇöµÇÁö ¾Ê½À´Ï´Ù. ¶ÇÇÑ ¼±ÀÌ Á÷¼±Ã³·³ ³ª¿Í¾ß Çϴµ¥ ÈÛ¼Òó·³ ³ª¿É´Ï´Ù.
´Ù½ÃÇѹøºÎʵ右´Ï´Ù.
==========================
study(title="Average True Range Trailing Stops Strategy, by Sylvain Vervoort", overlay = true)
nATRPeriod = input(5)
nATRMultip = input(3.5)
xATR = atr(nATRPeriod)
nLoss = nATRMultip * xATR
xATRTrailingStop = iff(close > nz(xATRTrailingStop[1], 0) and close[1] > nz(xATRTrailingStop[1], 0), max(nz(xATRTrailingStop[1]), close - nLoss),
iff(close < nz(xATRTrailingStop[1], 0) and close[1] < nz(xATRTrailingStop[1], 0), min(nz(xATRTrailingStop[1]), close + nLoss),
iff(close > nz(xATRTrailingStop[1], 0), close - nLoss, close + nLoss)))
pos = iff(close[1] < nz(xATRTrailingStop[1], 0) and close > nz(xATRTrailingStop[1], 0), 1,
iff(close[1] > nz(xATRTrailingStop[1], 0) and close < nz(xATRTrailingStop[1], 0), -1, nz(pos[1], 0)))
color = pos == -1 ? red: pos == 1 ? green : blue
plot(xATRTrailingStop, color=color, title="ATR Trailing Stop")
===============================================
ÀÛ¼ºÇØÁֽмö½Ä
input : nATRPeriod(5);
input : nATRMultip(3.5);
var : xATR(0),nLoss(0),xATRTrailingStop(0),ps(0),nz(0),color(0);
xATR = atr(nATRPeriod);
nLoss = nATRMultip * xATR;
nz = iff(xATRTrailingStop[1] == true,0,xATRTrailingStop[1]);
xATRTrailingStop = iff(close > nz and close[1] > nz, max(nz, close - nLoss),
iff(close < nz and close[1] < nz, min(nz, close + nLoss),
iff(close > nz, close - nLoss, close + nLoss)));
ps = iff(close[1] < nz and close > nz, 1,
iff(close[1] > nz and close < nz, -1, iff(isnan(ps[1]) ==true, 0,ps[1]))) ;
color = iff(ps == -1 , red, iff(ps == 1 , green , blue));
plot1(xATRTrailingStop, "ATR Trailing Stop",color);
==================
Ç×»ó °¨»çµå¸³´Ï´Ù. ¼ö°íÇϼ¼¿ä!!!
Á¶°Ç½ÄÀ¸·Î º¯ÇüºÎʵ右´Ï´Ù
¾È³çÇϼ¼¿ä
°ü·Ã ±Û ¸®½ºÆ®
ÇöÀç±Û
¹®Àǵ帳´Ï´Ù.
ÇØ¾Ï
2025.05.09
41
Re : ¹®Àǵ帳´Ï´Ù.
¿¹½º½ºÅ¹
2025.05.09
44