예스스탁
예스스탁 답변
2020-09-01 10:47:30
안녕하세요
예스스탁입니다.
input : StartTime(83000),EndTime(053000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if Tcond == true Then
{
if MarketPosition == 0 and
CountIf(C>O and C>C[1],4) == 4 Then
{
Buy();
var1 = O[1];
Var2 = O[3];
}
if MarketPosition == 1 Then
{
if CountIf(C>O,BarsSinceEntry) < 2 Then
ExitLong("bx1",AtStop,var1);
if CountIf(C>O,BarsSinceEntry) == 2 Then
ExitLong("bx2",AtStop,EntryPrice);
if CountIf(C>O,BarsSinceEntry) >= 3 Then
ExitLong("bx3",AtStop,Var2);
if Highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*60 Then
ExitLong("bx4",AtStop,Highest(H,BarsSinceEntry)-(Highest(H,BarsSinceEntry)-EntryPrice)*0.5);
}
if MarketPosition == 0 and
CountIf(C<O and C<C[1],4) == 4 Then
{
Sell();
var3 = O[1];
Var4 = O[3];
}
if MarketPosition == -1 Then
{
if CountIf(C<O,BarsSinceEntry) < 2 Then
ExitShort("sx1",AtStop,var3);
if CountIf(C<O,BarsSinceEntry) == 2 Then
ExitShort("sx2",AtStop,EntryPrice);
if CountIf(C<O,BarsSinceEntry) >= 3 Then
ExitShort("sx3",AtStop,Var4);
if lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*60 Then
ExitShort("sx4",AtStop,lowest(l,BarsSinceEntry)-(EntryPrice-Lowest(L,BarsSinceEntry))*0.5);
}
}
if sdate != sdate[1] Then
SetStopEndofday(054000);
if bdate != bdate[1] Then
SetStopEndofday(0);
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 수식 수정 부탁드립니다.
> 작성해 주신 아래 수식이 정상적으로 작동하지 않습니다.
수정을 부탁드립니다.
안녕하세요
예스스탁입니다.
input : StartTime(83000),EndTime(053000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if Tcond == true Then
{
if MarketPosition == 0 and
CountIf(C>O and C>C[1],4) == 4 Then
{
Buy();
var1 = O[1];
Var2 = O[3];
}
if MarketPosition == 1 Then
{
if CountIf(C>O,BarsSinceEntry) < 2 Then
ExitLong("bx1",AtStop,var1);
if CountIf(C>O,BarsSinceEntry) == 2 Then
ExitLong("bx2",AtStop,EntryPrice);
if CountIf(C>O,BarsSinceEntry) >= 3 Then
ExitLong("bx3",AtStop,Var2);
if Highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*60 Then
ExitLong("bx4",AtStop,Highest(H,BarsSinceEntry)-(Highest(H,BarsSinceEntry)-EntryPrice)*0.5);
}
if MarketPosition == 0 and
CountIf(C<O and C<C[1],4) == 4 Then
{
Sell();
var3 = O[1];
Var4 = O[3];
}
if MarketPosition == 1 Then
{
if CountIf(C<O,BarsSinceEntry) < 2 Then
ExitShort("sx1",AtStop,var1);
if CountIf(C<O,BarsSinceEntry) == 2 Then
ExitShort("sx2",AtStop,EntryPrice);
if CountIf(C<O,BarsSinceEntry) >= 3 Then
ExitShort("sx3",AtStop,Var2);
if lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*60 Then
ExitShort("sx4",AtStop,lowest(l,BarsSinceEntry)-(EntryPrice-Lowest(L,BarsSinceEntry))*0.5);
}
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 수식 문의드립니다.
> 해외선물입니다.
무포지션시 신규 매매시간은 오후 8시 30분 부터 그 다음낭 새벽 5시 30분까지만 무포지션시 신규 매매 거래가 되게 하고
5시 40분 이후 잔고가 있으면 잔고청산합니다.
매수:
무포지션에서 전봉 종가보다 < 현재봉 종가가 큰 양봉이 연속으로 4개 발생하면
즉 최초양봉 종가< 2번째 양봉 종가 <3번째 양봉 종가<현재봉 양봉 종가
매수합니다.
매수 손절과 청산 :
매수후 양봉이 2개 발생 하기전에 종가가 아닌 현재가가 위의 3번째 양봉의 시가를 깨면 손절합니다.
또
매수후에 양봉이 2개 발생하면 종가가 아닌 현재가가 매수가를 깨면 손절합니다.
또
매수후에 양봉이 3개 발생하면 종가가 아닌 현재가가 매수후에 최초양봉의 시가를 깨면 청산합니다.
매수 익절 :
매수후 수익이 60틱 이상이 나면 최고 수익 대비 50% 로 종가가 아닌 현재가가 수익이 떨어지면 익절합니다.
매도 수식도 반대논리로 똑같이 부탁드입니다.