예스스탁
예스스탁 답변
2021-10-05 16:23:39
안녕하세요
예스스탁입니다.
1
input : StartTime(101500),EndTime(120000);
input : Length(20), D1(2);
var : Tcond(false);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o then
Buy("b",OnClose,DEF,2);
If CrossDown(L,Var2) and C < O then
Sell("s",OnClose,DEF,2);
}
if MarketPosition == 1 Then
{
ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*10);
}
if MarketPosition == -1 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then
ExitShort("str",AtStop,EntryPrice+PriceScale*10);
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2
24시는 0시 입니다.
input : StartTime(223000),EndTime(0);
input : Length(20), D1(2);
var : Tcond(false);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o then
Buy("b",OnClose,DEF,2);
If CrossDown(L,Var2) and C < O then
Sell("s",OnClose,DEF,2);
}
if MarketPosition == 1 Then
{
ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*10);
}
if MarketPosition == -1 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then
ExitShort("str",AtStop,EntryPrice+PriceScale*10);
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
즐거운 하루되세요
> 에리카 님이 쓴 글입니다.
> 제목 : 문의
> 수식 요청 내용
Input : Length(20), D1(2);
# 매수/매도청산
If CrossUP(H,BollBandUp(20, 2)) then
Buy();
# 매도/매수청산
If CrossDown(L,BollBandDown(20, 2)) then
Sell();
1. 항셍(오전 10시 15분 ~ 오전 12시), 나스닥(22시 30분 ~ 24시) 거래시간 지정
2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함)
3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함)
4. 매수와 매도, 모두 2계약을 진입합니다.
1계약은 익절 50틱 종료.
남은 1계약은 익절 100틱 종료.
만약 남은 1계약이 51틱 이상 상승했다가 100틱 익절 되지 못하고
방향이 바뀌었을 시 10틱 익절로 종료.
5. 2계약의 손절은 30틱.
6. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함.
위 내용에 대한 수식 답변 부탁드립니다.