예스스탁
예스스탁 답변
2021-06-22 09:58:34
안녕하세요
예스스탁입니다.
price1 = dayopen*0.97;
price2 = dayopen*0.94;
price3 = dayopen*0.91;
if sTime >= 130000 or DayClose(1) >= 상한가1 Then
{
price1 = dayopen*0.94;
price2 = dayopen*0.91;
price3 = 0;
}
13시 이후나 전일상한가이면 1타점은 시가*0.96, 2타점은 시가*0.91,
3타점은 0을 만들어 사용하지 않게 수정해 드립니다.
var : entry(0),AP(0);
var : Price1(0),Price2(0),Price3(0);
var : 상한가(0),상한가1(0),UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
if CodeCategory() == 2 then
{
if date >= 20030721 then
{
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
up7 = int(UpLimit/1+0.00001)*1;
}
}
Else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then
{
if sdate < 20101004 Then
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if c[1] >= 상한가[1] and L <= O*0.90 Then
var1 = sDate;
if Bdate != Bdate[1] Then
{
entry = 0;
상한가1 = 상한가[1];
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
price1 = dayopen*0.97;
price2 = dayopen*0.94;
price3 = dayopen*0.91;
if sTime >= 130000 or DayClose(1) >= 상한가1 Then
{
price1 = dayopen*0.94;
price2 = dayopen*0.91;
price3 = 0;
}
if price1 > 0 and MarketPosition == 0 then
{
if entry == 0 or
(entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("Bp1",1) == true) Then
Buy("b1",AtLimit,price1);
}
if Price2 > 0 Then
{
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("Bp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("b2",AtLimit,price2);
}
if Price3 > 0 Then
{
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("b1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b2") == true) Then
Buy("b3",AtLimit,price3);
}
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if MaxEntries == 1 and IsEntryName("b1") == true Then
{
ExitLong("bp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx1");
}
if (MaxEntries == 2 and IsEntryName("b1") == true) or
(MaxEntries == 1 and IsEntryName("b2") == true) Then
{
ExitLong("bp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx2");
}
if (MaxEntries == 3 and IsEntryName("b1") == true) or
(MaxEntries == 2 and IsEntryName("b2") == true) Then
{
ExitLong("bp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx3");
}
ExitLong("bl",AtStop,DayOpen*0.88);
}
SetStopEndofday(151800);
즐거운 하루되세요
> 맴맴잉 님이 쓴 글입니다.
> 제목 : 시스템식 문의 드립니다.
> 예전에 요청드렸던 시스템 식입니다.
여기에 추가적인 조건을 넣고 싶은데 계속 실패해서 이렇게 요청드리게 되었습니다.
위 그림에도 적혀있다 시피
1차 매수 타점은 당일 시가 X 0.97 (-3%)하락했을 경우 인데
전일 상한가를 쳤을 경우 또는 당일 오후 1시 이후 에는
1차 매수 타점이 당일 시가 X 0.94 (-6 %)
이 되록 바꾸고 싶습니다.
지난번에 요청드린 시스템식도 같이 올려드리오니 부탁드리겠습니다.
항상 감사드리고 있습니다.
----------------------------------------------
var : entry(0),AP(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 Then
{
if entry == 0 or
(entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("Bp1",1) == true) Then
Buy("b1",AtLimit,DayOpen*0.97);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("Bp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("b2",AtLimit,DayOpen*0.94);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("b1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b2") == true) Then
Buy("b3",AtLimit,DayOpen*0.91);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if MaxEntries == 1 and IsEntryName("b1") == true Then
{
ExitLong("bp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx1");
}
if (MaxEntries == 2 and IsEntryName("b1") == true) or
(MaxEntries == 1 and IsEntryName("b2") == true) Then
{
ExitLong("bp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx2");
}
if (MaxEntries == 3 and IsEntryName("b1") == true) or
(MaxEntries == 2 and IsEntryName("b2") == true) Then
{
ExitLong("bp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx3");
}
ExitLong("bl",AtStop,DayOpen*0.88);
}
SetStopEndofday(151800);
-----------------------------------------------------------------------------