안녕하세요.
일봉으로 거래 시, 시가 분할 매수 후 매도하는 간단한 수식을 짰는데
생각대로 잘 안되는 것 같아서 조언을 부탁드립니다.
항상 감사드립니다.
즐거운 주말 보내세요.
if marketposition ==0 then
{
 if nextbarsdate !=sdate then
 {
  buy("b1", atstop, nextbaropen);
  buy("b2", atstop, nextbaropen*0.97); 
 }
}
//당일 이후에 분할 매수 들어갈 경우
if marketposition == 1 and maxentries ==1 then
{
  buy("b3", atstop, latestentryprice*0.97); 
}
exitlong("bx", atlimit, entryprice * 1.05); //진입가가 아닌 기준가격(시가)로 매도하고 싶은데 nextbaropen은 안되네요.
exitlong("bx2", atstop, entryprice * 0.95);
//추가문의 : 일봉으로 거래할 때도 시분초 등으로 넣어서 특정 시간 이후에 진입/청산을 할 수 있게 만들 수 있나요???
답변 1
예스스탁
예스스탁 답변
2024-05-20 09:13:38
안녕하세요
예스스탁입니다.
1
진입이 봉완성시 무포지션일때 셋팅이 되서 다음봉 현재가와 비교해 신호가 발생하는데
동시에 청산함수도 셋팅이 되면 그 때 entryprice는 0 입니다.
가격 하락시 매수진입은 atlimit 타입을 사용하셔야 합니다.
if marketposition ==0 then
{
if nextbarsdate !=sdate then
{
buy("b1", AtMarket, nextbaropen);
buy("b2", AtLimit, nextbaropen*0.97);
exitlong("bx1", atlimit, NextBarOpen * 1.05);
exitlong("bx2", atstop, NextBarOpen * 0.95);
}
}
if marketposition == 1 then
{
if maxentries == 1 Then
buy("b3", AtLimit, latestentryprice*0.97);
exitlong("bx3", atlimit, O[BarsSinceEntry] * 1.05);
exitlong("bx4", atstop, O[BarsSinceEntry] * 0.95);
}
2
일봉에서 시간조건은 가능하지 않습니다.
if문이 봉완성기준으로 체크하므로
일봉에서 시간조건을 지정하는 것이 의미가 없습니다.
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요.
일봉으로 거래 시, 시가 분할 매수 후 매도하는 간단한 수식을 짰는데
생각대로 잘 안되는 것 같아서 조언을 부탁드립니다.
항상 감사드립니다.
즐거운 주말 보내세요.
if marketposition ==0 then
{
 if nextbarsdate !=sdate then
 {
  buy("b1", atstop, nextbaropen);
  buy("b2", atstop, nextbaropen*0.97); 
 }
}
//당일 이후에 분할 매수 들어갈 경우
if marketposition == 1 and maxentries ==1 then
{
  buy("b3", atstop, latestentryprice*0.97); 
}
exitlong("bx", atlimit, entryprice * 1.05); //진입가가 아닌 기준가격(시가)로 매도하고 싶은데 nextbaropen은 안되네요.
exitlong("bx2", atstop, entryprice * 0.95);
//추가문의 : 일봉으로 거래할 때도 시분초 등으로 넣어서 특정 시간 이후에 진입/청산을 할 수 있게 만들 수 있나요???