커뮤니티

수식수정좀 부탁드립니다.

프로필 이미지
예그리나
2016-12-05 07:23:05
127
글번호 104608
답변완료
다음과 같은 수식을 구했습니다. 근데 실행이 안되네요... 수정좀 부탁드립니다. inputs: MonthOfTrend( 12 ), DayOfTrend( 19 ), YearOfTrend( 2003 ), ChannelPeriods( 34 ), OverBoughtRegion( 75 ), BearishPeriods( 21 ), MultiplicationFactor( 3.2 ), InitialStop( 10 ) ; variables: KeyDate( 0 ), CountHoldingDays( false ), HoldingDays( 0 ), Index( 0 ), OB( 0 ), Bullish( 0 ), Bearish( 0 ), RangeA( 0 ), StopLevel( 0 ), BearStop( 0 ) ; if CurrentBar = 1 then begin KeyDate = ELDate( MonthOfTrend, DayOfTrend, YearOfTrend ) ; end ; if Date >= KeyDate and Date[1] < KeyDate then CountHoldingDays = true ; if CountHoldingDays then HoldingDays = HoldingDays + 1 ; Index = RSI( Close, ChannelPeriods ) ; OB = Index - OverBoughtRegion ; Bullish = Close - ( Close * OB * 0.01 ) ; if HoldingDays > 0 then begin if BearishPeriods <> 0 then begin Bearish = Summation( AbsValue( Low - Low[1] ), BearishPeriods ) / BearishPeriods ; RangeA = Summation( Close - Low, BearishPeriods ) / BearishPeriods ; end ; StopLevel = Close - ( ( Bearish + RangeA ) * MultiplicationFactor ) ; if StopLevel > BearStop[1] and StopLevel > InitialStop then BearStop = StopLevel else if StopLevel > BearStop[1] and StopLevel < InitialStop then BearStop = InitialStop else if StopLevel <= BearStop[1] then BearStop = BearStop[1] else BearStop = StopLevel * HoldingDays ; Plot1( High, "High" ) ; Plot2( Low, "Low" ) ; Plot3( Open, "Open" ) ; Plot4( Close, "Close" ) ; Plot5( Bullish, "BullishLn" ) ; Plot6( BearStop, "BearStopLn" ) ; Plot7( Bullish, "BullishBK" ) ; Plot8( BearStop, "BearStopBK" ) ; end ; 좋은 하루되세요..
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-12-05 16:40:17

안녕하세요 예스스탁입니다. 올려주신 식은 저희 예스랭귀지로 작성된 식이 아닙니다. 식중에 어떤 내용인지 알수 없는 내용이 있어 변환이 가능하지 않습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 예그리나 님이 쓴 글입니다. > 제목 : 수식수정좀 부탁드립니다. > 다음과 같은 수식을 구했습니다. 근데 실행이 안되네요... 수정좀 부탁드립니다. inputs: MonthOfTrend( 12 ), DayOfTrend( 19 ), YearOfTrend( 2003 ), ChannelPeriods( 34 ), OverBoughtRegion( 75 ), BearishPeriods( 21 ), MultiplicationFactor( 3.2 ), InitialStop( 10 ) ; variables: KeyDate( 0 ), CountHoldingDays( false ), HoldingDays( 0 ), Index( 0 ), OB( 0 ), Bullish( 0 ), Bearish( 0 ), RangeA( 0 ), StopLevel( 0 ), BearStop( 0 ) ; if CurrentBar = 1 then begin KeyDate = ELDate( MonthOfTrend, DayOfTrend, YearOfTrend ) ; end ; if Date >= KeyDate and Date[1] < KeyDate then CountHoldingDays = true ; if CountHoldingDays then HoldingDays = HoldingDays + 1 ; Index = RSI( Close, ChannelPeriods ) ; OB = Index - OverBoughtRegion ; Bullish = Close - ( Close * OB * 0.01 ) ; if HoldingDays > 0 then begin if BearishPeriods <> 0 then begin Bearish = Summation( AbsValue( Low - Low[1] ), BearishPeriods ) / BearishPeriods ; RangeA = Summation( Close - Low, BearishPeriods ) / BearishPeriods ; end ; StopLevel = Close - ( ( Bearish + RangeA ) * MultiplicationFactor ) ; if StopLevel > BearStop[1] and StopLevel > InitialStop then BearStop = StopLevel else if StopLevel > BearStop[1] and StopLevel < InitialStop then BearStop = InitialStop else if StopLevel <= BearStop[1] then BearStop = BearStop[1] else BearStop = StopLevel * HoldingDays ; Plot1( High, "High" ) ; Plot2( Low, "Low" ) ; Plot3( Open, "Open" ) ; Plot4( Close, "Close" ) ; Plot5( Bullish, "BullishLn" ) ; Plot6( BearStop, "BearStopLn" ) ; Plot7( Bullish, "BullishBK" ) ; Plot8( BearStop, "BearStopBK" ) ; end ; 좋은 하루되세요..