커뮤니티
안녕하세요
2017-01-09 13:13:33
134
글번호 105700
1. 아래는 지난번에 작성해주신 수식에서 수정한건데요.
if MarketPosition ==0 and (Xcond == false or (Xcond == true and BarsSinceExit(1) >= 2))
여기에서 2는 봉2개후 진입이런식이 맞는거죠
여기에 5를 입력하면 5캔들 이후에 진입...
그런데 숫자를 바꿔도 시스템에서 반응이 없는데 체크 부탁드립니다.(첨부그림참고)
2. 이부분도 맞는지 확인좀 해주세요
두조건을 넣어도 시스템은 인식을 하는지요?
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then{
ExitLong("본청2",AtStop,EntryPrice+PriceScale*15);
}
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then{
ExitLong("본청3",AtStop,EntryPrice+PriceScale*30);
3. 기존 수식에 음봉이 연속 3개발생하면 매수신호가 발생하지 않게 하고 싶습니다.
수식 작성 부탁드립니다.
매수 : 매수수식 AND (음봉연속3개 발생시 매수신호 발생하지 않음)
매도 : 매도수식 AND (양봉연속3개 발생시 매도신호 발생하지 않음)
var : Xcond(false);
if TotalTrades > TotalTrades[1] and (IsExitName("익절1",1) == true or IsExitName("익절2",1) == true or IsExitName("손절",1) or
IsExitName("본청1",1)== true or IsExitName("본청2",1) or IsExitName("본청3",1))
Then
Xcond = True;
Else
Xcond = false;
if MarketPosition ==0 and (Xcond == false or (Xcond == true and BarsSinceExit(1) >= 5)) then {
매수식 Then{
buy("매수",2);
}
}
if MarketPosition == 1 Then{
ExitLong("익절1",AtLimit,EntryPrice+PriceScale*30,"",1,1);
ExitLong("익절2",AtLimit,EntryPrice+PriceScale*70);
ExitLong("손절",AtStop,EntryPrice-PriceScale*15);
if CurrentContracts == MaxContracts and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then
ExitLong("본청1",AtStop,EntryPrice+PriceScale*1);
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then{
ExitLong("본청2",AtStop,EntryPrice+PriceScale*15);
}
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then{
ExitLong("본청3",AtStop,EntryPrice+PriceScale*30);
}
}
- 1. 2017-01-09_13;12;48.PNG (0.02 MB)
답변 1
예스스탁 예스스탁 답변
2017-01-09 17:24:48
안녕하세요
예스스탁입니다.
1 수정한 식입니다.
var : Xcond(false);
if TotalTrades > TotalTrades[1] Then{
if (IsExitName("익절1",1) == true or IsExitName("익절2",1) == true or IsExitName("손절",1) or
IsExitName("본청1",1)== true or IsExitName("본청2",1) or IsExitName("본청3",1)) Then
Xcond = True;
Else
Xcond = false;
}
if MarketPosition ==0 and (Xcond == false or (Xcond == true and BarsSinceExit(1) >= 5)) then {
if countif(C>O,3) >= 1 and 매수식 Then{
buy("매수",OnClose,def, 2);
}
}
if MarketPosition == 1 Then{
ExitLong("익절1",AtLimit,EntryPrice+PriceScale*30,"",1,1);
ExitLong("익절2",AtLimit,EntryPrice+PriceScale*70);
ExitLong("손절",AtStop,EntryPrice-PriceScale*15);
if CurrentContracts == MaxContracts and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then
ExitLong("본청1",AtStop,EntryPrice+PriceScale*1);
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then{
ExitLong("본청2",AtStop,EntryPrice+PriceScale*15);
}
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then{
ExitLong("본청3",AtStop,EntryPrice+PriceScale*30);
}
}
2
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then{
ExitLong("본청2",AtStop,EntryPrice+PriceScale*15);
}
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then{
ExitLong("본청3",AtStop,EntryPrice+PriceScale*30);
위 내용이면 진입이 2계약씩 하므로
일부청산되고 1계약만(CurrentContracts ==1) 남은 상태일때만
해당 청산이 발생하게 됩니다.
식상으로는 문제가 없습니다.
3
위 식에 매수시 3연속 음봉이 아니라는 내용을 추가했습니다.
매도는 어떤 부분에 추가해야 할지 모르겠습니다.
따로 매도진입식이 있다면 아래 내용 추가하시면 됩니다.
countif(C<O,3) >= 1
매도가 청산식을 의미하신 다면
청산 if문을 아래와 같이 변경하시면 됩니다.
if MarketPosition == 1 and countif(C<O,3) >= 1 Then{
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 1. 아래는 지난번에 작성해주신 수식에서 수정한건데요.
if MarketPosition ==0 and (Xcond == false or (Xcond == true and BarsSinceExit(1) >= 2))
여기에서 2는 봉2개후 진입이런식이 맞는거죠
여기에 5를 입력하면 5캔들 이후에 진입...
그런데 숫자를 바꿔도 시스템에서 반응이 없는데 체크 부탁드립니다.(첨부그림참고)
2. 이부분도 맞는지 확인좀 해주세요
두조건을 넣어도 시스템은 인식을 하는지요?
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then{
ExitLong("본청2",AtStop,EntryPrice+PriceScale*15);
}
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then{
ExitLong("본청3",AtStop,EntryPrice+PriceScale*30);
3. 기존 수식에 음봉이 연속 3개발생하면 매수신호가 발생하지 않게 하고 싶습니다.
수식 작성 부탁드립니다.
매수 : 매수수식 AND (음봉연속3개 발생시 매수신호 발생하지 않음)
매도 : 매도수식 AND (양봉연속3개 발생시 매도신호 발생하지 않음)
var : Xcond(false);
if TotalTrades > TotalTrades[1] and (IsExitName("익절1",1) == true or IsExitName("익절2",1) == true or IsExitName("손절",1) or
IsExitName("본청1",1)== true or IsExitName("본청2",1) or IsExitName("본청3",1))
Then
Xcond = True;
Else
Xcond = false;
if MarketPosition ==0 and (Xcond == false or (Xcond == true and BarsSinceExit(1) >= 5)) then {
매수식 Then{
buy("매수",2);
}
}
if MarketPosition == 1 Then{
ExitLong("익절1",AtLimit,EntryPrice+PriceScale*30,"",1,1);
ExitLong("익절2",AtLimit,EntryPrice+PriceScale*70);
ExitLong("손절",AtStop,EntryPrice-PriceScale*15);
if CurrentContracts == MaxContracts and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then
ExitLong("본청1",AtStop,EntryPrice+PriceScale*1);
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then{
ExitLong("본청2",AtStop,EntryPrice+PriceScale*15);
}
if CurrentContracts ==1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then{
ExitLong("본청3",AtStop,EntryPrice+PriceScale*30);
}
}
다음글
이전글