커뮤니티

진행선 다시 확인 좀 요청 드립니다.

프로필 이미지
요타
2020-10-11 20:00:49
638
글번호 142977
답변완료

첨부 이미지

* 많은 도움에 고맙습니다. * <질문1> 사진1,사진2 지난번 주신 수식은 몇 번 계속 수정하고 변경해 봤는데 저는 안 되네요... 시스템 트레이딩 설정창의 비용/수량탭 하단에서 수수료와 슬리피지를 모두 0으로 하고 했는데도 표시가 차이가 있습니다. 1. 불필요한 선이 나타남 <사진1> ▶삭제요청 2. 계산식 조금 차이 <사진2> ▶계산오류 정정 요청 바쁘신데 두가지만 수정 좀 요청 드립니다. 지난번글 69413 번글 ## 진행선 var : TL(0),str(""),TX9(0),TX10(0); if TotalTrades > TotalTrades[1] Then TL_Delete(TL); if MarketPosition == 1 then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(C-entryprice),2); else str = "손실 : "+NumToStr(abs(C-entryprice),2); if BarsSinceEntry == 1 then { TL = TL_new(entrydate,entrytime,entryprice,sdate,stime,c); TX9 = text_new(sdate,stime,C,str); TL_SetSize(TX9,3); } else { TL_setend(TL,sdate,stime,c); text_setlocation(tx9,sdate,stime,c); Text_SetString(TX9, str); } if PositionProfit(0) > 0 then TL_setcolor(TL,red); else TL_setcolor(TL,blue); } if MarketPosition == -1 then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(C-entryprice),2); else str = "손실 : "+NumToStr(abs(C-entryprice),2); if BarsSinceEntry == 1 then { TL = TL_new(entrydate,entrytime,entryprice,sdate,stime,c); TX10 = text_new(sdate,stime,C,str); TL_SetSize(TX9,3); } else { TL_setend(TL,sdate,stime,c); text_setlocation(tx10,sdate,stime,c); Text_SetString(TX10, str); TL_SetSize(TX10,3); } if PositionProfit(0) > 0 then TL_setcolor(TL,red); else TL_setcolor(TL,blue); } if TotalTrades > TotalTrades[1] Then { if MarketPosition(1) == 1 Then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(PositionProfit(1)),2); else str = "손실 : "+NumToStr(abs(PositionProfit(1)),2); Text_SetString(TX9, str); } } if TotalTrades > TotalTrades[1] Then { if MarketPosition(1) == -1 Then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(PositionProfit(1)),2); else str = "손실 : "+NumToStr(abs(PositionProfit(1)),2); Text_SetString(TX10, str); } } <질문2 : 사진3 > ## if MarketPosition == -1 and IsEntryName("SS2SWDD2") == true Then ExitShort("DD2GOD",AtLimit,EntryPrice-PriceScale*20); ㅇ 위와 같이 청산 하면 실매매는 ③번 가격에 실매매가 되나요? 다음봉 시초가격에? 그럼 실 매매에서는 5포인트 수익이 아니라 3포인트 수익이 되는건가요? <질문3> 당일 누적 거래 최대 손실 100틱 이면 거래 정지 하는 수식 좀 부탁 드립니다. 즉 수익나고 손실나고 하다가 손실누적이 100틱 넘어가면 당일 거래 정지 입니다. var1 = ma(c,5) ; var2 = ma(c,20) ; if crossup(var1,var2) then buy("aa1") ; if crossdowwn(var1,var2) then sell("bb1") * 고맙 습니다. 수고하십시요.
강조
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-10-12 17:15:17

안녕하세요 예스스탁입니다. 1 var : TL(0),str(""),TX9(0),TX10(0); if CrossUp(c,ma(C,120)) Then Buy(); if CrossDown(c,ma(C,120)) Then Sell(); if TotalTrades > TotalTrades[1] Then TL_Delete(TL); if TotalTrades > TotalTrades[1] Then { if MarketPosition(1) == 1 Then { if PositionProfit(1) > 0 then str = "수익 : "+NumToStr(abs(PositionProfit(1)),2); else str = "손실 : "+NumToStr(abs(PositionProfit(1)),2); Text_SetLocation(TX9,ExitDate(1),ExitTime(1),ExitPrice(1)); Text_SetString(TX9, str); } } if TotalTrades > TotalTrades[1] Then { if MarketPosition(1) == -1 Then { if PositionProfit(1) > 0 then str = "수익 : "+NumToStr(abs(PositionProfit(1)),2); else str = "손실 : "+NumToStr(abs(PositionProfit(1)),2); Text_SetLocation(TX10,ExitDate(1),ExitTime(1),ExitPrice(1)); Text_SetString(TX10, str); } } if MarketPosition == 1 then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(PositionProfit(0),2); else str = "손실 : "+NumToStr(PositionProfit(0),2); if BarsSinceEntry == 1 then { TL = TL_new(entrydate,entrytime,entryprice,sdate,stime,c); TX9 = text_new(sdate,stime,C,str); TL_SetSize(TX9,3); Text_SetStyle(TX9,2,1); } else { TL_setend(TL,sdate,stime,c); text_setlocation(tx9,sdate,stime,c); Text_SetString(TX9, str); } if PositionProfit(0) > 0 then TL_setcolor(TL,red); else TL_setcolor(TL,blue); } if MarketPosition == -1 then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(PositionProfit(0),2); else str = "손실 : "+NumToStr(PositionProfit(0),2); if BarsSinceEntry == 1 then { TL = TL_new(entrydate,entrytime,entryprice,sdate,stime,c); TX10 = text_new(sdate,stime,C,str); TL_SetSize(TX9,3); Text_SetStyle(TX9,2,0); } else { TL_setend(TL,sdate,stime,c); text_setlocation(tx10,sdate,stime,c); Text_SetString(TX10, str); TL_SetSize(TX10,3); } if PositionProfit(0) > 0 then TL_setcolor(TL,red); else TL_setcolor(TL,blue); } 2 수식안에는 실제주문가격을 지정하는 부분이 없습니다. 신호가 발생하면시스템 트레이딩 설정창의 매매탭에서 지정한 가격으로 주문이 집행됩니다. 매도진입후 진입가 대비 20틱 낮은 시세가 발생하면 즉시 차트에 청산신호가 발생하고설정창에서 지정한 가격으로 주문됩니다. 3 Input : 당일손실틱수(100); Var : N1(0),dayPl(0),당일손실(0),Xcond(false); 당일손실 = PriceScale*당일손실틱수; if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl <= -당일손실 Then Xcond = true; if (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; } var1 = ma(c,5) ; var2 = ma(c,20) ; if Xcond == false then { if crossup(var1,var2) then buy("aa1") ; if crossdown(var1,var2) then sell("bb1"); } if MarketPosition == 1 then { ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 즐거운 하루되세요 > 요타 님이 쓴 글입니다. > 제목 : 진행선 다시 확인 좀 요청 드립니다. > * 많은 도움에 고맙습니다. * <질문1> 사진1,사진2 지난번 주신 수식은 몇 번 계속 수정하고 변경해 봤는데 저는 안 되네요... 시스템 트레이딩 설정창의 비용/수량탭 하단에서 수수료와 슬리피지를 모두 0으로 하고 했는데도 표시가 차이가 있습니다. 1. 불필요한 선이 나타남 <사진1> ▶삭제요청 2. 계산식 조금 차이 <사진2> ▶계산오류 정정 요청 바쁘신데 두가지만 수정 좀 요청 드립니다. 지난번글 69413 번글 ## 진행선 var : TL(0),str(""),TX9(0),TX10(0); if TotalTrades > TotalTrades[1] Then TL_Delete(TL); if MarketPosition == 1 then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(C-entryprice),2); else str = "손실 : "+NumToStr(abs(C-entryprice),2); if BarsSinceEntry == 1 then { TL = TL_new(entrydate,entrytime,entryprice,sdate,stime,c); TX9 = text_new(sdate,stime,C,str); TL_SetSize(TX9,3); } else { TL_setend(TL,sdate,stime,c); text_setlocation(tx9,sdate,stime,c); Text_SetString(TX9, str); } if PositionProfit(0) > 0 then TL_setcolor(TL,red); else TL_setcolor(TL,blue); } if MarketPosition == -1 then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(C-entryprice),2); else str = "손실 : "+NumToStr(abs(C-entryprice),2); if BarsSinceEntry == 1 then { TL = TL_new(entrydate,entrytime,entryprice,sdate,stime,c); TX10 = text_new(sdate,stime,C,str); TL_SetSize(TX9,3); } else { TL_setend(TL,sdate,stime,c); text_setlocation(tx10,sdate,stime,c); Text_SetString(TX10, str); TL_SetSize(TX10,3); } if PositionProfit(0) > 0 then TL_setcolor(TL,red); else TL_setcolor(TL,blue); } if TotalTrades > TotalTrades[1] Then { if MarketPosition(1) == 1 Then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(PositionProfit(1)),2); else str = "손실 : "+NumToStr(abs(PositionProfit(1)),2); Text_SetString(TX9, str); } } if TotalTrades > TotalTrades[1] Then { if MarketPosition(1) == -1 Then { if PositionProfit(0) > 0 then str = "수익 : "+NumToStr(abs(PositionProfit(1)),2); else str = "손실 : "+NumToStr(abs(PositionProfit(1)),2); Text_SetString(TX10, str); } } <질문2 : 사진3 > ## if MarketPosition == -1 and IsEntryName("SS2SWDD2") == true Then ExitShort("DD2GOD",AtLimit,EntryPrice-PriceScale*20); ㅇ 위와 같이 청산 하면 실매매는 ③번 가격에 실매매가 되나요? 다음봉 시초가격에? 그럼 실 매매에서는 5포인트 수익이 아니라 3포인트 수익이 되는건가요? <질문3> 당일 누적 거래 최대 손실 100틱 이면 거래 정지 하는 수식 좀 부탁 드립니다. 즉 수익나고 손실나고 하다가 손실누적이 100틱 넘어가면 당일 거래 정지 입니다. var1 = ma(c,5) ; var2 = ma(c,20) ; if crossup(var1,var2) then buy("aa1") ; if crossdowwn(var1,var2) then sell("bb1") * 고맙 습니다. 수고하십시요.