커뮤니티

수정부탁드립니다.

프로필 이미지
9단
2015-06-22 20:46:12
99
글번호 87514
답변완료
메시지로그를 보면 맨 마지막줄에 OpenPP는 #QNB로 찍히는데, 정상값으로 표시할 방법을 찾고 있습니다. ############################################### Input : 수량(1),봉갯수(10); Var : MP(0),BuySellEntryPrice(0),OpenPP(0),NP(0); var : Hst(0),Lst(0),idx(-1); Hst = Highest(H,봉갯수); Lst = Lowest(L,봉갯수); If MP == 1 Then{ OpenPP = (NextBarOpen-BuySellEntryPrice); } If MP == -1 Then { OpenPP = (BuySellEntryPrice-NextBarOpen); } If MP == 0 Then { OpenPP = 0; } #MP가 0일때 매수조건 만족 If MP == 0 and Hst[1] < H and index > idx Then{ idx = index; BuySellEntryPrice = NextBarOpen; MP = 1; } #MP가 -1일때 매수조건 만족(리버스) If MP < 0 and Hst[1] < H and index > idx Then{ idx = index; if MP == -1 Then{ NP = NP+OpenPP; } BuySellEntryPrice = NextBarOpen; MP = 1; } #MP가 -1일때 매도청산조건 만족 If MP < 0 and Hst[1] < H and index > idx Then{ idx = index; NP = NP+OpenPP; MP = 0; } #MP가 0일때 매도조건 만족 If MP == 0 and Lst[1] > L and index > idx Then{ idx = index; BuySellEntryPrice = NextBarOpen; MP = -1; } #MP가 1일때 매도조건 만족(리버스) If MP > 0 and Lst[1] > L and index > idx Then{ idx = index; if MP == 1 Then{ NP = NP+OpenPP; } BuySellEntryPrice = NextBarOpen; MP = -1; } #MP가 1일때 매수청산조건 만족 If MP > 0 and Lst[1] > L and index > idx Then{ idx = index; NP = NP+OpenPP; MP = 0; } MessageLog("시가,%.4f,종가,%.4f,MP,%.0f,NP,%.4f,OpenPP,%.4f",open,close,MP,NP,OpenPP);
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-06-23 09:12:45

안녕하세요 예스스탁입니다. atmarket은 if조건만족하면 다음봉 시가의 값에 신호가 발생합니다. 현재 수식이 봉완성시 조건만족하면 다음봉 시가를 저장해 사용합니다. 다음봉시가(nextbaropen)이 봉완성시에만 값을 리턴됩니다. 미완성봉에서는 값이 리턴되지 않으므르 마지막은 불능처리가 되는 것입니다. 마지막봉에 값이 출력되려면 매수나 매도조건만족을 현재봉이 아닌 전봉에 만족한것으로 처리하고 시가를 저장해 사용해야 합니다. Input : 수량(1),봉갯수(10); Var : MP(0),BuySellEntryPrice(0),OpenPP(0),NP(0); var : Hst(0),Lst(0),idx(-1),Bcond(false),Scond(false); Hst = Highest(H,봉갯수); Lst = Lowest(L,봉갯수); Bcond = Hst[1] < H; Scond = Lst[1] > L; If MP == 1 Then{ OpenPP = (O-BuySellEntryPrice); } If MP == -1 Then { OpenPP = (BuySellEntryPrice-O); } If MP == 0 Then { OpenPP = 0; } #MP가 0일때 매수조건 만족 If MP == 0 and Bcond[1] == true and index > idx Then{ idx = index; BuySellEntryPrice = O; MP = 1; } #MP가 -1일때 매수조건 만족(리버스) If MP < 0 and Bcond[1] == true and index > idx Then{ idx = index; if MP == -1 Then{ NP = NP+OpenPP; } BuySellEntryPrice = O; MP = 1; } #MP가 -1일때 매도청산조건 만족 If MP < 0 and Bcond[1] == true and index > idx Then{ idx = index; NP = NP+OpenPP; MP = 0; } #MP가 0일때 매도조건 만족 If MP == 0 and Scond[1] == true and index > idx Then{ idx = index; BuySellEntryPrice = O; MP = -1; } #MP가 1일때 매도조건 만족(리버스) If MP > 0 and Scond[1] == true and index > idx Then{ idx = index; if MP == 1 Then{ NP = NP+OpenPP; } BuySellEntryPrice = O; MP = -1; } #MP가 1일때 매수청산조건 만족 If MP > 0 and Scond[1] == true and index > idx Then{ idx = index; NP = NP+OpenPP; MP = 0; } plot1(openPP); MessageLog("시가,%.4f,종가,%.4f,MP,%.0f,NP,%.4f,OpenPP,%.4f",open,close,MP,NP,OpenPP); 즐거운 하루되세요 > 9단 님이 쓴 글입니다. > 제목 : 수정부탁드립니다. > 메시지로그를 보면 맨 마지막줄에 OpenPP는 #QNB로 찍히는데, 정상값으로 표시할 방법을 찾고 있습니다. ############################################### Input : 수량(1),봉갯수(10); Var : MP(0),BuySellEntryPrice(0),OpenPP(0),NP(0); var : Hst(0),Lst(0),idx(-1); Hst = Highest(H,봉갯수); Lst = Lowest(L,봉갯수); If MP == 1 Then{ OpenPP = (NextBarOpen-BuySellEntryPrice); } If MP == -1 Then { OpenPP = (BuySellEntryPrice-NextBarOpen); } If MP == 0 Then { OpenPP = 0; } #MP가 0일때 매수조건 만족 If MP == 0 and Hst[1] < H and index > idx Then{ idx = index; BuySellEntryPrice = NextBarOpen; MP = 1; } #MP가 -1일때 매수조건 만족(리버스) If MP < 0 and Hst[1] < H and index > idx Then{ idx = index; if MP == -1 Then{ NP = NP+OpenPP; } BuySellEntryPrice = NextBarOpen; MP = 1; } #MP가 -1일때 매도청산조건 만족 If MP < 0 and Hst[1] < H and index > idx Then{ idx = index; NP = NP+OpenPP; MP = 0; } #MP가 0일때 매도조건 만족 If MP == 0 and Lst[1] > L and index > idx Then{ idx = index; BuySellEntryPrice = NextBarOpen; MP = -1; } #MP가 1일때 매도조건 만족(리버스) If MP > 0 and Lst[1] > L and index > idx Then{ idx = index; if MP == 1 Then{ NP = NP+OpenPP; } BuySellEntryPrice = NextBarOpen; MP = -1; } #MP가 1일때 매수청산조건 만족 If MP > 0 and Lst[1] > L and index > idx Then{ idx = index; NP = NP+OpenPP; MP = 0; } MessageLog("시가,%.4f,종가,%.4f,MP,%.0f,NP,%.4f,OpenPP,%.4f",open,close,MP,NP,OpenPP);