커뮤니티
수식 부탁드립니다.
2019-06-18 23:53:03
289
글번호 129557
안녕하세요
항상 많은 도움에 감사드립니다.
손절 익절 초기 설정은 손절(25틱)/익절(25틱) 입니다.
(1) 진입후에 30분이 지나도 청산이 되지 않는 경우, 손절/익절을 각 각 10틱으로 변경하고,
그 이후에 30분이 지나도 청산이 되지 않으면 현재가에 청산한다.
(2) 진입후에 20봉이 경과해도 청산이 되지 않는 경우, 손절/익절을 각 각 10틱으로 변경하고,
그 이후에 또 20봉이 경과해도 청산이 되지 않으면 현재가에 청산한다.
위 수식을 예스랭귀지와 예스스팟 두가지로 설정이 가능하다면 각 각 부탁드리겠습니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2019-06-19 11:02:54
안녕하세요
예스스탁입니다.
예스랭귀지만 작성해 드립니다.
1
if MarketPosition == 1 then
{
if TimeToMinutes(stime) < TimeToMinutes(EntryTime)+30 then
{
ExitLong("bl1",AtStop,EntryPrice-PriceScale*25);
ExitLong("bp1",Atlimit,EntryPrice+PriceScale*25);
}
else if TimeToMinutes(stime) >= TimeToMinutes(EntryTime)+30 and TimeToMinutes(stime) < TimeToMinutes(EntryTime)+60 then
{
ExitLong("bl2",AtStop,EntryPrice-PriceScale*10);
ExitLong("bp2",Atlimit,EntryPrice+PriceScale*10);
}
else
{
ExitLong("bx3");
}
}
if MarketPosition == -1 then
{
if TimeToMinutes(stime) < TimeToMinutes(EntryTime)+30 then
{
ExitShort("sl1",AtStop,EntryPrice+PriceScale*25);
ExitShort("sp1",Atlimit,EntryPrice-PriceScale*25);
}
else if TimeToMinutes(stime) >= TimeToMinutes(EntryTime)+30 and TimeToMinutes(stime) < TimeToMinutes(EntryTime)+60 then
{
ExitShort("sl2",AtStop,EntryPrice+PriceScale*10);
ExitShort("sp2",Atlimit,EntryPrice-PriceScale*10);
}
else
{
ExitShort("sx3");
}
}
2
if MarketPosition == 1 then
{
if BarsSinceEntry < 20 then
{
ExitLong("bl1",AtStop,EntryPrice-PriceScale*25);
ExitLong("bp1",Atlimit,EntryPrice+PriceScale*25);
}
else if BarsSinceEntry >= 20 and BarsSinceEntry < 40 then
{
ExitLong("bl2",AtStop,EntryPrice-PriceScale*10);
ExitLong("bp2",Atlimit,EntryPrice+PriceScale*10);
}
else
{
ExitLong("bx3");
}
}
if MarketPosition == -1 then
{
if BarsSinceEntry < 20 then
{
ExitShort("sl1",AtStop,EntryPrice+PriceScale*25);
ExitShort("sp1",Atlimit,EntryPrice-PriceScale*25);
}
else if BarsSinceEntry >= 20 and BarsSinceEntry < 40 then
{
ExitShort("sl2",AtStop,EntryPrice+PriceScale*10);
ExitShort("sp2",Atlimit,EntryPrice-PriceScale*10);
}
else
{
ExitShort("sx3");
}
}
즐거운 하루되세요
> 워싱턴 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 안녕하세요
항상 많은 도움에 감사드립니다.
손절 익절 초기 설정은 손절(25틱)/익절(25틱) 입니다.
(1) 진입후에 30분이 지나도 청산이 되지 않는 경우, 손절/익절을 각 각 10틱으로 변경하고,
그 이후에 30분이 지나도 청산이 되지 않으면 현재가에 청산한다.
(2) 진입후에 20봉이 경과해도 청산이 되지 않는 경우, 손절/익절을 각 각 10틱으로 변경하고,
그 이후에 또 20봉이 경과해도 청산이 되지 않으면 현재가에 청산한다.
위 수식을 예스랭귀지와 예스스팟 두가지로 설정이 가능하다면 각 각 부탁드리겠습니다.
감사합니다.
다음글
이전글