예스스탁
예스스탁 답변
2025-03-12 14:42:33
안녕하세요
예스스탁입니다.
기존식은 첫번째 진입가-50틱 이하에서 색상변경이면 추가진입하게 되어 있었습니다.
첫진입이 아닌 직전 진입가 기준으로 변경해 드립니다.
input : len(20),len2(20);
var : oo(0),cc(0),hh(0),ll(0),col(0);
var : haclose(0),haopen(0),hahigh(0),halow(0);
var : o2(0),h2(0),l2(0),c2(0);
oo=ema(open,len);
cc=ema(close,len);
hh=ema(high,len);
ll=ema(low,len);
haclose = (oo+hh+ll+cc)/4;
haopen = iff(IsNaN(haopen[1]) == true, (oo + cc)/2 , (haopen[1] + haclose[1]) / 2);
hahigh = max (hh, max(haopen,haclose));
halow = min (ll, min(haopen,haclose));
o2=ema(haopen, len2);
c2=ema(haclose, len2);
h2=ema(hahigh, len2);
l2=ema(halow, len2);
col=iff(o2>c2 , red , lime);
##============================================================================================================
##============================================================================================================
input : StartTime(080000),EndTime(220000);
var : Tcond(False);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
##============================================================================================================
Input : Period(60);
var : TSF(0),vol(0);
TSF = LRL(C,Period)+LRS(C,Period);
##============================================================================================================
{
##============================================================================================================
## 매수식
If MarketPosition >= 0 and sDate >= 20230101 and Tcond == true and stime >= 072000 and stime <= 220000 and CrossUp(TSF, TSF[8]) Then
{
Buy( "수");
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
##============================================================================================================
##============================================================================================================
## 매도식
If MarketPosition <= 0 and sDate >= 20230101 and Tcond == true and stime >= 072000 and stime <= 220000 and CrossDown(TSF, TSF[8]) Then
{
Sell( "도");
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
##============================================================================================================
##============================================================================================================
}
##============================================================================================================
##============================================================================================================
## 매수 청산식
if MarketPosition == 1 then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
vol = 1;
Else
vol = CurrentContracts-CurrentContracts[1];
}
if col != col[1] and MaxEntries < 5 and C <= LatestEntryPrice(0)-PriceScale*50 Then
Buy("bb",OnClose,Def,vol*2);
if MaxEntries == 1 Then
ExitLong("수수익1",AtLimit,avgEntryPrice+PriceScale*35);
Else
ExitLong("수수익2",AtLimit,avgEntryPrice+(PriceScale*50)/CurrentContracts);
}
##============================================================================================================
##============================================================================================================
## 매도 청산식
if MarketPosition == -1 then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
vol = 1;
Else
vol = CurrentContracts-CurrentContracts[1];
}
if col != col[1] and MaxEntries < 5 and C >= LatestEntryPrice(0)+PriceScale*50 Then
Sell("ss",OnClose,Def,vol*2);
if MaxEntries == 1 Then
ExitShort("도수익1",AtLimit,avgEntryPrice-PriceScale*35);
Else
ExitShort("도수익2",AtLimit,avgEntryPrice-(PriceScale*50)/CurrentContracts);
}
##============================================================================================================
##============================================================================================================
SetStopEndofday(230000);
##============================================================================================================
##============================================================================================================
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 전일 시스템 수정 좀 요청 드림니다.
> * 항상 큰 도움에 고맙 습니다.
* 전일 작성 수식중 추가 수정 좀 요청 드리겠습니다.
ㅇ요청 사항: 사진1에 보면 최대 손실이 -5.7 나오는데
진입후 손실이 -50틱 이상 이면 추가진입 5차 까지 수식 좀 수정 요청 드립니다.
ㅇ즉 최초 1계약 -50틱 이하 (색상무시) 이면 2차 추가 진입 2계약
2차 진입후 또 -50틱(2차 진입가 기준) 이면 3차 추가 진입 4계약
3차 진입후 또 -50틱(3차진입가 기준) 이면 4차 추가 진입 8계약
4차 진입후 또 -50틱(4차진입가 기준) 이면 5차 추가 진입 16계약
끝
으로 수정 좀 요청 드림니다. 죄송합니다.
##
input : len(20),len2(20);
var : oo(0),cc(0),hh(0),ll(0),col(0);
var : haclose(0),haopen(0),hahigh(0),halow(0);
var : o2(0),h2(0),l2(0),c2(0);
oo=ema(open,len);
cc=ema(close,len);
hh=ema(high,len);
ll=ema(low,len);
haclose = (oo+hh+ll+cc)/4;
haopen = iff(IsNaN(haopen[1]) == true, (oo + cc)/2 , (haopen[1] + haclose[1]) / 2);
hahigh = max (hh, max(haopen,haclose));
halow = min (ll, min(haopen,haclose));
o2=ema(haopen, len2);
c2=ema(haclose, len2);
h2=ema(hahigh, len2);
l2=ema(halow, len2);
col=iff(o2>c2 , red , lime);
##============================================================================================================
##============================================================================================================
input : StartTime(080000),EndTime(220000);
var : Tcond(False);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
##============================================================================================================
Input : Period(60);
var : TSF(0),vol(0);
TSF = LRL(C,Period)+LRS(C,Period);
##============================================================================================================
{
##============================================================================================================
## 매수식
If MarketPosition >= 0 and sDate >= 20230101 and Tcond == true and stime >= 072000 and stime <= 220000 and CrossUp(TSF, TSF[8]) Then
{
Buy( "수");
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
##============================================================================================================
##============================================================================================================
## 매도식
If MarketPosition <= 0 and sDate >= 20230101 and Tcond == true and stime >= 072000 and stime <= 220000 and CrossDown(TSF, TSF[8]) Then
{
Sell( "도");
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
##============================================================================================================
##============================================================================================================
}
##============================================================================================================
##============================================================================================================
## 매수 청산식
if MarketPosition == 1 then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
vol = 1;
Else
vol = CurrentContracts-CurrentContracts[1];
}
if col != col[1] and MaxEntries < 5 and C <= EntryPrice-PriceScale*50 Then
Buy("bb",OnClose,Def,vol*2);
if MaxEntries == 1 Then
ExitLong("수수익1",AtLimit,avgEntryPrice+PriceScale*35);
Else
ExitLong("수수익2",AtLimit,avgEntryPrice+(PriceScale*50)/CurrentContracts);
}
##============================================================================================================
##============================================================================================================
## 매도 청산식
if MarketPosition == -1 then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
vol = 1;
Else
vol = CurrentContracts-CurrentContracts[1];
}
if col != col[1] and MaxEntries < 5 and C >= EntryPrice+PriceScale*50 Then
Sell("ss",OnClose,Def,vol*2);
if MaxEntries == 1 Then
ExitShort("도수익1",AtLimit,avgEntryPrice-PriceScale*35);
Else
ExitShort("도수익2",AtLimit,avgEntryPrice-(PriceScale*50)/CurrentContracts);
}
##============================================================================================================
##============================================================================================================
SetStopEndofday(230000);
##============================================================================================================
##============================================================================================================