커뮤니티
15134번 수식 관련
2010-08-11 12:10:56
594
글번호 31498
15134호 관련 아래 수식 잘 받아보았습니다.
그런데 제가 그 아래 수정 수식을 만들어 보았는데 신호가 제대로 발생하지 않는데 이유가 무엇일까요?
보완 부탁드립니다.
<<15134호 관련 수식>>
if MarketPosition == 1 Then{
var1 = CurrentContracts;
if CurrentContracts == MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then
exitlong("bx1",AtStop,L-PriceScale,"",var1-1,1);
if CurrentContracts < MaxContracts Then
exitlong("bx2",AtStop,L-PriceScale);
}
<<수정 수식>>
if MarketPosition == 1 Then{
var1 = CurrentContracts;
If CurrentContracts==1 and data2(C)<data2(L[1]) Then
exitlong("청산2",OnClose);
if CurrentContracts==MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry)<1 and data2(C)<data2(L[1]) Then
exitlong("청산3",OnClose,var1-1);
if CurrentContracts < MaxContracts and data2(C)<data2(L[1]) Then
exitlong("청산4",OnClose);
}
답변 1
예스스탁 예스스탁 답변
2010-08-11 18:01:00
안녕하세요
예스스탁입니다.
시스템함수의 매개변수의 사용이 잘못되었습니다.
청산함수는
("이름",신호타입,신호가격,"진입명",수량,수량옵션);
으로 매개변수를 지정하셔야 합니다.
if dayindex == 0 Then
buy("b",OnClose,def,5);
if MarketPosition == 1 Then{
var1 = CurrentContracts;
If CurrentContracts==1 and data2(C)<data2(L[1]) Then
exitlong("청산2",OnClose);
if CurrentContracts==MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry)<1 and data2(C)<data2(L[1]) Then
exitlong("청산3",OnClose,def,"",var1-1,1);
if CurrentContracts < MaxContracts and data2(C)<data2(L[1]) Then
exitlong("청산4",OnClose);
}
진입은 임의의 진입입니다.
즐거운 하루되세요
> 송사범 님이 쓴 글입니다.
> 제목 : 15134번 수식 관련
> 15134호 관련 아래 수식 잘 받아보았습니다.
그런데 제가 그 아래 수정 수식을 만들어 보았는데 신호가 제대로 발생하지 않는데 이유가 무엇일까요?
보완 부탁드립니다.
<<15134호 관련 수식>>
if MarketPosition == 1 Then{
var1 = CurrentContracts;
if CurrentContracts == MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then
exitlong("bx1",AtStop,L-PriceScale,"",var1-1,1);
if CurrentContracts < MaxContracts Then
exitlong("bx2",AtStop,L-PriceScale);
}
<<수정 수식>>
if MarketPosition == 1 Then{
var1 = CurrentContracts;
If CurrentContracts==1 and data2(C)<data2(L[1]) Then
exitlong("청산2",OnClose);
if CurrentContracts==MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry)<1 and data2(C)<data2(L[1]) Then
exitlong("청산3",OnClose,var1-1);
if CurrentContracts < MaxContracts and data2(C)<data2(L[1]) Then
exitlong("청산4",OnClose);
}