커뮤니티

매수가, 매도가 Messagelog로 어떻게 print할수 있는지요?

프로필 이미지
콩형
2016-04-19 22:26:07
139
글번호 97252
답변완료
이하 수식은 수식지왕이 블로그에서 퍼온겁니다. Buy, Sell, ExitLong, ExitShort된 시점의 가격을 messagelog로 인쇄할 방법이 있나요? 부탁드립니다. Var:UpperCH(0), LowerCH(0), CenterCH(0), BuyBase(0), SellBase(0), BuySetupIndex(0), SellSetupIndex(0); UpperCH = Highest(High,10)[1]; LowerCH = Lowest(Low,10)[1]; CenterCH = (UpperCH + LowerCH)/2; If CrossUp(Close,UpperCH) Then { BuyBase = High; BuySetupIndex = Index; } If CrossDown(Close,LowerCH) Then { SellBase = Low; SellSetupIndex = Index; } If Index - BuySetupIndex <= 3 Then { Buy("Buy",AtStop,BuyBase + 1); } If Index - SellSetupIndex <= 3 Then { Sell("Sell",AtStop,SellBase - 1); } If CrossDown(Close,CenterCH) Then ExitLong("BX1"); If CrossUp(Close,CenterCH) Then ExitShort("SX1"); ExitLong("BX2",AtStop,Highest(High,BarsSinceEntry) - (ATR(20) * 3)); ExitShort("SX2",AtStop,Lowest(Low,BarsSinceEntry) + (ATR(20) * 3)); SetStopLoss(3);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-04-20 13:11:08

안녕하세요 예스스탁입니다. 작성하신 식이 봉미완성시에 가격조건이 만족할때 즉시 신호가 발생하는 내용이므로 진입청산을 신호가격을 출력하려면 신호 후 한개봉이완성이 되어야 합니다. 아래 내용 참고하시기 바랍니다. MessageLog는 편집기의 디버깅창에 값을 출력하는 함수입니다. 시스템에서 발생되는 신호는 시스템 리포트의 매매내역에 가격등이 모두 표시가 되며 내역에서 간단히 마우스 우클릭하면 엑셀로 보내기가 있습니다. Var:UpperCH(0), LowerCH(0), CenterCH(0), BuyBase(0), SellBase(0), BuySetupIndex(0), SellSetupIndex(0); UpperCH = Highest(High,10)[1]; LowerCH = Lowest(Low,10)[1]; CenterCH = (UpperCH + LowerCH)/2; If CrossUp(Close,UpperCH) Then { BuyBase = High; BuySetupIndex = Index; } If CrossDown(Close,LowerCH) Then { SellBase = Low; SellSetupIndex = Index; } If Index - BuySetupIndex <= 3 Then { Buy("Buy",AtStop,BuyBase + 1); } If Index - SellSetupIndex <= 3 Then { Sell("Sell",AtStop,SellBase - 1); } If CrossDown(Close,CenterCH) Then ExitLong("BX1"); If CrossUp(Close,CenterCH) Then ExitShort("SX1"); ExitLong("BX2",AtStop,Highest(High,BarsSinceEntry) - (ATR(20) * 3)); ExitShort("SX2",AtStop,Lowest(Low,BarsSinceEntry) + (ATR(20) * 3)); SetStopLoss(3); if MarketPosition == 1 and BarsSinceEntry == 1 Then MessageLog("매수진입 날짜 %.f 시간 %.f 가격 %.2f",sdate,stime,EntryPrice); if MarketPosition == -1 and BarsSinceEntry == 1 Then MessageLog("매도진입 날짜 %.f 시간 %.f 가격 %.2f",sdate,stime,EntryPrice); if MarketPosition == 0 and BarsSinceExit(1) == 1 and MarketPosition(1) == 1 Then MessageLog("매수청산 날짜 %.f 시간 %.f 가격 %.2f",sdate,stime,EntryPrice); if MarketPosition == 0 and BarsSinceExit(1) == 1 and MarketPosition(1) == -1 Then MessageLog("매도청산 날짜 %.f 시간 %.f 가격 %.2f",sdate,stime,EntryPrice); 즐거운 하루되세요 > 콩형 님이 쓴 글입니다. > 제목 : 매수가, 매도가 Messagelog로 어떻게 print할수 있는지요? > 이하 수식은 수식지왕이 블로그에서 퍼온겁니다. Buy, Sell, ExitLong, ExitShort된 시점의 가격을 messagelog로 인쇄할 방법이 있나요? 부탁드립니다. Var:UpperCH(0), LowerCH(0), CenterCH(0), BuyBase(0), SellBase(0), BuySetupIndex(0), SellSetupIndex(0); UpperCH = Highest(High,10)[1]; LowerCH = Lowest(Low,10)[1]; CenterCH = (UpperCH + LowerCH)/2; If CrossUp(Close,UpperCH) Then { BuyBase = High; BuySetupIndex = Index; } If CrossDown(Close,LowerCH) Then { SellBase = Low; SellSetupIndex = Index; } If Index - BuySetupIndex <= 3 Then { Buy("Buy",AtStop,BuyBase + 1); } If Index - SellSetupIndex <= 3 Then { Sell("Sell",AtStop,SellBase - 1); } If CrossDown(Close,CenterCH) Then ExitLong("BX1"); If CrossUp(Close,CenterCH) Then ExitShort("SX1"); ExitLong("BX2",AtStop,Highest(High,BarsSinceEntry) - (ATR(20) * 3)); ExitShort("SX2",AtStop,Lowest(Low,BarsSinceEntry) + (ATR(20) * 3)); SetStopLoss(3);