커뮤니티
문의 드립니다
2026-05-22 13:48:47
56
글번호 232138
input : 시작일(20260101),시작시간(090000);
input : 이평1(120),이평2(10);
input : 윌리엄스R기간값(14);
input : 손절틱수(500),청산틱수(1000);
var : mav1(0),mav2(0),WR(0);
if sdate >= 시작일 and sTime >= 시작시간 Then
{
Condition1 = true;
}
MAV1 = MA(c,이평1);
MAV2 = MA(c,이평2);
WR = WILLR(윌리엄스R기간값);
if Condition1 == true Then
{
if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) Then
Sell("s");
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*청산틱수 Then
if CrossUp(C,mav2) Then
ExitShort("sx");
}
SetStopLoss(PriceScale*손절틱수,PointStop);
}
위 수식에서 일정한 틱수에 도달하면은 진입가격으로 트레일링 스탑을 하고 싶습니다..
이와 관련해서 수식 좀 부탁 드립니다.
답변 2
예스스탁 예스스탁 답변
2026-05-26 13:29:40
안녕하세요
예스스탁입니다.
input : 시작일(20260101),시작시간(090000);
input : 이평1(120),이평2(10);
input : 윌리엄스R기간값(14);
input : 손절틱수(500),청산틱수(1000),수익틱수(500);
var : mav1(0),mav2(0),WR(0);
if sdate >= 시작일 and sTime >= 시작시간 Then
{
Condition1 = true;
}
MAV1 = MA(c,이평1);
MAV2 = MA(c,이평2);
WR = WILLR(윌리엄스R기간값);
if Condition1 == true Then
{
if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) Then
Sell("s");
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*청산틱수 Then
if CrossUp(C,mav2) Then
ExitShort("sx");
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*수익틱수 Then
ExitLong("bx",AtStop,EntryPrice);
}
SetStopLoss(PriceScale*손절틱수,PointStop);
}
즐거운 하루되세요
블루3
2026-05-27 17:51:31
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*수익틱수 Then
ExitLong("bx",AtStop,EntryPrice);
이거는 매수청산인데, 매도 청산이 되어야 되지 않나요?
다음글
이전글