답변완료
추가수식 부탁합니다.
아래수식에 아래와 같은 수식을 추가하고 싶습니다.
1) 모든 추세선에 굵기조정을 할수 있는 기능을 추가하고 싶습니다.
2) 상승추세선을 빨강, 하락추세선은 파랑으로 나타내고 싶습니다.
3) 추세선이 나오는 고점과 고점을 연결하는 빨간선을
추세선이 나오는 저점과 저점을 연결하는 파란선을 나타내고 싶습니다.
4) 직전 고,저점2와 연결하는선을 없애고 싶습니다.
5) 직전 고점과 저점에서 나오는 선들이 현재 진행되는 봉까지 연장되었으면 합니다..
감사합니다...
input : Left(5),right(5),표시소숫점자리(0);
var : T(0),cnt(0),TL(0),HTL1(0),HTL2(0),LTL1(0),LTL2(0);
Array : SHD[5](0),SHT[5](0),SHV[5](0),SHTL[100](0),SHTX[100](0);
Array : SLD[5](0),SLT[5](0),SLV[5](0),SLTL[100](0),SLTX[100](0);
if SwingHigh(1,H,Left,Right,Left+Right+1) != -1 then
{
var2 = 0;
var1 = var1+1;
if var1 == 1 then
{
SHD[0] = sdate[right];
SHT[0] = stime[right];
SHV[0] = H[right];
for cnt = 1 to 4
{
SHD[cnt] = SHD[cnt-1][1];
SHT[cnt] = SHT[cnt-1][1];
SHV[cnt] = SHV[cnt-1][1];
}
if SLV[0] > 0 Then
{
TL = TL_New(SLD[0],SLT[0],SLV[0],SHD[0],SHT[0],SHV[0]);
}
}
if var1 >= 2 and H[right] > SHV[0] then
{
SHD[0] = sdate[right];
SHT[0] = stime[right];
SHV[0] = H[right];
if SLV[0] > 0 Then
{
TL_Delete(TL);
TL = TL_New(SLD[0],SLT[0],SLV[0],SHD[0],SHT[0],SHV[0]);
}
}
if SHV[1] > 0 Then
{
TL_Delete(HTL1);
HTL1 = TL_New(SHD[1],SHT[1],SHV[1],SHD[0],SHT[0],SHV[0]);
TL_SetColor(HTL1,RED);
}
if SHV[2] > 0 Then
{
TL_Delete(HTL2);
HTL2 = TL_New(SHD[2],SHT[2],SHV[2],SHD[0],SHT[0],SHV[0]);
TL_SetColor(HTL2,RED);
}
SHTL[0] = TL_New(sdate[right],stime[right],H[right],sdate,stime,H[right]);
TL_SetColor(SHTL[0],RED);
SHTX[0] = Text_New(sdate,stime,H[right],NumToStr(H[right],표시소숫점자리));
Text_SetColor(SHTX[0],RED);
Text_SetStyle(SHTX[0],2,1);
for cnt = 1 to 99
{
SHTL[cnt] = SHTL[cnt-1][1];
SHTX[cnt] = SHTX[cnt-1][1];
}
}
if SwingLow(1,L,Left,Right,Left+Right+1) != -1 then
{
#plot2(L,"2",blue);
var1 = 0;
var2 = var2+1;
if var2 == 1 then
{
SLD[0] = sdate[right];
SLT[0] = stime[right];
SLV[0] = L[right];
for cnt = 1 to 4
{
SLD[cnt] = SLD[cnt-1][1];
SLT[cnt] = SLT[cnt-1][1];
SLV[cnt] = SLV[cnt-1][1];
}
if SHV[0] > 0 Then
{
TL = TL_New(SHD[0],SHT[0],SHV[0],SLD[0],SLT[0],SLV[0]);
}
}
if var2 >= 2 and L[right] < SLV[0] then
{
SLD[0] = sdate[right];
SLT[0] = stime[right];
SLV[0] = L[right];
TL_Delete(TL);
if SHV[0] > 0 Then
{
TL = TL_New(SHD[0],SHT[0],SHV[0],SLD[0],SLT[0],SLV[0]);
}
}
if SLV[1] > 0 Then
{
TL_Delete(LTL1);
LTL1 = TL_New(SLD[1],SLT[1],SLV[1],SLD[0],SLT[0],SLV[0]);
TL_SetColor(LTL1,BLUE);
}
if SLV[2] > 0 Then
{
TL_Delete(LTL2);
LTL2 = TL_New(SLD[2],SLT[2],SLV[2],SLD[0],SLT[0],SLV[0]);
TL_SetColor(LTL2,BLUE);
}
SLTL[0] = TL_New(sdate[right],stime[right],L[right],sdate,stime,L[right]);
TL_SetColor(SLTL[0],BLUE);
SLTX[0] = Text_New(sdate,stime,L[right],NumToStr(L[right],표시소숫점자리));
Text_SetColor(SLTX[0],BLUE);
Text_SetStyle(SLTX[0],2,0);
for cnt = 1 to 99
{
SLTL[cnt] = SLTL[cnt-1][1];
SLTX[cnt] = SLTX[cnt-1][1];
}
}
for cnt = 0 to 99
{
if SHTL[cnt] > 0 then
{
TL_SetEnd(SHTL[cnt],sdate,stime,TL_GetBeginVal(SHTL[cnt]));
if H >= TL_GetBeginVal(SHTL[cnt]) Then
SHTL[cnt] = 0;
}
if SLTL[cnt] > 0 then
{
TL_SetEnd(SLTL[cnt],sdate,stime,TL_GetBeginVal(SLTL[cnt]));
if L <= TL_GetBeginVal(SLTL[cnt]) Then
SLTL[cnt] = 0;
}
if SHTL[cnt] > 0 Then
{
Text_SetLocation(SHTX[cnt],sdate,stime,TL_GetBeginVal(SHTL[cnt]));
}
if SLTL[cnt] > 0 Then
{
Text_SetLocation(SLTX[cnt],sdate,stime,TL_GetBeginVal(SLTL[cnt]));
}
}
2019-10-24
230
글번호 133093
지표
답변완료
수정부탁드립니다.
안녕하세요? 아래의 수식에서 고치고싶은게 있습니다.
1)날짜
날짜를 매일 입력하도록 되어있는데, 그렇게안해도 자동으로 매일 나오도록 하고싶습니다.
2)청산 외부변수
익절,손절,트레일링스탑을 고치려면 수식편집창에서 해야하는데, 외부변수로 빼고싶습니다.
3)시간
끝나는시간이 150000 으로 되어있는것 같은데, 빼버리고 계속 돌아가게 하고싶습니다.
4)날짜가 이런 형식의 시스템이 더있는데요, 날짜를 빼버리고 매일 입력하도록 하려면 특정수식을 삭제만 해주면 되는건가요? 어디를 없애고 무엇을 추가해야하는지 알려주시면 감사하겠습니다. 다른시스템에도 적용하려구요.
부탁드립니다.
감사합니다.
Var : Timeoff(0);
Input : CurDate(20190228);
value1 = DayHigh(0);
value2 = DayLow(0);
//If CurrentDate == sDate Then {
If CurDate == sDate Then {
If sTime >= 150000 Then {
ExitShort();
ExitLong();
Timeoff = 1;
} Else If Timeoff == 0 Then {
If MarketPosition == 0 Then {
If IsExitName("stoploss", 1) == True Then {
If IsEntryName("B1", 1) == False Then {
If CrossUp(C, value2+1) Then {
If C <= value2+1.6 Then {
Buy("B11",OnClose,C);
}
}
}
If IsEntryName("B2", 1) == False Then {
If CrossUp(C, value2+2) Then {
If C <= value2+2.6 Then {
Buy("B22",OnClose,C);
}
}
}
If IsEntryName("B3", 1) == False Then {
If CrossUp(C, value2+3) Then {
If C <= value2+3.6 Then {
Buy("B33",OnClose,C);
}
}
}
If IsEntryName("B4", 1) == False Then {
If CrossUp(C, value2+4) Then {
If C <= value2+4.6 Then {
Buy("B44",OnClose,C);
}
}
}
If IsEntryName("B5", 1) == False Then {
If CrossUp(C, value2+5) Then {
If C <= value2+5.6 Then {
Buy("B55",OnClose,C);
}
}
}
//----------------------------------------------------
If IsEntryName("S1", 1) == False Then {
If CrossDown(C, value1-1) Then {
If C >= value2-1.6 Then {
Sell("S11",OnClose,C);
}
}
}
If IsEntryName("S2", 1) == False Then {
If CrossDown(C, value1-2) Then {
If C >= value2-2.6 Then {
Sell("S22",OnClose,C);
}
}
}
If IsEntryName("S3", 1) == False Then {
If CrossDown(C, value1-3) Then {
If C >= value2-3.6 Then {
Sell("S33",OnClose,C);
}
}
}
If IsEntryName("S4", 1) == False Then {
If CrossDown(C, value1-4) Then {
If C >= value2-4.6 Then {
Sell("S44",OnClose,C);
}
}
}
If IsEntryName("S5", 1) == False Then {
If CrossDown(C, value1-5) Then {
If C >= value2-5.6 Then {
Sell("S55",OnClose,C);
}
}
}
} Else {
If CrossUp(C, value2+1) Then {
If C <= value2+1.6 Then {
Buy("B1",OnClose,C);
}
}
If CrossUp(C, value2+2) Then {
If C <= value2+2.6 Then {
Buy("B2",OnClose,C);
}
}
If CrossUp(C, value2+3) Then {
If C <= value2+3.6 Then {
Buy("B3",OnClose,C);
}
}
If CrossUp(C, value2+4) Then {
If C <= value2+4.6 Then {
Buy("B4",OnClose,C);
}
}
If CrossUp(C, value2+5) Then {
If C <= value2+5.6 Then {
Buy("B5",OnClose,C);
}
}
//----------------------------------------------------
If CrossDown(C, value1-1) Then {
If C >= value2-1.6 Then {
Sell("S1",OnClose,C);
}
}
If CrossDown(C, value1-2) Then {
If C >= value2-2.6 Then {
Sell("S2",OnClose,C);
}
}
If CrossDown(C, value1-3) Then {
If C >= value2-3.6 Then {
Sell("S3",OnClose,C);
}
}
If CrossDown(C, value1-4) Then {
If C >= value2-4.6 Then {
Sell("S4",OnClose,C);
}
}
If CrossDown(C, value1-5) Then {
If C >= value2-5.6 Then {
Sell("S5",OnClose,C);
}
}
}
} Else {
If IsEntryName("B1") == True or IsEntryName("B11") == True Then {
ExitLong("EB1", AtLimit, value2 + 2);
}
If IsEntryName("B2") == True or IsEntryName("B22") == True Then {
ExitLong("EB2", AtLimit, value2 + 3);
}
If IsEntryName("B3") == True or IsEntryName("B33") == True Then {
ExitLong("EB3", AtLimit, value2 + 4);
}
If IsEntryName("B4") == True or IsEntryName("B44") == True Then {
ExitLong("EB4", AtLimit, value2 + 5);
}
If IsEntryName("B5") == True or IsEntryName("B55") == True Then {
ExitLong("EB5", AtLimit, value2 + 6);
}
//----------------------------------------------------
If IsEntryName("S1") == True or IsEntryName("S11") == True Then {
ExitShort("ES1", AtLimit, value1 - 2);
}
If IsEntryName("S2") == True or IsEntryName("S22") == True Then {
ExitShort("ES2", AtLimit, value1 - 3);
}
If IsEntryName("S3") == True or IsEntryName("S33") == True Then {
ExitShort("ES3", AtLimit, value1 - 4);
}
If IsEntryName("S4") == True or IsEntryName("S44") == True Then {
ExitShort("ES4", AtLimit, value1 - 5);
}
If IsEntryName("S5") == True or IsEntryName("S55") == True Then {
ExitShort("ES5", AtLimit, value1 - 6);
}
}
}
//SetStopProfittarget(1,PointStop);
//SetStopTrailing(1, 1, PointStop);
SetStopLoss(0.9,PointStop);
}
2019-10-24
133
글번호 133083
시스템