커뮤니티

지표식 문의 드립니다.

프로필 이미지
한글나라
2013-10-29 20:14:27
179
글번호 69010
답변완료
밑은 터틀 공식인데요 (사는 값-파는값)을 누적하는 지표를 만들고 싶습니다. 변수가 여러개 있다 보니 잘 모르겠습니다.; input:Capital(1000000); var:AtrV(0),unit(0),MP(0); AtrV=ATR(20); Unit=(Capital*0.02)/AtrV; MP=Marketposition; #진입 if MP==0 then { buy("B",AtStop,Highest(High,20),unit); sell("S",AtStop,Lowest(Low,20),Unit); } #피라미딩진입 If MP==1 and CurrentEntries<4 Then buy("bp",AtStop,EntryPrice+AtrV[BarsSinceEntry]*1*CurrentEntries,Unit); If MP==-1 and CurrentEntries <4 Then Sell("sp",atstop,Entryprice-AtrV[BarsSinceEntry]*1*CurrentEntries,Unit); #청산 If MP ==1 then { ExitLong("El",AtStop,Lowest(L,10)); ExitLong("El_stop",AtStop,AvgEntryPrice-2*AtrV); } If MP == -1 then { ExitShort("ES",AtStop,Highest (H,10)); ExitShort("ES_stop",AtStop, AvgEntryPrice+2*AtrV); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-10-30 14:10:12

안녕하세요 예스스탁입니다. 시스템식에서 작성된 내용을 지표로 보실수는 없습니다. 말씀하신 (사는값-파는값)은 손익을 나타내시는 것이면 수식에서 messagelog로 디버깅창에서 확인하셔야 합니다. 아래 내용을 시스템식 하단에 추가하신 후에 식 적용하시면 예스랭귀지 편집기의 디버깅창에서 누적손익을 확인하실 수 있습니다. MessageLog("%.2f",NetProfit); 즐거운 하루되세요 > 한글나라 님이 쓴 글입니다. > 제목 : 지표식 문의 드립니다. > 밑은 터틀 공식인데요 (사는 값-파는값)을 누적하는 지표를 만들고 싶습니다. 변수가 여러개 있다 보니 잘 모르겠습니다.; input:Capital(1000000); var:AtrV(0),unit(0),MP(0); AtrV=ATR(20); Unit=(Capital*0.02)/AtrV; MP=Marketposition; #진입 if MP==0 then { buy("B",AtStop,Highest(High,20),unit); sell("S",AtStop,Lowest(Low,20),Unit); } #피라미딩진입 If MP==1 and CurrentEntries<4 Then buy("bp",AtStop,EntryPrice+AtrV[BarsSinceEntry]*1*CurrentEntries,Unit); If MP==-1 and CurrentEntries <4 Then Sell("sp",atstop,Entryprice-AtrV[BarsSinceEntry]*1*CurrentEntries,Unit); #청산 If MP ==1 then { ExitLong("El",AtStop,Lowest(L,10)); ExitLong("El_stop",AtStop,AvgEntryPrice-2*AtrV); } If MP == -1 then { ExitShort("ES",AtStop,Highest (H,10)); ExitShort("ES_stop",AtStop, AvgEntryPrice+2*AtrV); }