커뮤니티
Stochastic, WiliamsR 수식 점검 부탁드립니다.
2019-02-07 21:58:48
211
글번호 125951
아래의 수식을 틱챠트에 적용해 보았더니 시그널이 발생하지 않습니다.
어디가 문제인지 도무지 알수가 없어서 문의드립니다. 점검 부탁드리겠습니다.
- 아 래 -
Input : 당일누적수익틱수(400),당일누적손실틱수(300),P(120);
input : starttime(100000),endtime(172000);
input : sto1(5),sto2(3),sto3(3);
Input : Period(14);
VARS: Tcond(false),N1(0),dayPl(0),당일누적수익(0),당일누적손실(0),Xcond(false),stok(0),stod(0);
var : WR(0);
if (stime >= endtime) or
(stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("매수청산");
if MarketPosition == -1 Then
ExitShort("매도청산");
}
if (stime >= starttime) or
(stime >= starttime and stime[1] < starttime) then
{
Xcond = false;
N1 = NetProfit;
Tcond = true;
}
당일누적수익 = PriceScale*당일누적수익틱수;
당일누적손실 = PriceScale*당일누적손실틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(daypl >= 당일누적수익 or daypl <= -당일누적손실) then
Xcond = true;
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
WR = WILLR(Period);
if Tcond == true and Xcond == false then
{
if stok > stod and crossup(WR,20) Then
Buy("매수");
if stok < stod and CrossDown(WR,80) Then
Sell("매도");
}
if MarketPosition == 1 then
{
ExitLong("매수수익",atlimit,EntryPrice+((당일누적수익-daypl)/CurrentContracts));
ExitLong("매수손실",AtStop,EntryPrice-((당일누적손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
ExitShort("매도수익",atlimit,EntryPrice-((당일누적수익-daypl)/CurrentContracts));
ExitShort("매도손실",AtStop,EntryPrice+((당일누적손실+daypl)/CurrentContracts));
}
답변 1
예스스탁 예스스탁 답변
2019-02-08 13:32:12
안녕하세요
예스스탁입니다.
WR이 0~-100 사이를 움직이므로 -20돌파,-80 이탈로 변경했습니다.
돌파 수치가 다르면 수식에서 변경하시기 바랍니다.
Input : 당일누적수익틱수(400),당일누적손실틱수(300),P(120);
input : starttime(100000),endtime(172000);
input : sto1(5),sto2(3),sto3(3);
Input : Period(14);
VARS: Tcond(false),N1(0),dayPl(0),당일누적수익(0),당일누적손실(0),Xcond(false),stok(0),stod(0);
var : WR(0);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("매수청산");
if MarketPosition == -1 Then
ExitShort("매도청산");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Xcond = false;
N1 = NetProfit;
Tcond = true;
}
당일누적수익 = PriceScale*당일누적수익틱수;
당일누적손실 = PriceScale*당일누적손실틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(daypl >= 당일누적수익 or daypl <= -당일누적손실) then
Xcond = true;
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
WR = WILLR(Period);
if Tcond == true and Xcond == false then
{
if stok > stod and crossup(WR,-20) Then
Buy("매수");
if stok < stod and CrossDown(WR,-80) Then
Sell("매도");
}
if MarketPosition == 1 then
{
ExitLong("매수수익",atlimit,EntryPrice+((당일누적수익-daypl)/CurrentContracts));
ExitLong("매수손실",AtStop,EntryPrice-((당일누적손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
ExitShort("매도수익",atlimit,EntryPrice-((당일누적수익-daypl)/CurrentContracts));
ExitShort("매도손실",AtStop,EntryPrice+((당일누적손실+daypl)/CurrentContracts));
}
즐거운 하루되세요
> 승부사1 님이 쓴 글입니다.
> 제목 : Stochastic, WiliamsR 수식 점검 부탁드립니다.
> 아래의 수식을 틱챠트에 적용해 보았더니 시그널이 발생하지 않습니다.
어디가 문제인지 도무지 알수가 없어서 문의드립니다. 점검 부탁드리겠습니다.
- 아 래 -
Input : 당일누적수익틱수(400),당일누적손실틱수(300),P(120);
input : starttime(100000),endtime(172000);
input : sto1(5),sto2(3),sto3(3);
Input : Period(14);
VARS: Tcond(false),N1(0),dayPl(0),당일누적수익(0),당일누적손실(0),Xcond(false),stok(0),stod(0);
var : WR(0);
if (stime >= endtime) or
(stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("매수청산");
if MarketPosition == -1 Then
ExitShort("매도청산");
}
if (stime >= starttime) or
(stime >= starttime and stime[1] < starttime) then
{
Xcond = false;
N1 = NetProfit;
Tcond = true;
}
당일누적수익 = PriceScale*당일누적수익틱수;
당일누적손실 = PriceScale*당일누적손실틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(daypl >= 당일누적수익 or daypl <= -당일누적손실) then
Xcond = true;
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
WR = WILLR(Period);
if Tcond == true and Xcond == false then
{
if stok > stod and crossup(WR,20) Then
Buy("매수");
if stok < stod and CrossDown(WR,80) Then
Sell("매도");
}
if MarketPosition == 1 then
{
ExitLong("매수수익",atlimit,EntryPrice+((당일누적수익-daypl)/CurrentContracts));
ExitLong("매수손실",AtStop,EntryPrice-((당일누적손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
ExitShort("매도수익",atlimit,EntryPrice-((당일누적수익-daypl)/CurrentContracts));
ExitShort("매도손실",AtStop,EntryPrice+((당일누적손실+daypl)/CurrentContracts));
}