매수신호가 1개 봉에서 한번 발생할 수 있도록 부탁드립니다.
input : 시작일(20240501);
var1 = ma(c,1);
if MarketPosition == 0 and sdate >= 시작일 Then
Buy("b1",AtStop,var1);
if MarketPosition == 1 and sdate >= 시작일 Then
{
Buy("b2",AtLimit,EntryPrice*0.98);
Buy("b3",AtLimit,EntryPrice*0.96);
Buy("b4",AtLimit,EntryPrice*0.94);
Buy("b5",AtLimit,EntryPrice*0.93);
Buy("b6",AtLimit,EntryPrice*0.90);
Buy("b7",AtLimit,EntryPrice*0.88);
Buy("b8",AtLimit,EntryPrice*0.86);
}
SetStopProfittarget(3,PercentStop);
답변 1
예스스탁
예스스탁 답변
2024-06-26 14:11:42
안녕하세요
예스스탁입니다.
올려주신 수식은 진입가격기준 일정%하락시마다 즉시 신호가 발생하는 내용인데
하나의 봉에서 가격하락폭의 예측이 가능하지 않아 봉당 1회 발생은 가능하지 않습니다.
만약 하나의 봉에서 몇%가 하락하든지 최근발생한 진입가 기준 2%하락이 발생하면
한번만 발생하게 제어한다면 아래와 같이 작성은 가능합니다.
input : 시작일(20240501);
var1 = ma(c,1);
if MarketPosition == 0 and sdate >= 시작일 Then
Buy("b1",AtStop,var1);
if MarketPosition == 1 and sdate >= 시작일 Then
{
Buy("b2",AtLimit,LatestEntryPrice(0)*0.98);
}
SetStopProfittarget(3,PercentStop);
즐거운 하루되세요
> 근이 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 매수신호가 1개 봉에서 한번 발생할 수 있도록 부탁드립니다.
input : 시작일(20240501);
var1 = ma(c,1);
if MarketPosition == 0 and sdate >= 시작일 Then
Buy("b1",AtStop,var1);
if MarketPosition == 1 and sdate >= 시작일 Then
{
Buy("b2",AtLimit,EntryPrice*0.98);
Buy("b3",AtLimit,EntryPrice*0.96);
Buy("b4",AtLimit,EntryPrice*0.94);
Buy("b5",AtLimit,EntryPrice*0.93);
Buy("b6",AtLimit,EntryPrice*0.90);
Buy("b7",AtLimit,EntryPrice*0.88);
Buy("b8",AtLimit,EntryPrice*0.86);
}
SetStopProfittarget(3,PercentStop);