커뮤니티

문의 드립니다.~~~~

프로필 이미지
예스요
2026-10-29 15:18:32
141
글번호 234029
답변완료

아래식의 결과가

완전히 반대로 나오게 하는 식(r거꾸로 매매)을 부탁합니다~~



input : a틱(10),b틱(10),n틱(20),m틱(20);

var : tt(0),t1(0),entry(0);


tt = TotalTrades;


if Bdate != Bdate[1] Then

t1 = tt[1];


entry = tt-t1+IFF(MarketPosition!= 0,1,0);


if entry < 1 Then

{

if MarketPosition == 0 Then

Buy("b1",AtLimit,DayHigh-PriceScale*a틱);


if MarketPosition == 0 Then

Sell("s1",AtLimit,DayLow+PriceScale*b틱);

}

Else

{

if MarketPosition == 0 Then

Buy("b2",AtLimit,highest(H,BarsSinceExit(1))-PriceScale*a틱);


if MarketPosition == 0 Then

Sell("s2",AtLimit,Lowest(L,BarsSinceExit(1))+PriceScale*b틱);

}


if MarketPosition == 1 Then

{

ExitLong("bp",AtLimit,EntryPrice+PriceScale*n틱);

if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*n틱 Then

ExitLong("bx",AtLimit,lowest(L,BarsSinceEntry)+PriceScale*n틱);

}


if MarketPosition == -1 Then

{

ExitShort("sp",AtLimit,EntryPrice-PriceScale*m틱);

if highest(H,BarsSinceEntry) >= EntryPrice-PriceScale*m틱 Then

ExitShort("sx",AtLimit,highest(H,BarsSinceEntry)-PriceScale*m틱);

}

시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2026-10-30 09:07:49

안녕하세요 예스스탁입니다. 아래식 적용하시면 지정하신 틱수에 따라 완전 반대 결과가 아닐수 있습니다. 이유는 해당 수식 특성상 한봉에서 동일시점에 매수진입과 매도진입이 동시에 만족해서 발생할 수 있는데 랭귀지 체계상 매수진입 우선 원칙에 따라 매수진입이 먼저 들어가고 매도로 스위칭을 하게 되어 있는데 이부분은 내부체계라 수식에서 반대로 동작하게 작성이 되지 않습니다. input : a틱(10),b틱(10),n틱(20),m틱(20); var : tt(0),t1(0),entry(0); tt = TotalTrades; if Bdate != Bdate[1] Then t1 = tt[1]; entry = tt-t1+IFF(MarketPosition!= 0,1,0); if entry < 1 Then { if MarketPosition == 0 Then Buy("b1",AtStop,DayLow+PriceScale*b틱); if MarketPosition == 0 Then Sell("s1",AtStop,DayHigh-PriceScale*a틱); } Else { if MarketPosition == 0 Then Buy("b2",AtStop,Lowest(L,BarsSinceExit(1))+PriceScale*b틱); if MarketPosition == 0 Then Sell("s2",AtStop,highest(H,BarsSinceExit(1))-PriceScale*a틱); } if MarketPosition == -1 Then { ExitShort("sp",AtStop,EntryPrice+PriceScale*n틱); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*n틱 Then ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+PriceScale*n틱); } if MarketPosition == 1 Then { ExitLong("bp",AtStop,EntryPrice-PriceScale*m틱); if highest(H,BarsSinceEntry) >= EntryPrice-PriceScale*m틱 Then ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-PriceScale*m틱); } 즐거운 하루되세요