커뮤니티
추가해주세요---------------
2011-02-05 12:09:02
685
글번호 35477
Input : Period(1),maP(30),N(0.03),Tr1(1.2),Tr2(2),진입(1000);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if stime >= 93000 and stime < 145000 then{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N Then
Sell();
SetStopLoss(PriceScale*20,PointStop);
#SetStopProfittarget(PriceScale*17,PointStop);
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-Tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-Tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+Tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+Tr2);
}
}
위식에 포지션있을때 이평이 횡보(전봉과값이같으면)하면 청산되게해주세요
새해복많이 받으세요
답변 2
예스스탁 예스스탁 답변
2011-02-07 11:38:41
안녕하세요
예스스탁입니다.
Input : Period(1),maP(30),N(0.03),Tr1(1.2),Tr2(2),진입(1000),이평기간(20);
Var : value(0),이평(0);
value = ma(bids,period)-ma(asks,period);
이평 = ma(C,이평기간);
if stime >= 93000 and stime < 145000 then{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N Then
Sell();
SetStopLoss(PriceScale*20,PointStop);
#SetStopProfittarget(PriceScale*17,PointStop);
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-Tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-Tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+Tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+Tr2);
}
}
if MarketPosition != 0 Then{
if 이평==이평[1] then{
exitlong();
ExitShort();
}
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 추가해주세요---------------
> Input : Period(1),maP(30),N(0.03),Tr1(1.2),Tr2(2),진입(1000);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if stime >= 93000 and stime < 145000 then{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N Then
Sell();
SetStopLoss(PriceScale*20,PointStop);
#SetStopProfittarget(PriceScale*17,PointStop);
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-Tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-Tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+Tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+Tr2);
}
}
위식에 포지션있을때 이평이 횡보(전봉과값이같으면)하면 청산되게해주세요
새해복많이 받으세요
회원
2012-06-08 09:05:22
관리자님에 의해 삭제된 답변입니다.
다음글