커뮤니티

인베스트라 내용 번역

프로필 이미지
에리조나
2012-10-04 17:17:51
538
글번호 55293
답변완료
안녕하세요? 항상 친절한 답변에 감사드리며 번거롭지만 아래의 수식 예스랭귀지로 부탁드립니다. 아래의 내용은 인베스트라 49쪽의 내용입니다. 네이버 블로그의 인베스트라 번역된 내용은 책과 조금 상이하여 초보로서는 더욱혼란스러워서 그러니 널리 양해부탁드립니다. --------------- input : FastLen(9), SlowLen(18),ChLen(12),TrailBar(8),Initial(300),ReBar(15),Reentry(100); vars : FastMA(0),SlowMA(0),LEntryPrice(0),SEntryPrice(0),LCount(-999),SCount(-999),ReEntryCount(0),CurrentPosition(0); FastMA = Average(Close,FastLen); SlowMA = Average(Close,SlowLen); --Order Placement for Long Positions if FastMA crosses over SlowMA and barnumber > 1 then Begin LEntryPrice = Highest(High,ChLen)*1.03; LCount = BarNumber; End; if MarketPositon <> 1 AND BarNumber < LCount +ChLen then Buy("Cross Over Buy") Initial Shares next bar LEntryPrice Stop; ---Order Placement for Short Positions if FastMA crosses under SlowMA and barnumber > 1 then Begin SEntryPrice = Lowest(Low, ChLen)[1]*.97; SCount = BarNumber; End; if MarketPosition <> -1 AND BarNumber < Scount + ChLen then Sell("Cross Under Buy") Initial Shares next bar at SentryPrice Stop; --- Trailing Stop while in Position If MarketPosition = 1 then begin LCount = -999; ExitLong("LongTStop") next bar at Lowest(Low,TrailBar) Stop; End; if MarketPosition = -1 then Begin SCount = -999; ExitShort("ShortTStop") next bar at Highest(High,TrailBar)Stop; End; --- Reentry Techcique CurrentPosition = MarketPosition; If CurrentPosition = 0 AND CurrentPosition[1] = -1 then ReEntryCount = 1; If CurrentPosition = 0 AND CurrentPosition[1] = 1 then ReEntrycount = 1; If MarketPosition = 0 AND MarketPosition(1) = 1 AND ReEntryCount < ReBars then Begin ReEntryCount = ReEntryCount + 1; Buy("Long ReEntry") ReEntry Shares next bar at Highest(High, 10) Stop; End; If MarketPosition = 0 AND MarketPosition(1) = -1 AND ReEntryCount < ReBars then Begin ReEntryCount = ReEntryCount +1; Sell("Short ReEntry")ReEntry Shares next bar at Lowest(Low,10) Stop; End;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-10-05 10:00:48

안녕하세요 예스스탁입니다. input : FastLen(9), SlowLen(18),ChLen(12),TrailBar(8),Initial(300),ReBar(15),Reentry(100); vars : FastMA(0),SlowMA(0),LEntryPrice(0),SEntryPrice(0),LCount(-999),SCount(-999),ReEntryCount(0),CurrentPosition(0); FastMA = ma(Close,FastLen); SlowMA = ma(Close,SlowLen); #--Order Placement for Long Positions if crossup(FastMA, SlowMA) and CurrentBar > 1 then Begin LEntryPrice = Highest(High,ChLen)*1.03; LCount = CurrentBar; End; if MarketPosition <> 1 AND CurrentBar < LCount +ChLen then Buy("Cross Over Buy",AtStop,LEntryPrice,Initial); #---Order Placement for Short Positions if CrossDown(FastMA,SlowMA) and CurrentBar > 1 then Begin SEntryPrice = Lowest(Low, ChLen)[1]*.97; SCount = CurrentBar; End; if MarketPosition <> -1 AND CurrentBar < Scount + ChLen then Sell("Cross Under Buy",AtStop,SentryPrice,Initial); #--- Trailing Stop while in Position If MarketPosition == 1 then begin LCount = -999; ExitLong("LongTStop",AtStop,Lowest(Low,TrailBar)); End; if MarketPosition == -1 then Begin SCount = -999; ExitShort("ShortTStop",AtStop,Highest(High,TrailBar)); End; #--- Reentry Techcique CurrentPosition = MarketPosition; If CurrentPosition == 0 AND CurrentPosition[1] == -1 then ReEntryCount = 1; If CurrentPosition == 0 AND CurrentPosition[1] == 1 then ReEntrycount = 1; If MarketPosition == 0 AND MarketPosition(1) == 1 AND ReEntryCount < ReBar then Begin ReEntryCount = ReEntryCount + 1; Buy("Long ReEntry",AtStop,Highest(High, 10),Reentry); End; If MarketPosition == 0 AND MarketPosition(1) == -1 AND ReEntryCount < ReBar then Begin ReEntryCount = ReEntryCount +1; Sell("Short ReEntry",atstop, Lowest(Low,10),Reentry); End; 즐거운 하루되세요 > 에리조나 님이 쓴 글입니다. > 제목 : 인베스트라 내용 번역 > 안녕하세요? 항상 친절한 답변에 감사드리며 번거롭지만 아래의 수식 예스랭귀지로 부탁드립니다. 아래의 내용은 인베스트라 49쪽의 내용입니다. 네이버 블로그의 인베스트라 번역된 내용은 책과 조금 상이하여 초보로서는 더욱혼란스러워서 그러니 널리 양해부탁드립니다. --------------- input : FastLen(9), SlowLen(18),ChLen(12),TrailBar(8),Initial(300),ReBar(15),Reentry(100); vars : FastMA(0),SlowMA(0),LEntryPrice(0),SEntryPrice(0),LCount(-999),SCount(-999),ReEntryCount(0),CurrentPosition(0); FastMA = Average(Close,FastLen); SlowMA = Average(Close,SlowLen); --Order Placement for Long Positions if FastMA crosses over SlowMA and barnumber > 1 then Begin LEntryPrice = Highest(High,ChLen)*1.03; LCount = BarNumber; End; if MarketPositon <> 1 AND BarNumber < LCount +ChLen then Buy("Cross Over Buy") Initial Shares next bar LEntryPrice Stop; ---Order Placement for Short Positions if FastMA crosses under SlowMA and barnumber > 1 then Begin SEntryPrice = Lowest(Low, ChLen)[1]*.97; SCount = BarNumber; End; if MarketPosition <> -1 AND BarNumber < Scount + ChLen then Sell("Cross Under Buy") Initial Shares next bar at SentryPrice Stop; --- Trailing Stop while in Position If MarketPosition = 1 then begin LCount = -999; ExitLong("LongTStop") next bar at Lowest(Low,TrailBar) Stop; End; if MarketPosition = -1 then Begin SCount = -999; ExitShort("ShortTStop") next bar at Highest(High,TrailBar)Stop; End; --- Reentry Techcique CurrentPosition = MarketPosition; If CurrentPosition = 0 AND CurrentPosition[1] = -1 then ReEntryCount = 1; If CurrentPosition = 0 AND CurrentPosition[1] = 1 then ReEntrycount = 1; If MarketPosition = 0 AND MarketPosition(1) = 1 AND ReEntryCount < ReBars then Begin ReEntryCount = ReEntryCount + 1; Buy("Long ReEntry") ReEntry Shares next bar at Highest(High, 10) Stop; End; If MarketPosition = 0 AND MarketPosition(1) = -1 AND ReEntryCount < ReBars then Begin ReEntryCount = ReEntryCount +1; Sell("Short ReEntry")ReEntry Shares next bar at Lowest(Low,10) Stop; End;