예스스탁
예스스탁 답변
2021-07-20 10:56:23
안녕하세요
예스스탁입니다.
input : 금액1(1000000),금액2(2000000),금액3(3000000),금액4(4000000);
var : mav1(0),mav2(0),mav3(0),mav4(0),idx(0);
mav1 = ma(c,20);
mav2 = ma(C,40);
mav3 = ma(C,60);
mav4 = ma(C,10);
if Bdate != Bdate[1] Then
{
Condition1 = False;
Condition2 = False;
Condition3 = False;
Condition4 = False;
}
if MarketPosition == 0 and Condition1 == False and CrossDown(C , mav1) Then
{
Buy("1차",AtStop,DEF,Floor(금액1/C));
}
if (Condition1 == true and Condition2 == False) and
(MarketPosition == 0 or (MaxEntries == 1 and Condition2 == False)) and
crossDown(C , mav2) Then
Buy("2차",AtStop,DEF,Floor(금액2/C));
if (Condition1 == true and Condition2 == true and Condition3 == False) and
(MarketPosition == 0 or (MaxEntries == 2 and Condition3 == False)) and
crossDown(C , mav2) Then
Buy("3차",AtStop,DEF,Floor(금액3/C));
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
idx = Index;
if LatestEntryName(0) == "1차" Then
Condition1 = False;
if LatestEntryName(0) == "2차" Then
Condition2 = False;
if LatestEntryName(0) == "3차" Then
Condition3 = False;
if LatestEntryName(0) == "4차" Then
Condition4 = False;
}
ExitLong("bp",AtLimit,AvgEntryPrice*1.10);
if MaxEntries >= 2 Then
ExitLong("bx",AtLimit,AvgEntryPrice*1.10);
if CurrentEntries == 3 and idx > 0 and Index <= idx+20 and c > mav4 and Condition4 == False Then
Buy("4차",AtStop,DEF,Floor(금액4/C));
}
즐거운 하루되세요
> 하늘북 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 문의 드립니다. 늘 감사합니다.
수정 부탁 드립니다.
아래 수식에서 1차 매수 후 청산이 되면, 더 이상 1차는 진입하지 않고,
2차부터 진입하도록 수정 부탁 드립니다.
2차도 진입 후 청산이 되버리면 더 이상 2차는 진입하지 않고 3차가 진입 되도록 부탁드립니다.
1차가 청산되지 않고, 2차 진입구간에 들어오면 2차도 진입, 이후 3차까지 순차적으로
전부 진입되게 부탁드립니다.
또 금액을 1차에는 100000만, 2차에는 200000만, 3차에는 300000만 이렇게 따로 들어가게 수정 부탁 드립니다.
*** 추가로 각 차수별(1차, 2차, 3차) 조건(CrossDown(C , mav1))이 만족된 후 20봉이네 종가가 10 이평위에 있으면 매수 하는것도 만들어 주시면 감사하겠습니다.
input : 금액(1000000);
var : mav1(0),mav2(0),mav3(0);
mav1 = ma(c,20);
mav2 = ma(C,40);
mav3 = ma(C,60);
mav4 = ma(C,10);
if MarketPosition == 0 and CrossDown(C , mav1) Then
Buy("1차",AtStop,DEF,Floor((금액*(1/3))/C));
if MarketPosition == 1 Then
{
if MaxEntries == 1 and CrossDown(C , mav2) Then
Buy("2차",AtStop,DEF,Floor((금액*(1/3))/C));
if MaxEntries == 2 and CrossDown(C , mav3) Then
Buy("3차",AtStop,DEF,Floor((금액*(1/3))/C));
ExitLong("bp",AtLimit,AvgEntryPrice*1.10);
if MaxEntries >= 2 Then
ExitLong("bx",AtLimit,AvgEntryPrice*1.10);
}