커뮤니티
수정좀 부탁합니다.
2017-03-22 22:13:47
122
글번호 108111
청산과 진입 신호가 같은 캔들에서 동시에 발생하는 경우가 있어 이럴 경우 청산 신호를 무시하는 수식을 부탁드렸고 아래와 같은 답변을 주셨는데 제가 어떤 변수를 넣어야 하는지 몰라서 그러는데요.
아래수식을 수정해주시면 고맙겠습니다..
----------------------------
답변 주신 내용
진입청산이 봉완성시를 기준으로 하는 타입이면
아래와 같이 제어해 보시기 바랍니다.
해당 부분은 사용자분이 수식내용에 맞춰 변수
추가하면서 변경해 보셔야 하는 내용입니다.
var : S(0);
S = 0;
if 진입 Then{
S = 1;
sell();
}
if S == 0 and 청산 Then
ExitShort();
즐거운 하루되세요
--------------------------
input : P(40);
var : T(0), moveLine(0), OrderValue(0);
moveLine = ma(C,P);
value2 = (highest(H,52)+lowest(L,52))/2;
Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true ;
Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true ;
if (T <= 0 and (moveLine > moveLine[1])) Then
{
OrderValue = Close;
T = 1;
}
if (T >= 0 and (moveLine < moveLine[1])) Then
{
OrderValue = Close;
T = -1;
}
if Condition1 == false and C > (value2 + (PriceScale*3)) and (Close >= (OrderValue + (PriceScale *2))) Then
buy("매수",OnClose);
if Condition2 == false and C < (value2 - (PriceScale*3)) and (Close <= (OrderValue - (PriceScale *3))) Then
sell("매도",OnClose);
SetStopLoss(22,PointStop);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*5 and (Close <= (OrderValue - (PriceScale *1))) Then
ExitLong("매수청산");
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*5 and (Close >= (OrderValue + (PriceScale *1))) Then
ExitShort("매도청산");
if MarketPosition == 1 Then{
var1 = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
if MarketPosition == -1 Then{
var1 = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
답변 1
예스스탁 예스스탁 답변
2017-03-23 09:55:24
안녕하세요
예스스탁입니다.
input : P(40);
var : T(0), moveLine(0), OrderValue(0),S(0),B(0);
moveLine = ma(C,P);
value2 = (highest(H,52)+lowest(L,52))/2;
Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true ;
Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true ;
if (T <= 0 and (moveLine > moveLine[1])) Then
{
OrderValue = Close;
T = 1;
}
if (T >= 0 and (moveLine < moveLine[1])) Then
{
OrderValue = Close;
T = -1;
}
B = 0;
if Condition1 == false and C > (value2 + (PriceScale*3)) and (Close >= (OrderValue + (PriceScale *2))) Then{
buy("매수",OnClose);
B = 1;
}
S = 0;
if Condition2 == false and C < (value2 - (PriceScale*3)) and (Close <= (OrderValue - (PriceScale *3))) Then {
sell("매도",OnClose);
S = 1;
}
SetStopLoss(22,PointStop);
if B == 0 and MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*5 and (Close <= (OrderValue - (PriceScale *1))) Then
ExitLong("매수청산");
if S == 0 and MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*5 and (Close >= (OrderValue + (PriceScale *1))) Then
ExitShort("매도청산");
if MarketPosition == 1 Then{
var1 = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
if MarketPosition == -1 Then{
var1 = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
즐거운 하루되세요
> 천왕봉 님이 쓴 글입니다.
> 제목 : 수정좀 부탁합니다.
> 청산과 진입 신호가 같은 캔들에서 동시에 발생하는 경우가 있어 이럴 경우 청산 신호를 무시하는 수식을 부탁드렸고 아래와 같은 답변을 주셨는데 제가 어떤 변수를 넣어야 하는지 몰라서 그러는데요.
아래수식을 수정해주시면 고맙겠습니다..
----------------------------
답변 주신 내용
진입청산이 봉완성시를 기준으로 하는 타입이면
아래와 같이 제어해 보시기 바랍니다.
해당 부분은 사용자분이 수식내용에 맞춰 변수
추가하면서 변경해 보셔야 하는 내용입니다.
var : S(0);
S = 0;
if 진입 Then{
S = 1;
sell();
}
if S == 0 and 청산 Then
ExitShort();
즐거운 하루되세요
--------------------------
input : P(40);
var : T(0), moveLine(0), OrderValue(0);
moveLine = ma(C,P);
value2 = (highest(H,52)+lowest(L,52))/2;
Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true ;
Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true ;
if (T <= 0 and (moveLine > moveLine[1])) Then
{
OrderValue = Close;
T = 1;
}
if (T >= 0 and (moveLine < moveLine[1])) Then
{
OrderValue = Close;
T = -1;
}
if Condition1 == false and C > (value2 + (PriceScale*3)) and (Close >= (OrderValue + (PriceScale *2))) Then
buy("매수",OnClose);
if Condition2 == false and C < (value2 - (PriceScale*3)) and (Close <= (OrderValue - (PriceScale *3))) Then
sell("매도",OnClose);
SetStopLoss(22,PointStop);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*5 and (Close <= (OrderValue - (PriceScale *1))) Then
ExitLong("매수청산");
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*5 and (Close >= (OrderValue + (PriceScale *1))) Then
ExitShort("매도청산");
if MarketPosition == 1 Then{
var1 = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
if MarketPosition == -1 Then{
var1 = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
다음글