안녕하세요?
잘 안되는 부분 두가지가 있어서 도움요청 드립니다.
1) (진입음봉,진입양봉 은 외부변수로 지정한틱수 그대로 인식하고, 전봉음봉과 전봉양봉
은 외부변수로 지정한 틱수 보다 클떄) 이 조건이 충족되었을때 진입 신호로 인식되었
으면 좋겠습니다.
2) 짧은지식으로 이렇게 저렇게 수식을 건드려보았지만, 가장고치고 싶은부분이 재진입 부
분입니다.
재진입은 한번만 되었으면좋겠는데, 반복이 되고있습니다.
재진입 신호가 나온후 설정해놓은 익절/손절이 될때까지 추가로 재진입은 안이루어지게
하고싶습니다.
감사합니다.
input : 전봉음봉(5),진입음봉(5);
input : 전봉양봉(5),진입양봉(5);
input : p1(5),p2(20);
input : entrycnt(3),profit(50),loss(50);
var1 = ma(c,p1);
var2 = ma(c,p2);
if MarketPosition == 0 and var1 > Var2 and C <= O-진입음봉*PriceScale and C[1] == O[1]-전봉음봉*PriceScale then
sell("s");
if MarketPosition == 0 and var1 < Var2 and C >= O+진입양봉*PriceScale and C[1] == O[1]+전봉양봉*PriceScale then
buy("b");
if MarketPosition == -1 and BarsSinceEntry <= 3 and C > O Then
Buy("sb");
if MarketPosition == 1 and BarsSinceEntry <= 3 and C < O Then
Sell("bs");
SetStopProfittarget(PriceScale*profit,PointStop);
SetStopLoss(PriceScale*loss,PointStop);
답변 1
예스스탁
예스스탁 답변
2020-11-24 13:38:37
안녕하세요
예스스탁입니다.
input : 전봉음봉(5),진입음봉(5);
input : 전봉양봉(5),진입양봉(5);
input : p1(5),p2(20);
input : entrycnt(3),profit(50),loss(50);
var1 = ma(c,p1);
var2 = ma(c,p2);
if MarketPosition == 0 and var1 > Var2 and C <= O-진입음봉*PriceScale and C[1] <= O[1]-전봉음봉*PriceScale then
sell("s");
if MarketPosition == 0 and var1 < Var2 and C >= O+진입양봉*PriceScale and C[1] >= O[1]+전봉양봉*PriceScale then
buy("b");
if MarketPosition == -1 and IsEntryName("s") == true and BarsSinceEntry <= 3 and C > O Then
Buy("sb");
if MarketPosition == 1 and IsEntryName("b") == true and BarsSinceEntry <= 3 and C < O Then
Sell("bs");
SetStopProfittarget(PriceScale*profit,PointStop);
SetStopLoss(PriceScale*loss,PointStop);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수정 부탁드립니다.
> 안녕하세요?
잘 안되는 부분 두가지가 있어서 도움요청 드립니다.
1) (진입음봉,진입양봉 은 외부변수로 지정한틱수 그대로 인식하고, 전봉음봉과 전봉양봉
은 외부변수로 지정한 틱수 보다 클떄) 이 조건이 충족되었을때 진입 신호로 인식되었
으면 좋겠습니다.
2) 짧은지식으로 이렇게 저렇게 수식을 건드려보았지만, 가장고치고 싶은부분이 재진입 부
분입니다.
재진입은 한번만 되었으면좋겠는데, 반복이 되고있습니다.
재진입 신호가 나온후 설정해놓은 익절/손절이 될때까지 추가로 재진입은 안이루어지게
하고싶습니다.
감사합니다.
input : 전봉음봉(5),진입음봉(5);
input : 전봉양봉(5),진입양봉(5);
input : p1(5),p2(20);
input : entrycnt(3),profit(50),loss(50);
var1 = ma(c,p1);
var2 = ma(c,p2);
if MarketPosition == 0 and var1 > Var2 and C <= O-진입음봉*PriceScale and C[1] == O[1]-전봉음봉*PriceScale then
sell("s");
if MarketPosition == 0 and var1 < Var2 and C >= O+진입양봉*PriceScale and C[1] == O[1]+전봉양봉*PriceScale then
buy("b");
if MarketPosition == -1 and BarsSinceEntry <= 3 and C > O Then
Buy("sb");
if MarketPosition == 1 and BarsSinceEntry <= 3 and C < O Then
Sell("bs");
SetStopProfittarget(PriceScale*profit,PointStop);
SetStopLoss(PriceScale*loss,PointStop);