커뮤니티
문의 드립니다
2009-01-29 09:53:16
617
글번호 19830
두가지 문의 드립니다.(미리 감사드립니다)
1. 5/20크로스를 "첫진입"으로하고, 5/60 크로스를 "두번째" 진입으로할때
청산을 각각 따로 따로 하고 싶습니다.
첫진입을 +1포, 두번째 진입을 +2포 로 수익청산.
2. 어제 보내주신 식인데요 매도로 바꾸니 잘먹히네요 매도식도 추가부탁 드립니다.
if crossup(ma(c,5),ma(c,20)) and CurrentEntries == 0 Then
buy();
if MarketPosition() == 1 and CurrentEntries < 5 Then{
buy("b",AtLimit,EntryPrice()-(0.2*CurrentEntries),1);
}
if CurrentEntries == 1 Then
exitlong("X1",atlimit,EntryPrice+1);
if CurrentEntries == 2 Then
exitlong("X2",atlimit,EntryPrice+0.8);
if CurrentEntries == 3 Then
exitlong("X3",atlimit,EntryPrice+0.6);
if CurrentEntries == 4 Then
exitlong("X4",atlimit,EntryPrice+0.4);
if CurrentEntries == 5 Then
exitlong("X5",atlimit,EntryPrice+0.2);
답변 1
예스스탁 예스스탁 답변
2009-01-29 12:46:29
안녕하세요
예스스탁입니다.
1.
if crossup(ma(c,5),ma(c,20)) and CurrentEntries == 0 Then
buy("b1",OnClose,def,1);
if crossup(ma(c,5),ma(c,60)) and CurrentEntries == 1 Then
buy("b2",OnClose,def,1);
if MarketPosition() == 1 Then{
if Highest(CurrentEntries,BarsSinceEntry) == 2 Then{
if CurrentContracts == 2 Then
exitlong("XL1",AtLimit,EntryPrice+1,"",1,1);
if CurrentContracts == 1 Then
exitlong("XL2",AtLimit,EntryPrice+2,"",1,1);
}
if Highest(CurrentEntries,BarsSinceEntry) == 1 Then{
if CurrentContracts == 1 Then
exitlong("XL3",AtLimit,EntryPrice+1,"",1,1);
}
}
2.
if CrossDown(ma(c,5),ma(c,20)) and CurrentEntries == 0 Then
Sell("sell");
if MarketPosition() == -1 and CurrentEntries < 5 Then{
Sell("s",AtLimit,EntryPrice()+(0.2*CurrentEntries),1);
}
if CurrentEntries == 1 Then
ExitShort("XS1",atlimit,EntryPrice-1);
if CurrentEntries == 2 Then
ExitShort("XS2",atlimit,EntryPrice-0.8);
if CurrentEntries == 3 Then
ExitShort("XS3",atlimit,EntryPrice-0.6);
if CurrentEntries == 4 Then
ExitShort("XS4",atlimit,EntryPrice-0.4);
if CurrentEntries == 5 Then
ExitShort("XS5",atlimit,EntryPrice-0.2);
즐거운 하루되세요
> 털보 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 두가지 문의 드립니다.(미리 감사드립니다)
1. 5/20크로스를 "첫진입"으로하고, 5/60 크로스를 "두번째" 진입으로할때
청산을 각각 따로 따로 하고 싶습니다.
첫진입을 +1포, 두번째 진입을 +2포 로 수익청산.
2. 어제 보내주신 식인데요 매도로 바꾸니 잘먹히네요 매도식도 추가부탁 드립니다.
if crossup(ma(c,5),ma(c,20)) and CurrentEntries == 0 Then
buy();
if MarketPosition() == 1 and CurrentEntries < 5 Then{
buy("b",AtLimit,EntryPrice()-(0.2*CurrentEntries),1);
}
if CurrentEntries == 1 Then
exitlong("X1",atlimit,EntryPrice+1);
if CurrentEntries == 2 Then
exitlong("X2",atlimit,EntryPrice+0.8);
if CurrentEntries == 3 Then
exitlong("X3",atlimit,EntryPrice+0.6);
if CurrentEntries == 4 Then
exitlong("X4",atlimit,EntryPrice+0.4);
if CurrentEntries == 5 Then
exitlong("X5",atlimit,EntryPrice+0.2);
다음글
이전글