커뮤니티
수식문의드립니다
2017-08-24 16:38:58
147
글번호 112231
항상 친절한 답변에 감사드립니다.
아래 식은 매수만 되는 식인데
동일한 방법으로 매도도 되는 식으로 바꿔주세요.
항상 행복하세요!!
Input : Period(20), MultiD(2);
var : BBup(0),BBdn(0),T(0);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
if CrossUp(C,BBup) Then
T = 1;
if CrossDown(C,BBup) Then
T = 2;
if CrossDown(C,BBdn) Then
T = -1;
if crossup(C,BBdn) Then
T = -2;
if T == -2 and C > O Then
T = -3;
if MarketPosition == 0 and T == -3 and T != T[1] Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
Condition1 = false;
if T == -2 Then
Condition1 = true;
if Condition1 == true and C <= LatestEntryPrice(0)-0.5 and T == -3 and T != T[1] and MaxContracts < 3 Then
buy("bb",OnClose,def,1);
if H >= BBup Then
Condition2 = true;
if Condition2 == true and C < O and C < L[1] Then
exitlong("bx");
}
Else{
Condition1 = false;
Condition2 = false;
}
답변 1
예스스탁 예스스탁 답변
2017-08-25 13:41:24
안녕하세요
예스스타입니다.
Input : Period(20), MultiD(2);
var : BBup(0),BBdn(0),T(0);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
if CrossUp(C,BBup) Then
T = 1;
if CrossDown(C,BBup) Then
T = 2;
if CrossDown(C,BBdn) Then
T = -1;
if crossup(C,BBdn) Then
T = -2;
if T == -2 and C > O Then
T = -3;
if T == 2 and C < O Then
T = 3;
if MarketPosition <= 0 and T == -3 and T != T[1] Then
buy("b",OnClose,def,1);
if MarketPosition >= 0 and T == 3 and T != T[1] Then
sell("s",OnClose,def,1);
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
Condition1 = false;
if T == -2 Then
Condition1 = true;
if Condition1 == true and C <= LatestEntryPrice(0)-0.5 and T == -3 and T != T[1] and MaxContracts < 3 Then
buy("bb",OnClose,def,1);
if H >= BBup Then
Condition2 = true;
if Condition2 == true and C < O and C < L[1] Then
exitlong("bx");
}
Else{
Condition1 = false;
Condition2 = false;
}
if MarketPosition == -1 Then{
if CurrentContracts > CurrentContracts[1] Then
Condition3 = false;
if T == 22 Then
Condition3 = true;
if Condition3 == true and C >= LatestEntryPrice(0)+0.5 and T == 3 and T != T[1] and MaxContracts < 3 Then
sell("ss",OnClose,def,1);
if L <= BBdn Then
Condition4 = true;
if Condition4 == true and C > O and C > H[1] Then
ExitShort("sx");
}
Else{
Condition3 = false;
Condition4 = false;
}
즐거운 하루되세요
> 짙은안개 님이 쓴 글입니다.
> 제목 : 수식문의드립니다
> 항상 친절한 답변에 감사드립니다.
아래 식은 매수만 되는 식인데
동일한 방법으로 매도도 되는 식으로 바꿔주세요.
항상 행복하세요!!
Input : Period(20), MultiD(2);
var : BBup(0),BBdn(0),T(0);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
if CrossUp(C,BBup) Then
T = 1;
if CrossDown(C,BBup) Then
T = 2;
if CrossDown(C,BBdn) Then
T = -1;
if crossup(C,BBdn) Then
T = -2;
if T == -2 and C > O Then
T = -3;
if MarketPosition == 0 and T == -3 and T != T[1] Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
Condition1 = false;
if T == -2 Then
Condition1 = true;
if Condition1 == true and C <= LatestEntryPrice(0)-0.5 and T == -3 and T != T[1] and MaxContracts < 3 Then
buy("bb",OnClose,def,1);
if H >= BBup Then
Condition2 = true;
if Condition2 == true and C < O and C < L[1] Then
exitlong("bx");
}
Else{
Condition1 = false;
Condition2 = false;
}