커뮤니티
수식 문의 드립니다.
2008-05-25 15:47:01
1059
글번호 15526
아래의 것은 ts 수식입니다.
yt로 변환해주실 수 있으신지요?
메일로 답변 부탁드립니다.^^
hjh3489@hanmail.net
입니다.
감사합니다.
Input: FastLen(9), SlowLen(18), ChLen(12), TrailBar(8), Initial(300), ReBars(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 , TrailBar )[1] * 1.02;
LCount = BarNumber;
End;
commentary( barnumber - lcount , lentryprice );
If MarketPosition <> 1 AND BarNumber < LCount + ChLen then
Buy ("Cross Over Buy") Initial Shares next bar at LEntryPrice Stop;
{ Order Placement for Short Positions }
If FastMA crosses under SlowMA and barnumber > 1 then Begin
SEntryPrice = Lowest( Low , TrailBar )[1] *.98;
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;
답변 1
예스스탁 예스스탁 답변
2008-05-26 09:02:13
안녕하세요
예스스탁입니다.
Input: FastLen(9), SlowLen(18), ChLen(12), TrailBar(8), Initial(300), ReBars(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 );
If crossup(FastMA, SlowMA) and index > 1 then {
LEntryPrice = Highest( High , TrailBar )[1] * 1.02;
LCount = index;
}
If MarketPosition <> 1 AND index < LCount + ChLen then
Buy("Cross Over Buy", AtStop, LEntryPrice);
If crossdown(FastMA,SlowMA) and index > 1 then{
SEntryPrice = Lowest( Low , TrailBar )[1] *.98;
SCount = Index;
}
If MarketPosition <> -1 AND index < SCount + ChLen then
Sell("Cross Under Buy",AtStop,SEntryPrice);
If MarketPosition() == 1 then {
LCount = -999;
ExitLong ("LongTStop",AtStop,Lowest(Low,TrailBar));
}
즐거운 하루되세요
> 달려라짹 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다.
> 아래의 것은 ts 수식입니다.
yt로 변환해주실 수 있으신지요?
메일로 답변 부탁드립니다.^^
hjh3489@hanmail.net
입니다.
감사합니다.
Input: FastLen(9), SlowLen(18), ChLen(12), TrailBar(8), Initial(300), ReBars(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 , TrailBar )[1] * 1.02;
LCount = BarNumber;
End;
commentary( barnumber - lcount , lentryprice );
If MarketPosition <> 1 AND BarNumber < LCount + ChLen then
Buy ("Cross Over Buy") Initial Shares next bar at LEntryPrice Stop;
{ Order Placement for Short Positions }
If FastMA crosses under SlowMA and barnumber > 1 then Begin
SEntryPrice = Lowest( Low , TrailBar )[1] *.98;
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;
다음글