커뮤니티

수식 확인 좀 요청 드립니다.

프로필 이미지
요타
2019-11-01 07:11:04
227
글번호 133310
답변완료

첨부 이미지

* 전일 수식 적용했는데 수치가 이상합니다. <그림참고> 수익 or 손실 금액이 표시 안 되고 다른 수치가 나옴니다. (아마 봉의 종가 기준 으로 계산 되는것 갔습니다.) 1.청산금액(수익 or 손실)이 표현 되도록 수정 좀 부탁 드립니다. var : TL(0),TX(0); if MarketPosition != 0 Then { if MarketPosition != MarketPosition[1] Then { TL = TL_New(sdate[1],stime[1],EntryPrice,sdate,stime,EntryPrice); tx = Text_New(sdate,stime,EntryPrice,NumToStr(PositionProfit(0),2)); } Else { TL_SetEnd(TL,sdate,stime,EntryPrice); Text_SetString(tx,NumToStr(PositionProfit(0),2)); Text_SetLocation(tx,sdate,stime,EntryPrice); } TL_SetSize(TL,1); if PositionProfit(0) > 0 Then { TL_SetColor(TL,RED); text_SetColor(Tx,RED); } else if PositionProfit(0) < 0 Then { TL_SetColor(TL,BLUE); text_SetColor(Tx,BLUE); } else { TL_SetColor(TL,BLACK); text_SetColor(Tx,BLACK); } } * 좋은 주말 되십시요.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-11-01 16:51:11

안녕하세요 예스스탁입니다. 포지션이 진행중일때만 출력이 되게 되어 있어 청산된봉에서도 출력되게 수정했습니다. var : TL(0),TX(0); if MarketPosition != 0 Then { if MarketPosition != MarketPosition[1] Then { TL = TL_New(sdate[1],stime[1],EntryPrice,sdate,stime,EntryPrice); tx = Text_New(sdate,stime,EntryPrice,NumToStr(PositionProfit(0),2)); } Else { TL_SetEnd(TL,sdate,stime,EntryPrice); Text_SetString(tx,NumToStr(PositionProfit(0),2)); Text_SetLocation(tx,sdate,stime,EntryPrice); } TL_SetSize(TL,1); if PositionProfit(0) > 0 Then { TL_SetColor(TL,RED); text_SetColor(Tx,RED); } else if PositionProfit(0) < 0 Then { TL_SetColor(TL,BLUE); text_SetColor(Tx,BLUE); } else { TL_SetColor(TL,BLACK); text_SetColor(Tx,BLACK); } } if TotalTrades > TotalTrades[1] Then { Text_Delete(tx); tx = text_New(exitdate(1),exittime(1),EntryPrice(1),NumToStr(PositionProfit(1),2)); if PositionProfit(1) > 0 Then { TL_SetColor(TL,RED); text_SetColor(Tx,RED); } else if PositionProfit(1) < 0 Then { TL_SetColor(TL,BLUE); text_SetColor(Tx,BLUE); } else { TL_SetColor(TL,BLACK); text_SetColor(Tx,BLACK); } } 즐거운 하루되세요 > 요타 님이 쓴 글입니다. > 제목 : 수식 확인 좀 요청 드립니다. > * 전일 수식 적용했는데 수치가 이상합니다. <그림참고> 수익 or 손실 금액이 표시 안 되고 다른 수치가 나옴니다. (아마 봉의 종가 기준 으로 계산 되는것 갔습니다.) 1.청산금액(수익 or 손실)이 표현 되도록 수정 좀 부탁 드립니다. var : TL(0),TX(0); if MarketPosition != 0 Then { if MarketPosition != MarketPosition[1] Then { TL = TL_New(sdate[1],stime[1],EntryPrice,sdate,stime,EntryPrice); tx = Text_New(sdate,stime,EntryPrice,NumToStr(PositionProfit(0),2)); } Else { TL_SetEnd(TL,sdate,stime,EntryPrice); Text_SetString(tx,NumToStr(PositionProfit(0),2)); Text_SetLocation(tx,sdate,stime,EntryPrice); } TL_SetSize(TL,1); if PositionProfit(0) > 0 Then { TL_SetColor(TL,RED); text_SetColor(Tx,RED); } else if PositionProfit(0) < 0 Then { TL_SetColor(TL,BLUE); text_SetColor(Tx,BLUE); } else { TL_SetColor(TL,BLACK); text_SetColor(Tx,BLACK); } } * 좋은 주말 되십시요.