커뮤니티
문의드립니다.
2018-05-30 01:57:16
132
글번호 119343
수정해 주신 식으로 진입이 없습니다. 수치 조정하여 보아도 진입이 없습니다.
확인 부탁드립니다.
input : P1(3),P2(10),P3(180);
var : mav2(0),mav3(0);
input : 익절1(100),익절1하락(50),손절(80);
var : BH(0),SL(0),HE(0),LE(0);
input : 시작시간(1016000), 종료시간(004000);
var : Tcond(False);
var : UpCount(0), UpPrice(0);
var : DnCount(0), DnPrice(0);
mav2 = ma(c,P2);
mav3 = ma(c,P3);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
UpCount = 0;
DnCount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
if Tcond == true Then
{
if crossup(mav2,mav3) Then
{
UpPrice = C;
UpCount = UpCount+1;
if UpCount == 0 or (UpCount > 0 and abs(C-UpPrice) >= PriceScale*50) Then
buy("Buy");
}
if CrossDown(mav2,mav3) Then
{
DnPrice = C;
DnCount = DnCount+1;
if DnCount == 0 or (DnCount > 0 and abs(C-DnPrice) >= PriceScale*50) Then
sell("Sell");
}
}
//청산
if MarketPosition == 1 Then
{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice+PriceScale*익절1 Then
{
ExitLong("B익절1",AtStop,BH-PriceScale*익절1하락);
}
ExitLong("B손절",AtStop,HE-PriceScale*손절);
}
if MarketPosition == -1 Then
{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice-PriceScale*익절1 Then
{
ExitShort("S익절1",AtStop,SL+PriceScale*익절1하락);
}
ExitShort("S손절",AtStop,LE+PriceScale*손절);
}
- 1. 119930_문의.jpg (0.30 MB)
답변 1
예스스탁 예스스탁 답변
2018-05-30 15:16:42
안녕하세요
예스스탁입니다
카운트 지정이 잘못되어 수정했습니다.
시간도 6자리로 지정하셔야 합니다.
외부변수 시작시간이 7자리라 수정했습니다.
input : P1(3),P2(10),P3(180);
var : mav2(0),mav3(0);
input : 익절1(100),익절1하락(50),손절(80);
var : BH(0),SL(0),HE(0),LE(0);
input : 시작시간(101600), 종료시간(004000);
var : Tcond(False);
var : UpCount(0), UpPrice(0);
var : DnCount(0), DnPrice(0);
mav2 = ma(c,P2);
mav3 = ma(c,P3);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
UpCount = 0;
DnCount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
if Tcond == true Then
{
if crossup(mav2,mav3) Then
{
UpPrice = C;
UpCount = UpCount+1;
if UpCount == 1 or (UpCount > 1 and abs(C-UpPrice) >= PriceScale*50) Then
buy("Buy");
}
if CrossDown(mav2,mav3) Then
{
DnPrice = C;
DnCount = DnCount+1;
if DnCount == 1 or (DnCount > 1 and abs(C-DnPrice) >= PriceScale*50) Then
sell("Sell");
}
}
//청산
if MarketPosition == 1 Then
{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice+PriceScale*익절1 Then
{
ExitLong("B익절1",AtStop,BH-PriceScale*익절1하락);
}
ExitLong("B손절",AtStop,HE-PriceScale*손절);
}
if MarketPosition == -1 Then
{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice-PriceScale*익절1 Then
{
ExitShort("S익절1",AtStop,SL+PriceScale*익절1하락);
}
ExitShort("S손절",AtStop,LE+PriceScale*손절);
}
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 수정해 주신 식으로 진입이 없습니다. 수치 조정하여 보아도 진입이 없습니다.
확인 부탁드립니다.
input : P1(3),P2(10),P3(180);
var : mav2(0),mav3(0);
input : 익절1(100),익절1하락(50),손절(80);
var : BH(0),SL(0),HE(0),LE(0);
input : 시작시간(1016000), 종료시간(004000);
var : Tcond(False);
var : UpCount(0), UpPrice(0);
var : DnCount(0), DnPrice(0);
mav2 = ma(c,P2);
mav3 = ma(c,P3);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
UpCount = 0;
DnCount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
if Tcond == true Then
{
if crossup(mav2,mav3) Then
{
UpPrice = C;
UpCount = UpCount+1;
if UpCount == 0 or (UpCount > 0 and abs(C-UpPrice) >= PriceScale*50) Then
buy("Buy");
}
if CrossDown(mav2,mav3) Then
{
DnPrice = C;
DnCount = DnCount+1;
if DnCount == 0 or (DnCount > 0 and abs(C-DnPrice) >= PriceScale*50) Then
sell("Sell");
}
}
//청산
if MarketPosition == 1 Then
{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice+PriceScale*익절1 Then
{
ExitLong("B익절1",AtStop,BH-PriceScale*익절1하락);
}
ExitLong("B손절",AtStop,HE-PriceScale*손절);
}
if MarketPosition == -1 Then
{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice-PriceScale*익절1 Then
{
ExitShort("S익절1",AtStop,SL+PriceScale*익절1하락);
}
ExitShort("S손절",AtStop,LE+PriceScale*손절);
}
다음글