커뮤니티
TS수식인데 YT전환 부탁 드립니다.
2009-03-30 09:48:22
740
글번호 21275
Inputs: Price(Close), XAvgLen(15), HiLoLen(50), Retrace(.382), SetUpLen(24);
Vars: XAvg(0), HiHi(0), HiHiBar(0), LoLo(0), LoLoBar(0), Retracement(0), BuySetup(0), SellSetup(0);
{Calculation of the necessary values, and assignment to variables}
XAvg = XAverage(Price, XAvgLen);
HiHi = Highest(High, HiLoLen);
LoLo = Lowest(Low, HiLoLen);
HiHiBar = HighestBar(High, HiLoLen);
LoLoBar = LowestBar(Low, HiLoLen);
Retracement = (HiHi - LoLo) * Retrace;
{Conditions for a Buy Setup}
IF Close <= HiHi - Retracement AND HiHiBar < LoLoBar Then BuySetup = 0;
{Conditions for a Sell Setup}
IF Close >= LoLo + Retracement AND HiHiBar > LoLoBar Then SellSetup = 0;
{Accumulates to count the number of bars in the setups}
BuySetup = BuySetup + 1;
SellSetup = SellSetup + 1;
{Buy Criteria Evaluation}
IF BuySetup <= SetUpLen Then Begin
IF SwingLow(1, XAvg, 1, 2) <> -1 OR Close > XAvg Then Begin
Buy Next Bar at Market;
BuySetup = SetUpLen;
End;
End;
{Sell Criteria Evaluation}
IF SellSetup <= SetUpLen Then Begin
IF SwingHigh(1, XAvg, 1, 2) <> -1 OR Close < XAvg Then Begin
Sell Next Bar at Market;
SellSetup = SetUpLen;
End;
End;
TS수식인데 YT로 전환 하고 싶습니다.
부탁드리겠습니다.
좋은 하루 보내세요~
답변 1
예스스탁 예스스탁 답변
2009-03-31 10:17:19
안녕하세요
예스스탁입니다.
Inputs: Price(Close), XAvgLen(15), HiLoLen(50), Retrace(.382), SetUpLen(24);
Vars: XAvg(0), HiHi(0), HiHiBar(0), LoLo(0), LoLoBar(0), Retracement(0), BuySetup(0), SellSetup(0);
#{Calculation of the necessary values, and assignment to variables}
XAvg = ema(Price, XAvgLen);
HiHi = Highest(High, HiLoLen);
LoLo = Lowest(Low, HiLoLen);
HiHiBar = nthHighestBar(1,High, HiLoLen);
LoLoBar = nthLowestBar(1,Low, HiLoLen);
Retracement = (HiHi - LoLo) * Retrace;
#{Conditions for a Buy Setup}
IF Close <= HiHi - Retracement AND HiHiBar < LoLoBar Then BuySetup = 0;
#{Conditions for a Sell Setup}
IF Close >= LoLo + Retracement AND HiHiBar > LoLoBar Then SellSetup = 0;
#{Accumulates to count the number of bars in the setups}
BuySetup = BuySetup + 1;
SellSetup = SellSetup + 1;
#{Buy Criteria Evaluation}
IF BuySetup <= SetUpLen Then Begin
IF SwingLow(1, XAvg, 1, 2,4) <> -1 OR Close > XAvg Then Begin
Buy("b",AtMarket);
BuySetup = SetUpLen;
End;
End;
#{Sell Criteria Evaluation}
IF SellSetup <= SetUpLen Then Begin
IF SwingHigh(1, XAvg, 1, 2,4) <> -1 OR Close < XAvg Then Begin
Sell("s",AtMarket);
SellSetup = SetUpLen;
End;
End;
즐거운 하루되세요
> 산티아고 님이 쓴 글입니다.
> 제목 : TS수식인데 YT전환 부탁 드립니다.
> Inputs: Price(Close), XAvgLen(15), HiLoLen(50), Retrace(.382), SetUpLen(24);
Vars: XAvg(0), HiHi(0), HiHiBar(0), LoLo(0), LoLoBar(0), Retracement(0), BuySetup(0), SellSetup(0);
{Calculation of the necessary values, and assignment to variables}
XAvg = XAverage(Price, XAvgLen);
HiHi = Highest(High, HiLoLen);
LoLo = Lowest(Low, HiLoLen);
HiHiBar = HighestBar(High, HiLoLen);
LoLoBar = LowestBar(Low, HiLoLen);
Retracement = (HiHi - LoLo) * Retrace;
{Conditions for a Buy Setup}
IF Close <= HiHi - Retracement AND HiHiBar < LoLoBar Then BuySetup = 0;
{Conditions for a Sell Setup}
IF Close >= LoLo + Retracement AND HiHiBar > LoLoBar Then SellSetup = 0;
{Accumulates to count the number of bars in the setups}
BuySetup = BuySetup + 1;
SellSetup = SellSetup + 1;
{Buy Criteria Evaluation}
IF BuySetup <= SetUpLen Then Begin
IF SwingLow(1, XAvg, 1, 2) <> -1 OR Close > XAvg Then Begin
Buy Next Bar at Market;
BuySetup = SetUpLen;
End;
End;
{Sell Criteria Evaluation}
IF SellSetup <= SetUpLen Then Begin
IF SwingHigh(1, XAvg, 1, 2) <> -1 OR Close < XAvg Then Begin
Sell Next Bar at Market;
SellSetup = SetUpLen;
End;
End;
TS수식인데 YT로 전환 하고 싶습니다.
부탁드리겠습니다.
좋은 하루 보내세요~