예스스탁
예스스탁 답변
2021-02-10 14:51:55
안녕하세요
예스스탁입니다.
input : 틱1(30),틱2(60),틱3(90),틱4(120),틱5(150);
var : T(0),L1(0),L2(0),H1(0),H2(0);
var : T1(0),T2(0),T3(0),T4(0),T5(0);
var : T11(0),T22(0),T33(0),T44(0),T55(0);
var : BL1(0),SH1(0),entry(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;
var1 = ma(C,10);
#--------------------------------------------------- 조건 1 아래로
if T <= 0 and
dayindex > 0
and countif(C<O or (C==O),2) == 2
Then
#-----------------------------------------------------조건 1 위로
{
T = 1;
L1 = l;
L2 = L1[1];
if entry < 2 Then
Sell("매도1");
if entry >= 2 and H1 <= H2 and H2 > 0 Then
Sell("매도2");
}
#-------------------------------------------------------------- 조건 2 아래로
if T >= 0 and
dayindex > 0
and countif(C>O or (C==O),2) == 2
Then
#--------------------------------------------------------------- 조건 2 위로
{
T = -1;
H1 = H;
H2 = H1[1];
if entry < 2 Then
buy("매수1");
if entry <= 2 and L1 >= L2 and L2 > 0 Then
buy("매수2");
}
if T == 1 Then
{
if L < L1 Then
L1 = L;
}
if T == -1 Then
{
if H > H1 Then
H1 = H;
}
if MarketPosition == 1 Then
{
if MarketPosition(0)[1] != 1 then
{
BL1 = L1[BarsSinceEntry];
}
Else
{
if T == -1 and T != T[1] and L1 > BL1 then
BL1 = L1;
}
ExitLong("손절 ",AtStop,BL1-PriceScale);
}
if MarketPosition == -1 then
{
if MarketPosition != MarketPosition[1] Then
{
SH1 = H1[BarsSinceEntry];
}
Else
{
if T == 1 and T != T[1] and H1 < SH1 then
SH1 = H1;
}
ExitShort("손절",AtStop,SH1);
}
if MarketPosition == 1 Then
{
if Condition11 == false and H >= EntryPrice+PriceScale*틱1 Then
{
Condition11 = true;
T1 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T1, 255);
Text_SetStyle(T1,2,1);
}
if Condition12 == false and H >= EntryPrice+PriceScale*틱2 Then
{
Condition12 = true;
T2 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T2, 14483711);
Text_SetStyle(T2,2,1);
}
if Condition13 == false and H >= EntryPrice+PriceScale*틱3 Then
{
Condition13 = true;
T3 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T3, 58623);
Text_SetStyle(T3,2,1);
}
if Condition14 == false and H >= EntryPrice+PriceScale*틱4 Then
{
Condition14 = true;
T4 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T4, 4114503);
Text_SetStyle(T4,2,1);
}
if Condition15 == false and H >= EntryPrice+PriceScale*틱5 Then
{
Condition15 = true;
T5 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T5, 16711681);
Text_SetStyle(T5,2,1);
}
}
Else
{
Condition11 = false;
Condition12 = false;
Condition13 = false;
Condition14 = false;
Condition15 = false;
}
if MarketPosition == -1 Then
{
if Condition21 == false and L <= EntryPrice-PriceScale*틱1 Then
{
Condition21 = true;
T11 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T11, 255);
Text_SetStyle(T11,2,3);
}
if Condition22 == false and L <= EntryPrice-PriceScale*틱2 Then
{
Condition22 = true;
T22 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T22, 14483711);
Text_SetStyle(T22,2,3);
}
if Condition23 == false and L <= EntryPrice-PriceScale*틱3 Then
{
Condition23 = true;
T33 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T33, 58623);
Text_SetStyle(T33,2,3);
}
if Condition24 == false and L <= EntryPrice-PriceScale*틱4 Then
{
Condition24 = true;
T44 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T44, 4114503);
Text_SetStyle(T44,2,3);
}
if Condition25 == false and L <= EntryPrice-PriceScale*틱5 Then
{
Condition25 = true;
T55 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T55, 16711681);
Text_SetStyle(T55,2,3);
}
}
Else
{
Condition21 = false;
Condition22 = false;
Condition23 = false;
Condition24 = false;
Condition25 = false;
}
즐거운 하루되세요
> kjdkdh 님이 쓴 글입니다.
> 제목 : 수정좀 부탁합니다
> 안녕하세요
재차 질문을 드립니다
우선 아래식에서 반복적으로 같은 문구를 많이 사용한듯 합니다
온전이 제가 만들것이 아니라서요 정리좀 부탁합니다
식의 면화를 주지 마시고요
질문은 매도의 경우만 하겠습니다
매수도 같은 답변부탁드립니다
질문1
아래 식을 보시면
매도은 이전조건1(1) 최고점과 현재조건1 최고점과 비교해서 같거나 낮으면 매도를
하겠금 한 식입니다
식에서 보시면 같은 부분의 기호가 빠진들 합니다
확인좀 해주세요
같은 식의 이미지는 아니지만 참고 이미지를 보시면 알듯 합니다
질문2
장 시작하면 첫번째 두번째 신호에 한해서만 조건1 이 같거나 낮거나가 아닌 조건1에 해당하면 바로 신호를 나오게 부탁합니다
세번째 네번째 에서는 아래 식대로 사용할 생각입니다
매도1 매도2 이런식으로 만들어야 하지 않나 생각이 들어요
질문3
식에서 보시면 (참고 이미지 꼭 참고 해주세요)
매수신호 나오고 직전 저점이 손절가 입니다
이 식이 틀린것은 아니지만
제가 원하는 식은
매수신호 진입하고 조건2가 나올때 마다 저점이 높아지면 손절가 역시 조건2 의 저점이 올라간만큼 손절가 역시 올라갔으면 합니다
참고로 전 매수청산색상을 사용합니다
그리고 이미지에서 빨간색 점선을 보시면 이해할듯 합니다
두번째 질문이라서 좀 자세히 적었는데 이해가 될지 모르겠네요
글이라서 좀 힘드네요
감사합니다
var : T(0),L1(0),L2(0),H1(0),H2(0);
var : T1(0),T2(0),T3(0),T4(0),T5(0),T6(0),T7(0),T8(0);
var : T11(0),T22(0),T33(0),T44(0),T55(0),T66(0),T77(0),T88(0);
var : BL1(0),SH1(0),TL(0),TX1(0);
var1 = ma(C,10);
--------------------------------------------------- 조건 1 아래로
if T <= 0 and
dayindex > 0
and countif(C<O or (C==O),2) == 2
Then
-----------------------------------------------------조건 1 위로
{
T = 1;
L1 = l;
L2 = L1[1];
if H1 < H2 and H2 > 0 Then
Sell("매도");
}
-------------------------------------------------------------- 조건 2 아래로
if T >= 0 and
dayindex > 0
and countif(C>O or (C==O),2) == 2
Then
--------------------------------------------------------------- 조건 2 위로
{
T = -1;
H1 = H;
H2 = H1[1];
if L1 > L2 and L2 > 0 Then
buy("매수");
}
if T == 1 Then
{
if L < L1 Then
L1 = L;
}
if T == -1 Then
{
if H > H1 Then
H1 = H;
}
if MarketPosition == 1 Then
{
if MarketPosition(0)[1] != 1 then
{
BL1 = L1[BarsSinceEntry]-PriceScale;
}
ExitLong("손절 ",AtStop,BL1);
}
if MarketPosition == -1 then
{
if MarketPosition != MarketPosition[1] Then
{
SH1 = H1[BarsSinceEntry]+PriceScale;
}
ExitShort("손절",AtStop,SH1);
}
if MarketPosition == 1 Then{
if Condition11 == false and H >= EntryPrice+PriceScale*30 Then{
Condition11 = true;
T1 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T1, 255);
Text_SetStyle(T1,2,1);
}
if Condition12 == false and H >= EntryPrice+PriceScale*60 Then{
Condition12 = true;
T2 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T2, 14483711);
Text_SetStyle(T2,2,1);
}
if Condition13 == false and H >= EntryPrice+PriceScale*90 Then{
Condition13 = true;
T3 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T3, 58623);
Text_SetStyle(T3,2,1);
}
if Condition14 == false and H >= EntryPrice+PriceScale*120 Then{
Condition14 = true;
T4 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T4, 4114503);
Text_SetStyle(T4,2,1);
}
if Condition15 == false and H >= EntryPrice+PriceScale*150 Then{
Condition15 = true;
T5 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T5, 16711681);
Text_SetStyle(T5,2,1);
}
}
Else
{
Condition11 = false;
Condition12 = false;
Condition13 = false;
Condition14 = false;
Condition15 = false;
Condition16 = false;
Condition17 = false;
Condition18 = false;
}
if MarketPosition == -1 Then{
if Condition21 == false and L <= EntryPrice-PriceScale*30 Then{
Condition21 = true;
T11 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T11, 255);
Text_SetStyle(T11,2,3);
}
if Condition22 == false and L <= EntryPrice-PriceScale*60 Then{
Condition22 = true;
T22 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T22, 14483711);
Text_SetStyle(T22,2,3);
}
if Condition23 == false and L <= EntryPrice-PriceScale*90 Then{
Condition23 = true;
T33 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T33, 58623);
Text_SetStyle(T33,2,3);
}
if Condition24 == false and L <= EntryPrice-PriceScale*120 Then{
Condition24 = true;
T44 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T44, 4114503);
Text_SetStyle(T44,2,3);
}
if Condition25 == false and L <= EntryPrice-PriceScale*150 Then{
Condition25 = true;
T55 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T55, 16711681);
Text_SetStyle(T55,2,3);
}
}
Else
{
Condition21 = false;
Condition22 = false;
Condition23 = false;
Condition24 = false;
Condition25 = false;
Condition26 = false;
Condition27 = false;
Condition28 = false;
}