커뮤니티

재질문드립니다. T.T

프로필 이미지
에쓰엠씨
2019-02-20 15:12:38
132
글번호 126381
답변완료
안녕하십니까?T.T 해외선물 크루드 오일을 거래중인데 당일 누적 손실이 50틱 이상이면 더이상 진입이 되지 않게 하는(당일거래종료) 수식을 알고 싶습니다. 정말 초보라 아무것도 모르겠습니다. T.T 거래 시간대는 3파트로 나눠져 있습니다. 11:00~15:00 17:00~23:30 00:00~03:00 input :시작시간1(110000),종료시간1(150000); input :시작시간2(170000),종료시간2(233000); input :시작시간3(000000),종료시간3(030000); 매도조건만 들어가 있으니 매수는 필요없습니다. 매도, 매도청산1, 매도청산2, 매도청산3 이게 진입조건 같습니다만... If (UPDOWN_Flag == -1) && (LMSADXSTKPGP_Flag == -1) Then { If (MarketPosition(0) == 0) Then { If (호가청산_Flag == 0) Then { Sell("매도", OnClose, DEF, 매도_수량); 매매조건_K_Flag = 1; } } } If (LMSADXSTKPGP_Color == 1) || (ADX_2015_Flag == 1) Then { 호가청산_Flag = 0; } } 진입조건도 시간대별로 3군데 작성되어 있습니다. ================================= 안녕하세요 예스스탁입니다. 매수진입조건, 매도진입조건은 진입조건을 넣으시면 됩니다. 시간이나 당일손실은 Xcond와 Tcond로 제어됩니다. Input : 당일손실틱수(50); input : start1(110000),end1(150000); input : start2(170000),end2(233000); Var : N1(0),dayPl(0),당일손실(0),Xcond(false); var : Tcond(false); if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit[1]; } if (sdate != sdate[1] and stime >= start1) or (sdate == sdate[1] and stime >= start1 and stime[1] < start1) then { Tcond = true; } if (sdate != sdate[1] and stime >= end1) or (sdate == sdate[1] and stime >= end1 and stime[1] < end1) then { Tcond = false; } if (sdate != sdate[1] and stime >= start2) or (sdate == sdate[1] and stime >= start2 and stime[1] < start2) then { Tcond = true; } if (sdate != sdate[1] and stime >= end2) or (sdate == sdate[1] and stime >= end2 and stime[1] < end2) then { Tcond = false; } 당일손실 = PriceScale*당일손실틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true or daypl <= -당일손실) then Xcond = true; if Xcond == false and Tcond == true then { if 매수진입조건 Then{ buy("b"); } if 매도진입조건 Then{ sell("s"); } } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 즐거운 하루되세요 > 에쓰엠씨 님이 쓴 글입니다. > 제목 : 거래종료 수식부탁드립니다. > 해외선물 크루드 오일을 거래중인데 당일 누적 손실이 50틱 이상이면 더이상 진입이 되지 않게 하는(당일거래종료) 수식을 알고 싶습니다. 정말 초보라 아무것도 모르겠습니다. T.T 거래 시간대는 2파트로 나눠져 있습니다. 11:00~15:00 17:00~23:30 각각1개의 파일에 매수,청산 매도,청산의 조건이 들어 있습니다. 그리고 아래수식에서 각각 별개의 파일에 매수,청산 매도,청산이 있으므로 매수에는 if Xcond == false then{ if 매수진입조건 Then{ buy("b");} 을 넣으면 되는데 매수진입조건에는 무엇을 입력해야 하나요? 각각 시간별로 매수진입이 있으므로 시작시간과 종료시간을 같이 적용하여 진입조건만 넣으면 되는건지? 청산 조건도 같이 넣어야 하는지 알고 싶고 buy("b")를 왜 설정하는지요? 초보라서 죄송합니다. Input : 당일손실틱수(50); Var : N1(0),dayPl(0),당일손실(0),Xcond(false); 당일손실 = PriceScale*당일손실틱수; if Bdate != Bdate[1] Then{ Xcond = false; N1 = NetProfit[1]; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Xcond == false then{ if 매수진입조건 Then{ buy("b"); } if 매도진입조건 Then{ sell("s"); } } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-02-21 11:07:20

안녕하세요 예스스탁입니다. 수식의 전반적인 구조를 이해하시고 기존 사용하는 수식과 결합하셔야 합니다. 수식에 일부만으로 내용을 결합해 드리기 어렵습니다. 기존 답변수식에 시간만 3구간으로 추가해 드립니다. Input : 당일손실틱수(50); input : start1(110000),end1(150000); input : start2(170000),end2(233000); input : start3(000000),end3(030000); Var : N1(0),dayPl(0),당일손실(0),Xcond(false); var : Tcond(false); if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit[1]; } if (sdate != sdate[1] and stime >= start1) or (sdate == sdate[1] and stime >= start1 and stime[1] < start1) then { Tcond = true; } if (sdate != sdate[1] and stime >= end1) or (sdate == sdate[1] and stime >= end1 and stime[1] < end1) then { Tcond = false; } if (sdate != sdate[1] and stime >= start2) or (sdate == sdate[1] and stime >= start2 and stime[1] < start2) then { Tcond = true; } if (sdate != sdate[1] and stime >= end2) or (sdate == sdate[1] and stime >= end2 and stime[1] < end2) then { Tcond = false; } if (sdate != sdate[1] and stime >= start3) or (sdate == sdate[1] and stime >= start3 and stime[1] < start3) then { Tcond = true; } if (sdate != sdate[1] and stime >= end3) or (sdate == sdate[1] and stime >= end3 and stime[1] < end3) then { Tcond = false; } 당일손실 = PriceScale*당일손실틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true or daypl <= -당일손실) then Xcond = true; if Xcond == false and Tcond == true then { if 매수진입조건 Then{ buy("b"); } if 매도진입조건 Then{ sell("s"); } } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 즐거운 하루되세요 > 에쓰엠씨 님이 쓴 글입니다. > 제목 : 재질문드립니다. T.T > 안녕하십니까?T.T 해외선물 크루드 오일을 거래중인데 당일 누적 손실이 50틱 이상이면 더이상 진입이 되지 않게 하는(당일거래종료) 수식을 알고 싶습니다. 정말 초보라 아무것도 모르겠습니다. T.T 거래 시간대는 3파트로 나눠져 있습니다. 11:00~15:00 17:00~23:30 00:00~03:00 input :시작시간1(110000),종료시간1(150000); input :시작시간2(170000),종료시간2(233000); input :시작시간3(000000),종료시간3(030000); 매도조건만 들어가 있으니 매수는 필요없습니다. 매도, 매도청산1, 매도청산2, 매도청산3 이게 진입조건 같습니다만... If (UPDOWN_Flag == -1) && (LMSADXSTKPGP_Flag == -1) Then { If (MarketPosition(0) == 0) Then { If (호가청산_Flag == 0) Then { Sell("매도", OnClose, DEF, 매도_수량); 매매조건_K_Flag = 1; } } } If (LMSADXSTKPGP_Color == 1) || (ADX_2015_Flag == 1) Then { 호가청산_Flag = 0; } } 진입조건도 시간대별로 3군데 작성되어 있습니다. ================================= 안녕하세요 예스스탁입니다. 매수진입조건, 매도진입조건은 진입조건을 넣으시면 됩니다. 시간이나 당일손실은 Xcond와 Tcond로 제어됩니다. Input : 당일손실틱수(50); input : start1(110000),end1(150000); input : start2(170000),end2(233000); Var : N1(0),dayPl(0),당일손실(0),Xcond(false); var : Tcond(false); if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit[1]; } if (sdate != sdate[1] and stime >= start1) or (sdate == sdate[1] and stime >= start1 and stime[1] < start1) then { Tcond = true; } if (sdate != sdate[1] and stime >= end1) or (sdate == sdate[1] and stime >= end1 and stime[1] < end1) then { Tcond = false; } if (sdate != sdate[1] and stime >= start2) or (sdate == sdate[1] and stime >= start2 and stime[1] < start2) then { Tcond = true; } if (sdate != sdate[1] and stime >= end2) or (sdate == sdate[1] and stime >= end2 and stime[1] < end2) then { Tcond = false; } 당일손실 = PriceScale*당일손실틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true or daypl <= -당일손실) then Xcond = true; if Xcond == false and Tcond == true then { if 매수진입조건 Then{ buy("b"); } if 매도진입조건 Then{ sell("s"); } } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 즐거운 하루되세요 > 에쓰엠씨 님이 쓴 글입니다. > 제목 : 거래종료 수식부탁드립니다. > 해외선물 크루드 오일을 거래중인데 당일 누적 손실이 50틱 이상이면 더이상 진입이 되지 않게 하는(당일거래종료) 수식을 알고 싶습니다. 정말 초보라 아무것도 모르겠습니다. T.T 거래 시간대는 2파트로 나눠져 있습니다. 11:00~15:00 17:00~23:30 각각1개의 파일에 매수,청산 매도,청산의 조건이 들어 있습니다. 그리고 아래수식에서 각각 별개의 파일에 매수,청산 매도,청산이 있으므로 매수에는 if Xcond == false then{ if 매수진입조건 Then{ buy("b");} 을 넣으면 되는데 매수진입조건에는 무엇을 입력해야 하나요? 각각 시간별로 매수진입이 있으므로 시작시간과 종료시간을 같이 적용하여 진입조건만 넣으면 되는건지? 청산 조건도 같이 넣어야 하는지 알고 싶고 buy("b")를 왜 설정하는지요? 초보라서 죄송합니다. Input : 당일손실틱수(50); Var : N1(0),dayPl(0),당일손실(0),Xcond(false); 당일손실 = PriceScale*당일손실틱수; if Bdate != Bdate[1] Then{ Xcond = false; N1 = NetProfit[1]; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Xcond == false then{ if 매수진입조건 Then{ buy("b"); } if 매도진입조건 Then{ sell("s"); } } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); }