안녕하세요?
늘 고맙습니다.
아래 수식에 1차에 500000만, 2차에 1000000만이 매수 될 수 있도록 수정 부탁드립니다.
그리고 청산에서 3% 수익후 3% 하락시 청산식 하나더 부탁드립니다.
input : ntime1(151700),ntime2(090500);
var1 = ma(C,20);
Var2 = ma(C,120);
Var3 = ma(C,2);
if (sdate != sdate[1] and stime >= ntime1) or
(sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then
{
if MarketPosition == 0 and sTime >= 093000 and sTime[1] < 093100 and var1 > Var2 Then
Buy("1차");
}
if (sdate != sdate[1] and stime >= ntime2) or
(sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then
{
if MarketPosition == 1 and MaxEntries == 1 and BarsSinceEntry(0) < 10 and C < Var2 Then
Buy("2차");
ExitLong("bx1",atlimit,AvgEntryPrice*1.08);
}
{
if CrossUP(var3,Var2)Then
Sell("청산");
}
답변 1
예스스탁
예스스탁 답변
2021-05-28 12:44:28
안녕하세요
예스스탁입니다.
input : ntime1(151700),ntime2(090500);
input : M1(500000),M2(1000000);
var1 = ma(C,20);
Var2 = ma(C,120);
Var3 = ma(C,2);
if (sdate != sdate[1] and stime >= ntime1) or
(sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then
{
if MarketPosition == 0 and sTime >= 093000 and sTime[1] < 093100 and var1 > Var2 Then
Buy("1차",OnClose,def,Floor(M1/C));
}
if (sdate != sdate[1] and stime >= ntime2) or
(sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then
{
if MarketPosition == 1 and MaxEntries == 1 and BarsSinceEntry(0) < 10 and C < Var2 Then
Buy("2차",OnClose,def,Floor(M1/C));
ExitLong("bx1",atlimit,AvgEntryPrice*1.08);
}
{
if CrossUP(var3,Var2)Then
ExitLong("청산");
}
if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice*1.03 Then
ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.97);
즐거운 하루되세요
> 하늘북 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 안녕하세요?
늘 고맙습니다.
아래 수식에 1차에 500000만, 2차에 1000000만이 매수 될 수 있도록 수정 부탁드립니다.
그리고 청산에서 3% 수익후 3% 하락시 청산식 하나더 부탁드립니다.
input : ntime1(151700),ntime2(090500);
var1 = ma(C,20);
Var2 = ma(C,120);
Var3 = ma(C,2);
if (sdate != sdate[1] and stime >= ntime1) or
(sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then
{
if MarketPosition == 0 and sTime >= 093000 and sTime[1] < 093100 and var1 > Var2 Then
Buy("1차");
}
if (sdate != sdate[1] and stime >= ntime2) or
(sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then
{
if MarketPosition == 1 and MaxEntries == 1 and BarsSinceEntry(0) < 10 and C < Var2 Then
Buy("2차");
ExitLong("bx1",atlimit,AvgEntryPrice*1.08);
}
{
if CrossUP(var3,Var2)Then
Sell("청산");
}