예스스탁
예스스탁 답변
2023-10-18 16:29:00
안녕하세요
예스스탁입니다.
input : StartTime(230000),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;
}
var1 = ma(C,5);
Var2 = ma(C,20);
if MarketPosition <= 0 and CrossUp(var1,Var2) and Tcond == true Then
{
buy("b",OnClose,Def,4);
}
if MarketPosition == 1 Then
{
if MaxEntries == CurrentContracts Then
ExitLong("bx11",AtStop,EntryPrice+PriceScale*20,"",2,1);
Else
ExitLong("bx12",AtStop,EntryPrice);
ExitLong("bx2",AtStop,L[BarsSinceEntry]);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*10Then
ExitLong("bx3",AtStop,Var2);
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요.
아래 수식에서
매수 포지션시 100틱 이상 이익이 나면 그 때부터 분봉의 저가가
20 이평선값 아래로 터치하면 청산 되도록 수정을 부탁드립니다.
input : StartTime(230000),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;
}
var1 = ma(C,5);
Var2 = ma(C,20);
if MarketPosition <= 0 and CrossUp(var1,Var2) and Tcond == true Then
{
buy("b",OnClose,Def,4);
}
if MarketPosition == 1 Then
{
if MaxEntries == CurrentContracts Then
ExitLong("bx11",AtStop,EntryPrice+PriceScale*20,"",2,1);
Else
ExitLong("bx12",AtStop,EntryPrice);
ExitLong("bx2",AtStop,L[BarsSinceEntry]);
if crossdown(C , Var2) Then
ExitLong("bx3");
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
>
아래수식을 나스닥 선물에 적용해서 오후 11시 부터 다음 날 아침 5시 30분까지만
매수진입이 되게 하고 싶습니다.
진입만 이렇게 시간제한을 두고요 . 창산은 24시간 다 작동하도록 부탁드립니다.
var1 = ma(C,5);
Var2 = ma(C,20);
if MarketPosition <= 0 and CrossUp(var1,Var2) Then
{
buy("b",OnClose,Def,4);
}
if MarketPosition == 1 Then
{
if MaxEntries == CurrentContracts Then
ExitLong("bx11",AtStop,EntryPrice+PriceScale*20,"",2,1);
Else
ExitLong("bx12",AtStop,EntryPrice);
ExitLong("bx2",AtStop,L[BarsSinceEntry]);
if crossdown(C , Var2) Then
ExitLong("bx3");