커뮤니티
문의
2009-12-24 08:08:37
634
글번호 26928
안녕하세요?
이지랭귀지로작성된것입니다. 와이티로 변환시켜주시면 감사하겠습니다.
미리감사드립니다.
======================
Inputs: RHStren(4), RLStren(4), Trailbar(6);
Vars: RHTLRef(-1), RHTLRef2(-1), RHSet(-1), RHSet2(-1), RHArrayVal(0), RHColorVar(0),
RLColorVar(0), BarsPast(0);
Vars: RLTLRef(-1), RLTLRef2(-1), RLSet(-1), RLSet2(-1),RLArrayVal(0), BuyPrice(0), PrevBuyPrice(0),
SellPrice(0), PrevSellPrice(0);
Array: RHDate[10](0), RHTime[10](0), RHVal[10](0);
Array: RLDate[10](99999), RLTime[10](99999), RLVal[10](99999);
{ Find new Swing High bars and draw corresponding trend lines }
If SwingHighBar(1, High, RHStren, RHStren+1)=RHStren then begin
for Value1=9 downto 0 begin
RHDate[Value1+1]=RHDate[Value1];
RHTime[Value1+1]=RHTime[Value1];
RHVal[Value1+1]=RHVal[Value1];
end;
RHDate[0]=Date[RHStren];
RHTime[0]=Time[RHStren];
RHVal[0]=High[RHStren];
for Value22=1 to 10 begin
If RHVal[Value22]>RHVal[0] then begin
RHArrayVal=Value22;
Value22=11;
end;
End;
If Value22<>11 then begin
If RHSet>=0 then begin
RHSet2=TL_SetExtRight(RHTLRef, False);
TL_Delete(RHTLRef);
end;
RHTLRef=TL_New(RHDate[RHArrayVal], RHTime[RHArrayVal], RHVal[RHArrayVal], RHDate[0], RHTime[0], RHVal[0]);
RHSet=TL_SetExtRight(RHTLRef, True);
End;
End;
{ Find new Swing Low bars and draw corresponding trend lines }
If SwingLowBar(1, Low, RLStren, RLStren+1)=RLStren then begin
for Value1=9 downto 0 begin
RLDate[Value1+1]=RLDate[Value1];
RLTime[Value1+1]=RLTime[Value1];
RLVal[Value1+1]=RLVal[Value1];
end;
RLDate[0]=Date[RLStren];
RLTime[0]=Time[RLStren];
RLVal[0]=Low[RLStren];
for Value22=1 to 10 begin
If RLVal[Value22]<RLVal[0] then begin
RLArrayVal=Value22;
Value22=11;
end;
End;
If Value22<>11 then begin
If RLSet>=0 then begin
RLTLRef2=TL_SetEnd(RLTLRef, Date,Time,TL_GetValue(RLTLRef, date, time));
RLSet2=TL_SetExtRight(RLTLRef, False);
TL_Delete(RLTLRef);
end;
RLTLRef=TL_New(RLDate[RLArrayVal], RLTime[RLArrayVal], RLVal[RLArrayVal], RLDate[0], RLTime[0], RLVal[0]);
RLSet=TL_SetExtRight(RLTLRef, True);
End;
End;
{ Place orders to enter long positions }
If RHTLRef <> -1 then Begin
BuyPrice = TL_GetValue( RHTLRef , Date, Time );
PrevBuyPrice = TL_Getvalue( RHTLRef , Date[1] , Time[1] );
If Close Crosses Over BuyPrice AND Arctangent( PrevBuyPrice / BuyPrice)>10 then
Buy next bar at Market;
End;
{ Place orders to enter short positions }
If RLTLRef <> -1 then Begin
SellPrice = TL_GetValue( RLTLRef , Date , Time );
PrevSellPrice = TL_Getvalue( RLTLRef , Date[1] , Time[1] );
If Close crosses under SellPrice AND Arctangent(SellPrice / PrevSellPrice)>10 then
Sell next bar at Market;
End;
{ Trailing protective stop orders }
ExitLong next bar at Lowest( Low , TrailBar ) Stop;
ExitShort next bar at Highest( High , TrailBar ) Stop;
답변 1
예스스탁 예스스탁 답변
2009-12-24 14:01:18
안녕하세요
예스스탁입니다.
TL_와 관련된 함수의 내용을 알수 없고
자동추세선 관련함수가 제공되지 않아
식으로 구현할 수 없습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 송아지 님이 쓴 글입니다.
> 제목 : 문의
> 안녕하세요?
이지랭귀지로작성된것입니다. 와이티로 변환시켜주시면 감사하겠습니다.
미리감사드립니다.
======================
Inputs: RHStren(4), RLStren(4), Trailbar(6);
Vars: RHTLRef(-1), RHTLRef2(-1), RHSet(-1), RHSet2(-1), RHArrayVal(0), RHColorVar(0),
RLColorVar(0), BarsPast(0);
Vars: RLTLRef(-1), RLTLRef2(-1), RLSet(-1), RLSet2(-1),RLArrayVal(0), BuyPrice(0), PrevBuyPrice(0),
SellPrice(0), PrevSellPrice(0);
Array: RHDate[10](0), RHTime[10](0), RHVal[10](0);
Array: RLDate[10](99999), RLTime[10](99999), RLVal[10](99999);
{ Find new Swing High bars and draw corresponding trend lines }
If SwingHighBar(1, High, RHStren, RHStren+1)=RHStren then begin
for Value1=9 downto 0 begin
RHDate[Value1+1]=RHDate[Value1];
RHTime[Value1+1]=RHTime[Value1];
RHVal[Value1+1]=RHVal[Value1];
end;
RHDate[0]=Date[RHStren];
RHTime[0]=Time[RHStren];
RHVal[0]=High[RHStren];
for Value22=1 to 10 begin
If RHVal[Value22]>RHVal[0] then begin
RHArrayVal=Value22;
Value22=11;
end;
End;
If Value22<>11 then begin
If RHSet>=0 then begin
RHSet2=TL_SetExtRight(RHTLRef, False);
TL_Delete(RHTLRef);
end;
RHTLRef=TL_New(RHDate[RHArrayVal], RHTime[RHArrayVal], RHVal[RHArrayVal], RHDate[0], RHTime[0], RHVal[0]);
RHSet=TL_SetExtRight(RHTLRef, True);
End;
End;
{ Find new Swing Low bars and draw corresponding trend lines }
If SwingLowBar(1, Low, RLStren, RLStren+1)=RLStren then begin
for Value1=9 downto 0 begin
RLDate[Value1+1]=RLDate[Value1];
RLTime[Value1+1]=RLTime[Value1];
RLVal[Value1+1]=RLVal[Value1];
end;
RLDate[0]=Date[RLStren];
RLTime[0]=Time[RLStren];
RLVal[0]=Low[RLStren];
for Value22=1 to 10 begin
If RLVal[Value22]<RLVal[0] then begin
RLArrayVal=Value22;
Value22=11;
end;
End;
If Value22<>11 then begin
If RLSet>=0 then begin
RLTLRef2=TL_SetEnd(RLTLRef, Date,Time,TL_GetValue(RLTLRef, date, time));
RLSet2=TL_SetExtRight(RLTLRef, False);
TL_Delete(RLTLRef);
end;
RLTLRef=TL_New(RLDate[RLArrayVal], RLTime[RLArrayVal], RLVal[RLArrayVal], RLDate[0], RLTime[0], RLVal[0]);
RLSet=TL_SetExtRight(RLTLRef, True);
End;
End;
{ Place orders to enter long positions }
If RHTLRef <> -1 then Begin
BuyPrice = TL_GetValue( RHTLRef , Date, Time );
PrevBuyPrice = TL_Getvalue( RHTLRef , Date[1] , Time[1] );
If Close Crosses Over BuyPrice AND Arctangent( PrevBuyPrice / BuyPrice)>10 then
Buy next bar at Market;
End;
{ Place orders to enter short positions }
If RLTLRef <> -1 then Begin
SellPrice = TL_GetValue( RLTLRef , Date , Time );
PrevSellPrice = TL_Getvalue( RLTLRef , Date[1] , Time[1] );
If Close crosses under SellPrice AND Arctangent(SellPrice / PrevSellPrice)>10 then
Sell next bar at Market;
End;
{ Trailing protective stop orders }
ExitLong next bar at Lowest( Low , TrailBar ) Stop;
ExitShort next bar at Highest( High , TrailBar ) Stop;