예스스탁
예스스탁 답변
2025-10-02 14:55:22.0
안녕하세요
예스스탁입니다.
input : time1(070000),time2(070600),time3(030000);
var : TF(0),HH(0),LL(0),B1(0),S1(0);
if (sdate != sDate[1] and sTime >= time1) or
(sdate == sDate[1] and sTime >= time1 and sTime[1] < time1) Then
{
TF = 1;
HH = H;
LL = L;
}
if TF == 1 Then
{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
if (sdate != sDate[1] and sTime >= time2) or
(sdate == sDate[1] and sTime >= time2 and sTime[1] < time2) Then
{
TF = 2;
B1 = 0;
S1 = 0;
}
if (sdate != sDate[1] and sTime >= time3) or
(sdate == sDate[1] and sTime >= time3 and sTime[1] < time3) Then
{
TF = 3;
if MarketPosition == 1 Then
ExitLong("시간종료1");
if MarketPosition == -1 Then
ExitShort("시간종료2");
}
if TF == 2 Then
{
if MarketPosition == 0 and CrossUp(C,HH) and B1 < 1 Then
{
B1 = B1+1;
Buy("매수1",OnClose,Def,3);
}
if MarketPosition == 0 and CrossDown(C,LL) and S1 < 1 Then
{
S1 = S1+1;
Sell("매도1",OnClose,Def,3);
}
}
if MarketPosition == 1 Then
{
ExitLong("매수익절1",AtLimit,EntryPrice+PriceScale*100,"매수1",1,1);
ExitLong("매수익절2",AtLimit,EntryPrice+PriceScale*200,"매수1",1,1);
ExitLong("매수익절3",AtLimit,EntryPrice+PriceScale*300,"매수1",1,1);
if CrossDown(C,LL) Then
ExitLong("저점이탈손절",OnClose,Def,"매수1");
}
If MarketPosition == -1 Then
{
ExitShort("매도익절1",AtLimit,EntryPrice-PriceScale*100,"매도1",1,1);
ExitShort("매도익절2",AtLimit,EntryPrice-PriceScale*200,"매도1",1,1);
ExitShort("매도익절3",AtLimit,EntryPrice-PriceScale*300,"매도1",1,1);
if CrossUp(C,HH) Then
ExitShort("고점돌파손절",OnClose,Def,"매도1");
}
즐거운 명절 되시기 바랍니다.
> kjdkdh 님이 쓴 글입니다.
> 제목 : 수정좀 부탁합니다
> input : time1(070000),time2(070600),time3(030000);
var : TF(0),HH(0),LL(0);
if (sdate != sDate[1] and sTime >= time1) or
(sdate == sDate[1] and sTime >= time1 and sTime[1] < time1) Then
{
TF = 1;
HH = H;
LL = L;
}
if TF == 1 Then
{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
if (sdate != sDate[1] and sTime >= time2) or
(sdate == sDate[1] and sTime >= time2 and sTime[1] < time2) Then
{
TF = 2;
}
if (sdate != sDate[1] and sTime >= time3) or
(sdate == sDate[1] and sTime >= time3 and sTime[1] < time3) Then
{
TF = 3;
if MarketPosition == 1 Then
ExitLong("btx");
if MarketPosition == -1 Then
ExitShort("stx");
}
if TF == 2 Then
{
if MarketPosition == 0 and CrossUp(C,HH) Then
Buy("b",OnClose,Def,1);
if MarketPosition == 0 and CrossDown(C,LL) Then
Sell("s",OnClose,Def,1);
}
if MarketPosition == 1 Then
{
ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*100,"b");
}
If MarketPosition == -1 Then
{
ExitShort("Sp1",AtLimit,EntryPrice-PriceScale*100,"s");
}
수정좀 부탁드립니다
게시글 번호 참조 하시면서 해주셨으면 합니다 94518
질문 1
buy 한글 매수1 로
sell 한글 매도2 로
ExitLong 한글 시간종료1 로
ExitShort 한글 시간종료2 로
질문2
추후 매수2 매수3 도 추가할 생각입니다 참고 해서 수정부탁합니다
매수1 매도 1은 장시작하면 딱 한번씩만(각각) 나오게 부탁합니다(손절이든 수익이든)
질문3
한번에 3계약 매매 들어갑니다
매수1 또는 매도1 수익시
100틱 청산 200틱 청산 300틱 청산 이렇게 1계약시 청산 부탁합니다 (이 식은 매수1 매도1 에만 해당합니다)
질문 4
고점매수시 저점이탈시 손절
저점 매도시 고점돌파시 손절 (이 역시 매수1 매도2 에서만 적용됩니다)
부탁드리고 감사합니다