커뮤니티
부탁드립니다.
2015-07-14 17:26:57
123
글번호 88414
아래 1번 지표를 바탕으로 2번 시스템을 1번 지표가 상승중일땐 매수진입만 하락중일땐 매도진입만하도록 수정 부탁드립니다.
그리고 1번 지표가 상승중 하락으로 하락중 상승으로 바뀌면 손절처리되도록 부탁드립니다..
감사합니다.
---------------------------------------------------------------------------
- 1번 -
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
----------------------------------------------------------------------------------------
- 2번 -
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 Then
buy();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
답변 4
예스스탁 예스스탁 답변
2015-07-14 17:28:04
안녕하세요
예스스탁입니다.
상승/하락 추세선은 시세가 어느정도 반등이 있어야 반단되고 그때
과거봉부터 추세선이 그어지게 됩니다.
후행적으로 그려지는 추세선의 고점과 저점 꼭지점부터 판단이 되는 부분이 아니므로
이용에 참고하시기 바랍니다.
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0),T(0),trnd(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
if turnPntArr[1][0] == "Hi" Then
trnd = 1;
if turnPntArr[1][0] == "Lo" Then
trnd = -1;
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 and trnd == -1 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 and trnd == 1 Then
buy();
if MarketPosition == 1 and trnd == -1 Then
exitlong();
if MarketPosition == 1 and trnd == 1 Then
ExitShort();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
즐거운 하루되세요
> 매일상승 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래 1번 지표를 바탕으로 2번 시스템을 1번 지표가 상승중일땐 매수진입만 하락중일땐 매도진입만하도록 수정 부탁드립니다.
그리고 1번 지표가 상승중 하락으로 하락중 상승으로 바뀌면 손절처리되도록 부탁드립니다..
감사합니다.
---------------------------------------------------------------------------
- 1번 -
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
----------------------------------------------------------------------------------------
- 2번 -
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 Then
buy();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
매일상승
2015-07-14 17:32:42
적용해보니 매수 매도를 전혀하지 않습니다. 확인부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 부탁드립니다.
> 안녕하세요
예스스탁입니다.
상승/하락 추세선은 시세가 어느정도 반등이 있어야 반단되고 그때
과거봉부터 추세선이 그어지게 됩니다.
후행적으로 그려지는 추세선의 고점과 저점 꼭지점부터 판단이 되는 부분이 아니므로
이용에 참고하시기 바랍니다.
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0),T(0),trnd(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
if turnPntArr[1][0] == "Hi" Then
trnd = 1;
if turnPntArr[1][0] == "Lo" Then
trnd = -1;
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 and trnd == -1 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 and trnd == 1 Then
buy();
if MarketPosition == 1 and trnd == -1 Then
exitlong();
if MarketPosition == 1 and trnd == 1 Then
ExitShort();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
즐거운 하루되세요
> 매일상승 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래 1번 지표를 바탕으로 2번 시스템을 1번 지표가 상승중일땐 매수진입만 하락중일땐 매도진입만하도록 수정 부탁드립니다.
그리고 1번 지표가 상승중 하락으로 하락중 상승으로 바뀌면 손절처리되도록 부탁드립니다..
감사합니다.
---------------------------------------------------------------------------
- 1번 -
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
----------------------------------------------------------------------------------------
- 2번 -
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 Then
buy();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
예스스탁 예스스탁 답변
2015-07-14 17:39:29
안녕하세요
예스스탁입니다.
올리신 글중 2번식에
var1, var2 등이 있는데
해당 변수가 어떤 값인지 제외하고 올리셨습니다.
제외하신 변수의 내용은 직접 추가하셔야 합니다.
즐거운 하루되세요
> 매일상승 님이 쓴 글입니다.
> 제목 : Re : Re : 부탁드립니다.
> 적용해보니 매수 매도를 전혀하지 않습니다. 확인부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 부탁드립니다.
> 안녕하세요
예스스탁입니다.
상승/하락 추세선은 시세가 어느정도 반등이 있어야 반단되고 그때
과거봉부터 추세선이 그어지게 됩니다.
후행적으로 그려지는 추세선의 고점과 저점 꼭지점부터 판단이 되는 부분이 아니므로
이용에 참고하시기 바랍니다.
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0),T(0),trnd(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
if turnPntArr[1][0] == "Hi" Then
trnd = 1;
if turnPntArr[1][0] == "Lo" Then
trnd = -1;
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 and trnd == -1 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 and trnd == 1 Then
buy();
if MarketPosition == 1 and trnd == -1 Then
exitlong();
if MarketPosition == 1 and trnd == 1 Then
ExitShort();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
즐거운 하루되세요
> 매일상승 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래 1번 지표를 바탕으로 2번 시스템을 1번 지표가 상승중일땐 매수진입만 하락중일땐 매도진입만하도록 수정 부탁드립니다.
그리고 1번 지표가 상승중 하락으로 하락중 상승으로 바뀌면 손절처리되도록 부탁드립니다..
감사합니다.
---------------------------------------------------------------------------
- 1번 -
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
----------------------------------------------------------------------------------------
- 2번 -
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 Then
buy();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
매일상승
2015-07-14 17:59:16
2번에 전체내용은 이렇습니다.
- 2번 -
var : T(0);
var1 = ma(c,30);
var2 = ma(C,39);
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 Then
buy();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : Re : Re : 부탁드립니다.
> 안녕하세요
예스스탁입니다.
올리신 글중 2번식에
var1, var2 등이 있는데
해당 변수가 어떤 값인지 제외하고 올리셨습니다.
제외하신 변수의 내용은 직접 추가하셔야 합니다.
즐거운 하루되세요
> 매일상승 님이 쓴 글입니다.
> 제목 : Re : Re : 부탁드립니다.
> 적용해보니 매수 매도를 전혀하지 않습니다. 확인부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 부탁드립니다.
> 안녕하세요
예스스탁입니다.
상승/하락 추세선은 시세가 어느정도 반등이 있어야 반단되고 그때
과거봉부터 추세선이 그어지게 됩니다.
후행적으로 그려지는 추세선의 고점과 저점 꼭지점부터 판단이 되는 부분이 아니므로
이용에 참고하시기 바랍니다.
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0),T(0),trnd(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
if turnPntArr[1][0] == "Hi" Then
trnd = 1;
if turnPntArr[1][0] == "Lo" Then
trnd = -1;
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 and trnd == -1 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 and trnd == 1 Then
buy();
if MarketPosition == 1 and trnd == -1 Then
exitlong();
if MarketPosition == 1 and trnd == 1 Then
ExitShort();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);
즐거운 하루되세요
> 매일상승 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래 1번 지표를 바탕으로 2번 시스템을 1번 지표가 상승중일땐 매수진입만 하락중일땐 매도진입만하도록 수정 부탁드립니다.
그리고 1번 지표가 상승중 하락으로 하락중 상승으로 바뀌면 손절처리되도록 부탁드립니다..
감사합니다.
---------------------------------------------------------------------------
- 1번 -
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,52) == H and lastHiVal <> H;
Condition2 = Lowest(L,52) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
Tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2));
Text_SetStyle(tx,2,2);
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1[1],3);
TL_SetColor(TL1[1],RGB(20,255,255));
----------------------------------------------------------------------------------------
- 2번 -
if var2[1]>var2[0] and
OPEN[0]>var1 and
OPEN[0]>CLOSE[0] Then
T = -1;
if var2[1]<var2[0] and
OPEN[0]<var1 and
OPEN[0]<CLOSE[0] Then
T = 1;
if MarketPosition == 0 and T == -1 and countif(T == T[1],3) == 3 Then
sell();
if MarketPosition == 0 and T == 1 and countif(T == T[1],3) == 3 Then
buy();
SetStopProfittarget(PriceScale*80,PointStop);
SetStopLoss(PriceScale*100,PointStop);