커뮤니티
손실이 크면 진입하는 신호 문의드립니다.
2018-09-17 00:20:44
196
글번호 122088
안녕하세요.
20이평을 기준으로 분봉수식을 하나 연구중입니다.
다음과 같은 기본수식을 하나 만들었는데
잘안풀려서 문의드립니다.
매수/매도는 20이평 상향돌파시매수 STOPLOSS는 15틱을 기준으로 합니다.
ProfitTarget은 50틱입니다.
당일 매매이므로 매도이든 매수이든 첫 신호가 발생하구요.
첫 매매신호가 매수이든 매도이든 진입가대비하여 30틱의 손실이
발생하고 20이평을 크로스업하면 매수, 20이평을 크로스 다운하면
매도하는 수식을 문의드립니다.
IF marketposition == 0 && crossup(c,ma(c,20) then
{ Buy("매수");
Setstoploss(15*PriceScale,PointStop);
SetStopProfittarget(50*PriceScale,PointStop);
}
IF marketposition == 0 && Crossdown(c,ma(c,20) then
{ Sell("매도");
Setstoploss(15*PriceScale,PointStop);
SetProfittarget(50*PriceScale,PointValue);
}
답변 1
예스스탁 예스스탁 답변
2018-09-17 14:10:52
안녕하세요
예스스탁입니다.
첫진입은 크로스 조건만으로 진입하고
두번째 진입부터는 30틱이상 반대방향으로 가격이 움직인 이후에
진입하게 수정했습니다.
var : t1(0),entry(0);
if bdate != bdate[1] Then
t1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-t1;
Else
entry = TotalTrades-t1+1;
IF crossup(c,ma(c,20)) then
{
if Entry == 0 or
(entry > 1 and MarketPosition == -1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30) or
(entry > 1 and MarketPosition == 0 and Highest(H,BarsSinceEntry(1)) >= EntryPrice(1)+PriceScale*30) Then
Buy("매수");
}
IF Crossdown(c,ma(c,20)) then
{
if Entry == 0 or
(entry > 1 and MarketPosition == 1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30) or
(entry > 1 and MarketPosition == 0 and Lowest(L,BarsSinceEntry(1)) <= EntryPrice(1)-PriceScale*30) Then
Sell("매도");
}
Setstoploss(15*PriceScale,PointStop);
SetStopProfittarget(50*PriceScale,PointStop);
즐거운 하루되세요
> 일프로 님이 쓴 글입니다.
> 제목 : 손실이 크면 진입하는 신호 문의드립니다.
> 안녕하세요.
20이평을 기준으로 분봉수식을 하나 연구중입니다.
다음과 같은 기본수식을 하나 만들었는데
잘안풀려서 문의드립니다.
매수/매도는 20이평 상향돌파시매수 STOPLOSS는 15틱을 기준으로 합니다.
ProfitTarget은 50틱입니다.
당일 매매이므로 매도이든 매수이든 첫 신호가 발생하구요.
첫 매매신호가 매수이든 매도이든 진입가대비하여 30틱의 손실이
발생하고 20이평을 크로스업하면 매수, 20이평을 크로스 다운하면
매도하는 수식을 문의드립니다.
IF marketposition == 0 && crossup(c,ma(c,20) then
{ Buy("매수");
Setstoploss(15*PriceScale,PointStop);
SetStopProfittarget(50*PriceScale,PointStop);
}
IF marketposition == 0 && Crossdown(c,ma(c,20) then
{ Sell("매도");
Setstoploss(15*PriceScale,PointStop);
SetProfittarget(50*PriceScale,PointValue);
}