커뮤니티
죄송합니다, 질문 다시 할께요.
2013-08-08 17:54:57
154
글번호 66258
정말 죄송합니다. 질문을 잘못해서 다시 할께요.
# 현재 매수진입중인 포지션들 중에서 제일 낮은 가격의 매수포지션 찾기.
# 현재 매도진입중인 포지션들 중에서 제일 높은 가격의 매도포지션 찾기.
혹시 For문을 이용해서 찾을수 없을까요?
번거롭게 해서 정말 죄송합니다.
답변 1
예스스탁 예스스탁 답변
2013-08-08 18:43:38
안녕하세요
예스스탁입니다.
var : Bcnt(0),BPrice(0),Scnt(0),SPrice(0);
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then{
if countif(CurrentContracts > CurrentContracts[1],BarsSinceEntry) == 1 Then{
Bcnt = 1;
BPrice = EntryPrice;
}
if countif(CurrentContracts > CurrentContracts[1],BarsSinceEntry) >= 2 and
C[1] < BPrice Then{
Bcnt = countif(CurrentContracts > CurrentContracts[1],BarsSinceEntry);
BPrice = C[1];
}
}
}
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then{
if countif(CurrentContracts > CurrentContracts[1],BarsSinceEntry) == 1 Then{
Scnt = 1;
SPrice = EntryPrice;
}
if countif(CurrentContracts > CurrentContracts[1],BarsSinceEntry) >= 2 and
C[1] > SPrice Then{
Scnt = countif(CurrentContracts > CurrentContracts[1],BarsSinceEntry);
SPrice = C[1];
}
}
}
진입이 발생할때마다 값만 갱신하면 되는 내용이므로
for문을 사용할만한 내용은 아닙니다.
즐거운 하루되세요
> 무결점 님이 쓴 글입니다.
> 제목 : 죄송합니다, 질문 다시 할께요.
> 정말 죄송합니다. 질문을 잘못해서 다시 할께요.
# 현재 매수진입중인 포지션들 중에서 제일 낮은 가격의 매수포지션 찾기.
# 현재 매도진입중인 포지션들 중에서 제일 높은 가격의 매도포지션 찾기.
혹시 For문을 이용해서 찾을수 없을까요?
번거롭게 해서 정말 죄송합니다.
다음글