커뮤니티

문의

프로필 이미지
좌오비우오비
2018-12-12 12:17:24
125
글번호 124374
답변완료
아래 수식은 봉미완성시에 지정한 가격에 해당하는 시세가 발생하면 즉시 신호가 발생하는 수식입니다. 수식을 모두 봉완성 기준으로 바꾸어 주셨으면 합니다. (진입,손절,익절,tr) 비교가 필요하여 요청드립니다. ******************************************************************** input : Price(2.96), 당일최대진입횟수(1),진입시작시간(090000),진입종료시간(143000); input : 손절(40),익절(270),TR(115); var : T1(0),entry(0),Tcond(false); if bdate != bdate[1] Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시작시간) or (sdate == sdate[1] and stime >= 진입시작시간 and stime[1] < 진입시작시간) Then{ Tcond = true; T1 = TotalTrades; } if (sdate != sdate[1] and stime >= 진입종료시간) or (sdate == sdate[1] and stime >= 진입종료시간 and stime[1] < 진입종료시간) Then Tcond = false; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if entry < 당일최대진입횟수 and MarketPosition == 0 and Tcond == true then{ if NextBarOpen <= Price Then buy("b1",AtStop,Price); } if MarketPosition == 1 then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절); ExitLong("bp1",Atlimit,EntryPrice+PriceScale*익절); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-12-12 14:17:05

안녕하세요 예스스탁입니다. input : Price(2.96), 당일최대진입횟수(1),진입시작시간(090000),진입종료시간(143000); input : 손절(40),익절(270),TR(115); var : T1(0),entry(0),Tcond(false); if bdate != bdate[1] Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시작시간) or (sdate == sdate[1] and stime >= 진입시작시간 and stime[1] < 진입시작시간) Then{ Tcond = true; T1 = TotalTrades; } if (sdate != sdate[1] and stime >= 진입종료시간) or (sdate == sdate[1] and stime >= 진입종료시간 and stime[1] < 진입종료시간) Then Tcond = false; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if entry < 당일최대진입횟수 and MarketPosition == 0 and Tcond == true and crossup(C,Price) then buy("b1"); if MarketPosition == 1 then { if C <= EntryPrice-PriceScale*손절 Then exitlong("bl1"); if C >= EntryPrice+PriceScale*익절 Then ExitLong("bp1"); if C <= highest(h,BarsSinceEntry)-PriceScale*TR Then ExitLong("btr1"); } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 문의 > 아래 수식은 봉미완성시에 지정한 가격에 해당하는 시세가 발생하면 즉시 신호가 발생하는 수식입니다. 수식을 모두 봉완성 기준으로 바꾸어 주셨으면 합니다. (진입,손절,익절,tr) 비교가 필요하여 요청드립니다. ******************************************************************** input : Price(2.96), 당일최대진입횟수(1),진입시작시간(090000),진입종료시간(143000); input : 손절(40),익절(270),TR(115); var : T1(0),entry(0),Tcond(false); if bdate != bdate[1] Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시작시간) or (sdate == sdate[1] and stime >= 진입시작시간 and stime[1] < 진입시작시간) Then{ Tcond = true; T1 = TotalTrades; } if (sdate != sdate[1] and stime >= 진입종료시간) or (sdate == sdate[1] and stime >= 진입종료시간 and stime[1] < 진입종료시간) Then Tcond = false; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if entry < 당일최대진입횟수 and MarketPosition == 0 and Tcond == true then{ if NextBarOpen <= Price Then buy("b1",AtStop,Price); } if MarketPosition == 1 then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절); ExitLong("bp1",Atlimit,EntryPrice+PriceScale*익절); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR); }