커뮤니티
피라미딩 진입, 청산
2012-04-21 03:50:49
429
글번호 50304
매번 빠른답변 감사합니다.
아래의 식에 추가로 한번씩만 더 매수, 매도 피라미딩 집입과 청산을 하고 싶은데요.
첫번째 매수 진입가격보다 atr(30)만큼 오르면, 추가 매수진입.
추가 매수진입한것만 5포인트 이익청산.
첫번째 매도 진입가격보다 atr(30)만큼 내리면, 추가 매도집입.
추가 매도진입한것만 5포인트 이익청산.
이렇게 추가하고 싶은데요, 수식수정 좀 부탁드립니다.
미리 감사드립니다.
----------------------------------------------------------------------------------
Input: FastLen(10), SlowLen(500), ChLen(30), TrailBar(160), ReBars(2), stopPer(1.0);
Vars: FastMA(0), SlowMA(0),LEntryPrice(0), SEntryPrice(0), LCount(-999), SCount(-999), ReCnt(0), MP(0);
FastMA = ma(C , FastLen );
SlowMA = ma(C , SlowLen );
If CrossUp(FastMA , SlowMA) and index > 1 then {
LEntryPrice = Highest(H , TrailBar )[1];
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(L , TrailBar )[1];
SCount = index;
}
If MarketPosition <> -1 AND index < SCount + ChLen then
Sell ("Cross Under Sell", atstop,SEntryPrice );
If MarketPosition == 1 then {
LCount = -999;
ExitLong ("LongTStop", atstop, Lowest(L , TrailBar ));
}
If MarketPosition == -1 then {
SCount = -999;
ExitShort ("ShortTStop", atstop, Highest(H , TrailBar ));
}
답변 1
예스스탁 예스스탁 답변
2012-04-23 11:42:01
안녕하세요
예스스탁입니다.
Input: FastLen(10), SlowLen(500), ChLen(30), TrailBar(160), ReBars(2), stopPer(1.0);
Var : FastMA(0), SlowMA(0),LEntryPrice(0), SEntryPrice(0), LCount(-999), SCount(-999), ReCnt(0), MP(0);
var : ATRV(0);
FastMA = ma(C,FastLen);
SlowMA = ma(C,SlowLen);
ATRV = ATR(30);
If CrossUp(FastMA , SlowMA) and index > 1 then {
LEntryPrice = Highest(H , TrailBar )[1];
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(L , TrailBar )[1];
SCount = index;
}
If MarketPosition <> -1 AND index < SCount + ChLen then
Sell ("Cross Under Sell", atstop,SEntryPrice );
If MarketPosition == 1 then {
LCount = -999;
ExitLong ("LongTStop", atstop, Lowest(L , TrailBar ));
}
If MarketPosition == -1 then {
SCount = -999;
ExitShort ("ShortTStop", atstop, Highest(H , TrailBar ));
}
if MarketPosition == 1 and CurrentEntries == 1 Then
buy("addbuy",AtStop,EntryPrice+ATRV);
if MarketPosition == -1 and CurrentEntries == 1 Then
sell("addsell",AtStop,EntryPrice-ATRV);
if MarketPosition == 1 Then{
if CurrentEntries == 1 then{
if CurrentContracts > CurrentContracts[1] Then
value1 = EntryPrice+ATRV;
exitlong("bx",Atlimit,value1+5,"addbuy");
}
}
if MarketPosition == -1 Then{
if CurrentEntries == 1 then{
if CurrentContracts > CurrentContracts[1] Then
value2 = EntryPrice-ATRV;
ExitShort("sx",Atlimit,value1-5,"addsell");
}
}
즐거운 하루되세요
> 공감n감사 님이 쓴 글입니다.
> 제목 : 피라미딩 진입, 청산
> 매번 빠른답변 감사합니다.
아래의 식에 추가로 한번씩만 더 매수, 매도 피라미딩 집입과 청산을 하고 싶은데요.
첫번째 매수 진입가격보다 atr(30)만큼 오르면, 추가 매수진입.
추가 매수진입한것만 5포인트 이익청산.
첫번째 매도 진입가격보다 atr(30)만큼 내리면, 추가 매도집입.
추가 매도진입한것만 5포인트 이익청산.
이렇게 추가하고 싶은데요, 수식수정 좀 부탁드립니다.
미리 감사드립니다.
----------------------------------------------------------------------------------
Input: FastLen(10), SlowLen(500), ChLen(30), TrailBar(160), ReBars(2), stopPer(1.0);
Vars: FastMA(0), SlowMA(0),LEntryPrice(0), SEntryPrice(0), LCount(-999), SCount(-999), ReCnt(0), MP(0);
FastMA = ma(C , FastLen );
SlowMA = ma(C , SlowLen );
If CrossUp(FastMA , SlowMA) and index > 1 then {
LEntryPrice = Highest(H , TrailBar )[1];
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(L , TrailBar )[1];
SCount = index;
}
If MarketPosition <> -1 AND index < SCount + ChLen then
Sell ("Cross Under Sell", atstop,SEntryPrice );
If MarketPosition == 1 then {
LCount = -999;
ExitLong ("LongTStop", atstop, Lowest(L , TrailBar ));
}
If MarketPosition == -1 then {
SCount = -999;
ExitShort ("ShortTStop", atstop, Highest(H , TrailBar ));
}