예스스탁
예스스탁 답변
2021-01-06 15:09:12
안녕하세요
예스스탁입니다.
1번식
if Condition3 == true or Condition2 == true or Condition1 == true Then
{
if Condition4 == False Then
Buy("매수4",AtLimit,LP*0.97);
if Condition4 == true and Condition5 == False Then
Buy("매수5",AtLimit,LP*0.95);
if Condition4 == true and Condition5 == true and Condition6 == False Then
Buy("매수6",AtLimit,LP*0.90);
}
2번식
if Condition3 == true and Condition2 == true and Condition1 == true Then
{
if Condition4 == False Then
Buy("매수4",AtLimit,LP*0.97);
if Condition4 == true and Condition5 == False Then
Buy("매수5",AtLimit,LP*0.95);
if Condition4 == true and Condition5 == true and Condition6 == False Then
Buy("매수6",AtLimit,LP*0.90);
}
위 내용을 보시면
1번식은
Condition3 == true or Condition2 == true or Condition1 == true
와 같이 or로 작성되어서 매수1,매수2,매수3 중 하나라도 진입하면 매수4,매수5,매수6이 동작하게 되어 있고
2번식은
Condition3 == true and Condition2 == true and Condition1 == true
와 같이 and로 작성되어서 매수1,매수2,매수3이 모두 진입하고 매수4,매수5,매수6이 동작하게 되어 있습니다.
즐거운 하루되세요
> 쭈니오빠 님이 쓴 글입니다.
> 제목 : 시스템 수정
> 자주 질문드려 죄송합니다
수정해주신 수식을 확인해보니 제가 의도한대로 적용되고 있는것 같습니다
그런데 아래의 올려주신 수식이 1번식과 2번식이 있는데요
수식을 여러차례 확인해보아도 차이점이 없는것 같아
다시한번 질문드려봅니다.
확인부탁드리면 감사하겠습니다
------------------------------------------------
안녕하세요
예스스탁입니다.
1번식은 매수1,매수2,매수3 중에 한개이상 진입하고
최저가 진입가에서 3%,5%,10%에서 매수4,매수5,매수6으로 추가 진입합니다.
만약 매수1,매수2,매수3이 모두 진입한 이후에
3개진입의 최저가에서 3%,5%,10%에서 매수4,매수5,매수6으로 추가 진입을 원하시면
2번식 이용하시면 됩니다.
1
INPUT : 매수(0), 매도조건(1);
var : cond(False),LP(0);
var1 = ma(C,3);
var2 = ma(C,5);
var3 = ma(C,10);
var4 = ma(C,60);
value1 = 0;
if value1 == 0 and C < Var4 and CrossDown(c,var3) and cond == False Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then
{
value1 = 1;
Buy("매수3");
}
}
if value1 == 0 and C < var4 and CrossDown(c,var2) and cond == False Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then
{
value1 = 1;
Buy("매수2");
}
}
if value1 == 0 and C < Var4 and CrossDown(c,var1) and cond == False Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then
{
value1 = 1;
Buy("매수1");
}
}
if MarketPosition == 1 Then
{
if 매수 == 1 Then
Cond = true;
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수1" Then
{
if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then
LP = LatestEntryPrice(0);
Condition1 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then
{
if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then
LP = LatestEntryPrice(0);
Condition2 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수3" Then
{
if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then
LP = LatestEntryPrice(0);
Condition3 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수4" Then
{
Condition4 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수5" Then
{
Condition5 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수6" Then
{
Condition6 = true;
}
if Condition3 == true or Condition2 == true or Condition1 == true Then
{
if Condition4 == False Then
Buy("매수4",AtLimit,LP*0.97);
if Condition4 == true and Condition5 == False Then
Buy("매수5",AtLimit,LP*0.95);
if Condition4 == true and Condition5 == true and Condition6 == False Then
Buy("매수6",AtLimit,LP*0.90);
}
if 매도조건 == 1 Then
{
ExitLong("bx1",AtLimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*0.2),1);
ExitLong("bx2",AtLimit,AvgEntryPrice*1.08,"",Floor(MaxContracts*0.5),1);
ExitLong("bx3",AtLimit,AvgEntryPrice*1.10);
}
if 매도조건 == 2 Then
{
ExitLong("bx",AtLimit,AvgEntryPrice*1.15);
}
}
Else
{
LP = 0;
Condition1 = False;
Condition2 = False;
Condition3 = False;
Condition4 = False;
Condition5 = False;
Condition6 = False;
}
2
INPUT : 매수(0), 매도조건(1);
var : cond(False),LP(0);
var1 = ma(C,3);
var2 = ma(C,5);
var3 = ma(C,10);
var4 = ma(C,60);
value1 = 0;
if value1 == 0 and C < Var4 and CrossDown(c,var3) and cond == False Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then
{
value1 = 1;
Buy("매수3");
}
}
if value1 == 0 and C < var4 and CrossDown(c,var2) and cond == False Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then
{
value1 = 1;
Buy("매수2");
}
}
if value1 == 0 and C < Var4 and CrossDown(c,var1) and cond == False Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then
{
value1 = 1;
Buy("매수1");
}
}
if MarketPosition == 1 Then
{
if 매수 == 1 Then
Cond = true;
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수1" Then
{
if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then
LP = LatestEntryPrice(0);
Condition1 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then
{
if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then
LP = LatestEntryPrice(0);
Condition2 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수3" Then
{
if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then
LP = LatestEntryPrice(0);
Condition3 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수4" Then
{
Condition4 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수5" Then
{
Condition5 = true;
}
if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수6" Then
{
Condition6 = true;
}
if Condition3 == true and Condition2 == true and Condition1 == true Then
{
if Condition4 == False Then
Buy("매수4",AtLimit,LP*0.97);
if Condition4 == true and Condition5 == False Then
Buy("매수5",AtLimit,LP*0.95);
if Condition4 == true and Condition5 == true and Condition6 == False Then
Buy("매수6",AtLimit,LP*0.90);
}
if 매도조건 == 1 Then
{
ExitLong("bx1",AtLimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*0.2),1);
ExitLong("bx2",AtLimit,AvgEntryPrice*1.08,"",Floor(MaxContracts*0.5),1);
ExitLong("bx3",AtLimit,AvgEntryPrice*1.10);
}
if 매도조건 == 2 Then
{
ExitLong("bx",AtLimit,AvgEntryPrice*1.15);
}
}
Else
{
LP = 0;
Condition1 = False;
Condition2 = False;
Condition3 = False;
Condition4 = False;
Condition5 = False;
Condition6 = False;
}