커뮤니티
수식변경 요청드립니다.
2016-10-17 22:26:07
109
글번호 103036
안녕하세요.
다음 수식에 Stochastic Slow (10, 5, 5) 의 StochasticsK 값이 85이상일때 매도하는 조건을 추가해 주셨으면 합니다.
input : 거래시간1(1), 시작시간1(200000), 끝시간1(010000),익절틱수1(36),손절틱수1(15);
input : P1(5),P2(20),N(20),X(10);
var : AA(0),BB(0);
if 거래시간1 == 1 then
condition3 = (stime>=시작시간1 or stime<=끝시간1);
Else if 거래시간1 == 2 then
condition3 = (stime>=시작시간1 and stime<=끝시간1);
Else
condition3 = true;
AA = ma(C,P1);
BB = ma(C,P2);
if MarketPosition == 0 and TotalTrades == TotalTrades[3] and
Condition3 == true and
BB > BB[1] and C > AA and C > O and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then
Sell();
SetStopProfittarget(PriceScale*익절틱수1,PointStop);
SetStopLoss(PriceScale*손절틱수1,PointStop);
if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
답변 1
예스스탁 예스스탁 답변
2016-10-18 10:41:39
안녕하세요
예스스탁입니다.
input : 거래시간1(1), 시작시간1(200000), 끝시간1(010000),익절틱수1(36),손절틱수1(15),sto1(10),sto2(5);
input : P1(5),P2(20),N(20),X(10);
var : AA(0),BB(0),stok(0);
stok = StochasticsK(sto1,sto2);
if 거래시간1 == 1 then
condition3 = (stime>=시작시간1 or stime<=끝시간1);
Else if 거래시간1 == 2 then
condition3 = (stime>=시작시간1 and stime<=끝시간1);
Else
condition3 = true;
AA = ma(C,P1);
BB = ma(C,P2);
if MarketPosition == 0 and TotalTrades == TotalTrades[3] and
Condition3 == true and
BB > BB[1] and C > AA and C > O and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X and stok >= 85 Then
Sell();
SetStopProfittarget(PriceScale*익절틱수1,PointStop);
SetStopLoss(PriceScale*손절틱수1,PointStop);
if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 수식변경 요청드립니다.
> 안녕하세요.
다음 수식에 Stochastic Slow (10, 5, 5) 의 StochasticsK 값이 85이상일때 매도하는 조건을 추가해 주셨으면 합니다.
input : 거래시간1(1), 시작시간1(200000), 끝시간1(010000),익절틱수1(36),손절틱수1(15);
input : P1(5),P2(20),N(20),X(10);
var : AA(0),BB(0);
if 거래시간1 == 1 then
condition3 = (stime>=시작시간1 or stime<=끝시간1);
Else if 거래시간1 == 2 then
condition3 = (stime>=시작시간1 and stime<=끝시간1);
Else
condition3 = true;
AA = ma(C,P1);
BB = ma(C,P2);
if MarketPosition == 0 and TotalTrades == TotalTrades[3] and
Condition3 == true and
BB > BB[1] and C > AA and C > O and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then
Sell();
SetStopProfittarget(PriceScale*익절틱수1,PointStop);
SetStopLoss(PriceScale*손절틱수1,PointStop);
if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}